summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-11-30 21:03:32 +0100
committerGitHub <noreply@github.com>2021-11-30 21:03:32 +0100
commit295a6f7dd086731448a1168a349f62d3035258ca (patch)
tree30edd7597fe321c138d59f106de356f860ff14cc /test
parent85101f69d8ac18dcd66e19a8a368fbcc4c5e21aa (diff)
parent8eb0be0a29a647308b3ed9eab2126e1004b6ba85 (diff)
downloadpodman-295a6f7dd086731448a1168a349f62d3035258ca.tar.gz
podman-295a6f7dd086731448a1168a349f62d3035258ca.tar.bz2
podman-295a6f7dd086731448a1168a349f62d3035258ca.zip
Merge pull request #12454 from edsantiago/remove_betrue
More BeTrue cleanup
Diffstat (limited to 'test')
-rw-r--r--test/e2e/build_test.go11
-rw-r--r--test/e2e/checkpoint_test.go2
-rw-r--r--test/e2e/commit_test.go4
-rw-r--r--test/e2e/create_test.go22
-rw-r--r--test/e2e/diff_test.go2
-rw-r--r--test/e2e/generate_kube_test.go2
-rw-r--r--test/e2e/generate_systemd_test.go2
-rw-r--r--test/e2e/history_test.go2
-rw-r--r--test/e2e/image_sign_test.go2
-rw-r--r--test/e2e/images_test.go8
-rw-r--r--test/e2e/inspect_test.go14
-rw-r--r--test/e2e/load_test.go6
-rw-r--r--test/e2e/mount_test.go4
-rw-r--r--test/e2e/network_test.go9
-rw-r--r--test/e2e/pod_create_test.go20
-rw-r--r--test/e2e/pod_inspect_test.go4
-rw-r--r--test/e2e/pod_stats_test.go4
-rw-r--r--test/e2e/ps_test.go6
-rw-r--r--test/e2e/run_networking_test.go6
-rw-r--r--test/e2e/run_test.go2
-rw-r--r--test/e2e/run_userns_test.go2
-rw-r--r--test/e2e/run_volume_test.go12
-rw-r--r--test/e2e/runlabel_test.go4
-rw-r--r--test/e2e/search_test.go4
-rw-r--r--test/e2e/secret_test.go4
-rw-r--r--test/e2e/stats_test.go2
-rw-r--r--test/e2e/systemd_test.go2
-rw-r--r--test/e2e/trust_test.go4
-rw-r--r--test/e2e/volume_inspect_test.go5
-rw-r--r--test/e2e/volume_ls_test.go2
-rw-r--r--test/utils/matchers.go30
31 files changed, 113 insertions, 90 deletions
diff --git a/test/e2e/build_test.go b/test/e2e/build_test.go
index c541f25ae..5e93f9078 100644
--- a/test/e2e/build_test.go
+++ b/test/e2e/build_test.go
@@ -427,13 +427,10 @@ subdir**`
session := podmanTest.Podman([]string{"build", "-t", "test", "."})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- ok, _ := session.GrepString("/testfilter/dummy1")
- Expect(ok).NotTo(BeTrue())
- Expect(session.OutputToString()).To(ContainSubstring("/testfilter/dummy2"))
- ok, _ = session.GrepString("/testfilter/subdir")
- Expect(ok).NotTo(BeTrue()) //.dockerignore filters both subdir and inside subdir
- ok, _ = session.GrepString("/testfilter/subdir/dummy3")
- Expect(ok).NotTo(BeTrue())
+ output := session.OutputToString()
+ Expect(output).To(ContainSubstring("/testfilter/dummy2"))
+ Expect(output).NotTo(ContainSubstring("/testfilter/dummy1"))
+ Expect(output).NotTo(ContainSubstring("/testfilter/subdir"))
})
It("podman remote test context dir contains empty dirs and symlinks", func() {
diff --git a/test/e2e/checkpoint_test.go b/test/e2e/checkpoint_test.go
index 318e3617e..e068a6582 100644
--- a/test/e2e/checkpoint_test.go
+++ b/test/e2e/checkpoint_test.go
@@ -102,7 +102,7 @@ var _ = Describe("Podman checkpoint", func() {
inspect.WaitWithDefaultTimeout()
Expect(inspect).Should(Exit(0))
inspectOut := inspect.InspectContainerToJSON()
- Expect(inspectOut[0].State.Checkpointed).To(BeTrue())
+ Expect(inspectOut[0].State.Checkpointed).To(BeTrue(), ".State.Checkpointed")
result = podmanTest.Podman([]string{"container", "restore", cid})
result.WaitWithDefaultTimeout()
diff --git a/test/e2e/commit_test.go b/test/e2e/commit_test.go
index 20e1360de..b751c338f 100644
--- a/test/e2e/commit_test.go
+++ b/test/e2e/commit_test.go
@@ -225,7 +225,7 @@ var _ = Describe("Podman commit", func() {
Expect(inspect).Should(Exit(0))
image := inspect.InspectImageJSON()
_, ok := image[0].Config.Volumes["/foo"]
- Expect(ok).To(BeTrue())
+ Expect(ok).To(BeTrue(), ".Config.Volumes[/foo]")
r := podmanTest.Podman([]string{"run", "newimage"})
r.WaitWithDefaultTimeout()
@@ -250,7 +250,7 @@ var _ = Describe("Podman commit", func() {
for _, v := range image[0].Config.Env {
envMap[v] = true
}
- Expect(envMap["TEST=1=1-01=9.01"]).To(BeTrue())
+ Expect(envMap["TEST=1=1-01=9.01"]).To(BeTrue(), "envMap[TEST=1=1-01=9.01]")
})
It("podman commit container and print id to external file", func() {
diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go
index 216432216..52d439f4a 100644
--- a/test/e2e/create_test.go
+++ b/test/e2e/create_test.go
@@ -108,7 +108,7 @@ var _ = Describe("Podman create", func() {
check.WaitWithDefaultTimeout()
data := check.InspectContainerToJSON()
value, ok := data[0].Config.Annotations["HELLO"]
- Expect(ok).To(BeTrue())
+ Expect(ok).To(BeTrue(), ".Config.Annotations[HELLO]")
Expect(value).To(Equal("WORLD"))
})
@@ -202,7 +202,7 @@ var _ = Describe("Podman create", func() {
Expect(session).Should(Exit(0))
Expect(session.OutputToString()).To(ContainSubstring("/create/test ro"))
- session = podmanTest.Podman([]string{"create", "--log-driver", "k8s-file", "--name", "test_shared", "--mount", fmt.Sprintf("type=bind,src=%s,target=/create/test,shared", mountPath), ALPINE, "grep", "/create/test", "/proc/self/mountinfo"})
+ session = podmanTest.Podman([]string{"create", "--log-driver", "k8s-file", "--name", "test_shared", "--mount", fmt.Sprintf("type=bind,src=%s,target=/create/test,shared", mountPath), ALPINE, "awk", `$5 == "/create/test" { print $6 " " $7}`, "/proc/self/mountinfo"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
session = podmanTest.Podman([]string{"start", "test_shared"})
@@ -211,10 +211,8 @@ var _ = Describe("Podman create", func() {
session = podmanTest.Podman([]string{"logs", "test_shared"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- found, matches := session.GrepString("/create/test")
- Expect(found).Should(BeTrue())
- Expect(matches[0]).To(ContainSubstring("rw"))
- Expect(matches[0]).To(ContainSubstring("shared"))
+ Expect(session.OutputToString()).To(ContainSubstring("rw"))
+ Expect(session.OutputToString()).To(ContainSubstring("shared"))
mountPath = filepath.Join(podmanTest.TempDir, "scratchpad")
os.Mkdir(mountPath, 0755)
@@ -263,7 +261,7 @@ var _ = Describe("Podman create", func() {
session = podmanTest.Podman([]string{"pod", "inspect", podName})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.IsJSONOutputValid()).To(BeTrue())
+ Expect(session.OutputToString()).To(BeValidJSON())
podData := session.InspectPodToJSON()
// Finally we can create a container with --pod-id-file and do
@@ -386,12 +384,12 @@ var _ = Describe("Podman create", func() {
inspect := podmanTest.Podman([]string{"inspect", ctrName})
inspect.WaitWithDefaultTimeout()
data := inspect.InspectContainerToJSON()
- Expect(len(data)).To(Equal(1))
+ Expect(len(data)).To(Equal(1), "len(InspectContainerToJSON)")
Expect(len(data[0].Config.Labels)).To(Equal(2))
_, ok1 := data[0].Config.Labels["TESTKEY1"]
- Expect(ok1).To(BeTrue())
+ Expect(ok1).To(BeTrue(), ".Config.Labels[TESTKEY1]")
_, ok2 := data[0].Config.Labels["TESTKEY2"]
- Expect(ok2).To(BeTrue())
+ Expect(ok2).To(BeTrue(), ".Config.Labels[TESTKEY2]")
})
It("podman create with set label", func() {
@@ -407,10 +405,10 @@ var _ = Describe("Podman create", func() {
Expect(len(data)).To(Equal(1))
Expect(len(data[0].Config.Labels)).To(Equal(2))
val1, ok1 := data[0].Config.Labels["TESTKEY1"]
- Expect(ok1).To(BeTrue())
+ Expect(ok1).To(BeTrue(), ".Config.Labels[TESTKEY1]")
Expect(val1).To(Equal("value1"))
val2, ok2 := data[0].Config.Labels["TESTKEY2"]
- Expect(ok2).To(BeTrue())
+ Expect(ok2).To(BeTrue(), ".Config.Labels[TESTKEY2]")
Expect(val2).To(Equal("bar"))
})
diff --git a/test/e2e/diff_test.go b/test/e2e/diff_test.go
index 71696f5b6..80647c6f5 100644
--- a/test/e2e/diff_test.go
+++ b/test/e2e/diff_test.go
@@ -53,7 +53,7 @@ var _ = Describe("Podman diff", func() {
session := podmanTest.Podman([]string{"diff", "--format=json", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.IsJSONOutputValid()).To(BeTrue())
+ Expect(session.OutputToString()).To(BeValidJSON())
})
It("podman diff container and committed image", func() {
diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go
index a148025e5..62482598a 100644
--- a/test/e2e/generate_kube_test.go
+++ b/test/e2e/generate_kube_test.go
@@ -607,7 +607,7 @@ var _ = Describe("Podman generate kube", func() {
err = yaml.Unmarshal(b, pod)
Expect(err).To(BeNil())
val, found := pod.Annotations[define.BindMountPrefix+vol1]
- Expect(found).To(BeTrue())
+ Expect(found).To(BeTrue(), "pod.Annotations["+vol1+"]")
Expect(val).To(HaveSuffix("z"))
rm := podmanTest.Podman([]string{"pod", "rm", "-t", "0", "-f", "test1"})
diff --git a/test/e2e/generate_systemd_test.go b/test/e2e/generate_systemd_test.go
index e93482535..1cffdc62e 100644
--- a/test/e2e/generate_systemd_test.go
+++ b/test/e2e/generate_systemd_test.go
@@ -420,7 +420,7 @@ var _ = Describe("Podman generate systemd", func() {
session := podmanTest.Podman([]string{"generate", "systemd", "--format", "json", "foo"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.IsJSONOutputValid()).To(BeTrue())
+ Expect(session.OutputToString()).To(BeValidJSON())
})
It("podman generate systemd --new create command with double curly braces", func() {
diff --git a/test/e2e/history_test.go b/test/e2e/history_test.go
index 0f0f6d38a..1f8faa6c2 100644
--- a/test/e2e/history_test.go
+++ b/test/e2e/history_test.go
@@ -89,6 +89,6 @@ var _ = Describe("Podman history", func() {
session := podmanTest.Podman([]string{"history", "--format=json", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.IsJSONOutputValid()).To(BeTrue())
+ Expect(session.OutputToString()).To(BeValidJSON())
})
})
diff --git a/test/e2e/image_sign_test.go b/test/e2e/image_sign_test.go
index 6b87c9edd..09e156e02 100644
--- a/test/e2e/image_sign_test.go
+++ b/test/e2e/image_sign_test.go
@@ -73,6 +73,6 @@ var _ = Describe("Podman image sign", func() {
Expect(session).Should(Exit(0))
fInfos, err := ioutil.ReadDir(filepath.Join(sigDir, "library"))
Expect(err).To(BeNil())
- Expect(len(fInfos) > 1).To(BeTrue())
+ Expect(len(fInfos)).To(BeNumerically(">", 1), "len(fInfos)")
})
})
diff --git a/test/e2e/images_test.go b/test/e2e/images_test.go
index 3ed8ef462..8e21ca606 100644
--- a/test/e2e/images_test.go
+++ b/test/e2e/images_test.go
@@ -94,14 +94,14 @@ var _ = Describe("Podman images", func() {
session := podmanTest.Podman([]string{"images", "--format=json", "not-existing-image"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.IsJSONOutputValid()).To(BeTrue())
+ Expect(session.OutputToString()).To(BeValidJSON())
})
It("podman images in JSON format", func() {
session := podmanTest.Podman([]string{"images", "--format=json"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.IsJSONOutputValid()).To(BeTrue())
+ Expect(session.OutputToString()).To(BeValidJSON())
})
It("podman images in GO template format", func() {
@@ -254,7 +254,7 @@ WORKDIR /test
session := podmanTest.Podman([]string{"inspect", "--format=json", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.IsJSONOutputValid()).To(BeTrue())
+ Expect(session.OutputToString()).To(BeValidJSON())
imageData := session.InspectImageJSON()
result := podmanTest.Podman([]string{"images", "sha256:" + imageData[0].ID})
@@ -266,7 +266,7 @@ WORKDIR /test
session := podmanTest.Podman([]string{"image", "inspect", "--format=json", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.IsJSONOutputValid()).To(BeTrue())
+ Expect(session.OutputToString()).To(BeValidJSON())
imageData := session.InspectImageJSON()
result := podmanTest.Podman([]string{"image", "ls", fmt.Sprintf("sha256:%s", imageData[0].ID)})
diff --git a/test/e2e/inspect_test.go b/test/e2e/inspect_test.go
index 52726015c..0f0237adc 100644
--- a/test/e2e/inspect_test.go
+++ b/test/e2e/inspect_test.go
@@ -38,7 +38,7 @@ var _ = Describe("Podman inspect", func() {
session := podmanTest.Podman([]string{"inspect", "--format=json", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.IsJSONOutputValid()).To(BeTrue())
+ Expect(session.OutputToString()).To(BeValidJSON())
imageData := session.InspectImageJSON()
Expect(imageData[0].RepoTags[0]).To(Equal("quay.io/libpod/alpine:latest"))
})
@@ -314,7 +314,7 @@ var _ = Describe("Podman inspect", func() {
inspect := podmanTest.Podman([]string{"inspect", podName})
inspect.WaitWithDefaultTimeout()
Expect(inspect).Should(Exit(0))
- Expect(inspect.IsJSONOutputValid()).To(BeTrue())
+ Expect(inspect.OutputToString()).To(BeValidJSON())
podData := inspect.InspectPodArrToJSON()
Expect(podData[0].Name).To(Equal(podName))
})
@@ -328,7 +328,7 @@ var _ = Describe("Podman inspect", func() {
inspect := podmanTest.Podman([]string{"inspect", "--type", "pod", podName})
inspect.WaitWithDefaultTimeout()
Expect(inspect).Should(Exit(0))
- Expect(inspect.IsJSONOutputValid()).To(BeTrue())
+ Expect(inspect.OutputToString()).To(BeValidJSON())
podData := inspect.InspectPodArrToJSON()
Expect(podData[0].Name).To(Equal(podName))
})
@@ -343,7 +343,7 @@ var _ = Describe("Podman inspect", func() {
inspect := podmanTest.Podman([]string{"inspect", "--type", "pod", "--latest"})
inspect.WaitWithDefaultTimeout()
Expect(inspect).Should(Exit(0))
- Expect(inspect.IsJSONOutputValid()).To(BeTrue())
+ Expect(inspect.OutputToString()).To(BeValidJSON())
podData := inspect.InspectPodArrToJSON()
Expect(podData[0].Name).To(Equal(podName))
})
@@ -357,14 +357,14 @@ var _ = Describe("Podman inspect", func() {
inspect1 := podmanTest.Podman([]string{"inspect", "--type", "pod", podName})
inspect1.WaitWithDefaultTimeout()
Expect(inspect1).Should(Exit(0))
- Expect(inspect1.IsJSONOutputValid()).To(BeTrue())
+ Expect(inspect1.OutputToString()).To(BeValidJSON())
podData := inspect1.InspectPodArrToJSON()
infra := podData[0].Containers[0].Name
inspect := podmanTest.Podman([]string{"inspect", "--latest"})
inspect.WaitWithDefaultTimeout()
Expect(inspect).Should(Exit(0))
- Expect(inspect.IsJSONOutputValid()).To(BeTrue())
+ Expect(inspect.OutputToString()).To(BeValidJSON())
containerData := inspect.InspectContainerToJSON()
Expect(containerData[0].Name).To(Equal(infra))
})
@@ -388,7 +388,7 @@ var _ = Describe("Podman inspect", func() {
session = podmanTest.Podman([]string{"inspect", volName})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.IsJSONOutputValid()).To(BeTrue())
+ Expect(session.OutputToString()).To(BeValidJSON())
})
It("podman inspect a volume with --format", func() {
diff --git a/test/e2e/load_test.go b/test/e2e/load_test.go
index 030e9f80b..ad5634e0c 100644
--- a/test/e2e/load_test.go
+++ b/test/e2e/load_test.go
@@ -221,7 +221,7 @@ var _ = Describe("Podman load", func() {
result := podmanTest.Podman([]string{"images", "hello:world"})
result.WaitWithDefaultTimeout()
- Expect(result.LineInOutputContains("docker")).To(Not(BeTrue()))
+ Expect(result.OutputToString()).To(Not(ContainSubstring("docker")))
Expect(result.OutputToString()).To(ContainSubstring("localhost"))
})
@@ -246,7 +246,7 @@ var _ = Describe("Podman load", func() {
result := podmanTest.Podman([]string{"images", "hello:latest"})
result.WaitWithDefaultTimeout()
- Expect(result.LineInOutputContains("docker")).To(Not(BeTrue()))
+ Expect(result.OutputToString()).To(Not(ContainSubstring("docker")))
Expect(result.OutputToString()).To(ContainSubstring("localhost"))
})
@@ -272,7 +272,7 @@ var _ = Describe("Podman load", func() {
result := podmanTest.Podman([]string{"images", "load:latest"})
result.WaitWithDefaultTimeout()
- Expect(result.LineInOutputContains("docker")).To(Not(BeTrue()))
+ Expect(result.OutputToString()).To(Not(ContainSubstring("docker")))
Expect(result.OutputToString()).To(ContainSubstring("localhost"))
})
diff --git a/test/e2e/mount_test.go b/test/e2e/mount_test.go
index 5ecd61097..0555a0749 100644
--- a/test/e2e/mount_test.go
+++ b/test/e2e/mount_test.go
@@ -78,7 +78,7 @@ var _ = Describe("Podman mount", func() {
j := podmanTest.Podman([]string{"mount", "--format=json"})
j.WaitWithDefaultTimeout()
Expect(j).Should(Exit(0))
- Expect(j.IsJSONOutputValid()).To(BeTrue())
+ Expect(j.OutputToString()).To(BeValidJSON())
j = podmanTest.Podman([]string{"mount", "--format='{{.foobar}}'"})
j.WaitWithDefaultTimeout()
@@ -332,7 +332,7 @@ var _ = Describe("Podman mount", func() {
j := podmanTest.Podman([]string{"image", "mount", "--format=json"})
j.WaitWithDefaultTimeout()
Expect(j).Should(Exit(0))
- Expect(j.IsJSONOutputValid()).To(BeTrue())
+ Expect(j.OutputToString()).To(BeValidJSON())
umount := podmanTest.Podman([]string{"image", "umount", fedoraMinimal})
umount.WaitWithDefaultTimeout()
diff --git a/test/e2e/network_test.go b/test/e2e/network_test.go
index 734a45bca..ff306f0f8 100644
--- a/test/e2e/network_test.go
+++ b/test/e2e/network_test.go
@@ -4,7 +4,6 @@ import (
"encoding/json"
"fmt"
"os"
- "strings"
"time"
"github.com/containers/podman/v3/libpod/network/types"
@@ -234,7 +233,7 @@ var _ = Describe("Podman network", func() {
session := podmanTest.Podman(append([]string{"network", "inspect"}, expectedNetworks...))
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.IsJSONOutputValid()).To(BeTrue())
+ Expect(session.OutputToString()).To(BeValidJSON())
})
It("podman network inspect", func() {
@@ -269,7 +268,7 @@ var _ = Describe("Podman network", func() {
Expect(ok).To(BeTrue())
Expect(net.NetworkID).To(Equal(netName))
Expect(net.IPPrefixLen).To(Equal(24))
- Expect(strings.HasPrefix(net.IPAddress, "10.50.50.")).To(BeTrue())
+ Expect(net.IPAddress).To(HavePrefix("10.50.50."))
// Necessary to ensure the CNI network is removed cleanly
rmAll := podmanTest.Podman([]string{"rm", "-t", "0", "-f", ctrName})
@@ -342,12 +341,12 @@ var _ = Describe("Podman network", func() {
Expect(ok).To(BeTrue())
Expect(net1.NetworkID).To(Equal(netName1))
Expect(net1.IPPrefixLen).To(Equal(25))
- Expect(strings.HasPrefix(net1.IPAddress, "10.50.51.")).To(BeTrue())
+ Expect(net1.IPAddress).To(HavePrefix("10.50.51."))
net2, ok := conData[0].NetworkSettings.Networks[netName2]
Expect(ok).To(BeTrue())
Expect(net2.NetworkID).To(Equal(netName2))
Expect(net2.IPPrefixLen).To(Equal(26))
- Expect(strings.HasPrefix(net2.IPAddress, "10.50.51.")).To(BeTrue())
+ Expect(net2.IPAddress).To(HavePrefix("10.50.51."))
// Necessary to ensure the CNI network is removed cleanly
rmAll := podmanTest.Podman([]string{"rm", "-t", "0", "-f", ctrName})
diff --git a/test/e2e/pod_create_test.go b/test/e2e/pod_create_test.go
index a3dde3650..186688b93 100644
--- a/test/e2e/pod_create_test.go
+++ b/test/e2e/pod_create_test.go
@@ -173,7 +173,7 @@ var _ = Describe("Podman pod create", func() {
podResolvConf := podmanTest.Podman([]string{"run", "--pod", name, "-ti", "--rm", ALPINE, "cat", "/etc/hosts"})
podResolvConf.WaitWithDefaultTimeout()
Expect(podResolvConf).Should(Exit(0))
- Expect(strings.Contains(podResolvConf.OutputToString(), "12.34.56.78 test.example.com")).To(BeTrue())
+ Expect(podResolvConf.OutputToString()).To(ContainSubstring("12.34.56.78 test.example.com"))
})
It("podman create pod with --add-host and no infra should fail", func() {
@@ -193,7 +193,7 @@ var _ = Describe("Podman pod create", func() {
podResolvConf := podmanTest.Podman([]string{"run", "--pod", name, "-ti", "--rm", ALPINE, "cat", "/etc/resolv.conf"})
podResolvConf.WaitWithDefaultTimeout()
Expect(podResolvConf).Should(Exit(0))
- Expect(strings.Contains(podResolvConf.OutputToString(), fmt.Sprintf("nameserver %s", server))).To(BeTrue())
+ Expect(podResolvConf.OutputToString()).To(ContainSubstring("nameserver %s", server))
})
It("podman create pod with DNS server set and no infra should fail", func() {
@@ -214,7 +214,7 @@ var _ = Describe("Podman pod create", func() {
podResolvConf := podmanTest.Podman([]string{"run", "--pod", name, "-ti", "--rm", ALPINE, "cat", "/etc/resolv.conf"})
podResolvConf.WaitWithDefaultTimeout()
Expect(podResolvConf).Should(Exit(0))
- Expect(strings.Contains(podResolvConf.OutputToString(), fmt.Sprintf("options %s", option))).To(BeTrue())
+ Expect(podResolvConf.OutputToString()).To(ContainSubstring(fmt.Sprintf("options %s", option)))
})
It("podman create pod with DNS option set and no infra should fail", func() {
@@ -235,7 +235,7 @@ var _ = Describe("Podman pod create", func() {
podResolvConf := podmanTest.Podman([]string{"run", "--pod", name, "-ti", "--rm", ALPINE, "cat", "/etc/resolv.conf"})
podResolvConf.WaitWithDefaultTimeout()
Expect(podResolvConf).Should(Exit(0))
- Expect(strings.Contains(podResolvConf.OutputToString(), fmt.Sprintf("search %s", search))).To(BeTrue())
+ Expect(podResolvConf.OutputToString()).To(ContainSubstring(fmt.Sprintf("search %s", search)))
})
It("podman create pod with DNS search domain set and no infra should fail", func() {
@@ -259,7 +259,7 @@ var _ = Describe("Podman pod create", func() {
podResolvConf := podmanTest.Podman([]string{"run", "--pod", name, "-ti", "--rm", ALPINE, "ip", "addr"})
podResolvConf.WaitWithDefaultTimeout()
Expect(podResolvConf).Should(Exit(0))
- Expect(strings.Contains(podResolvConf.OutputToString(), ip)).To(BeTrue())
+ Expect(podResolvConf.OutputToString()).To(ContainSubstring(ip))
}
})
@@ -302,7 +302,7 @@ var _ = Describe("Podman pod create", func() {
podResolvConf := podmanTest.Podman([]string{"run", "--pod", name, "-ti", "--rm", ALPINE, "ip", "addr"})
podResolvConf.WaitWithDefaultTimeout()
Expect(podResolvConf).Should(Exit(0))
- Expect(strings.Contains(podResolvConf.OutputToString(), mac)).To(BeTrue())
+ Expect(podResolvConf.OutputToString()).To(ContainSubstring(mac))
}
})
@@ -474,7 +474,7 @@ entrypoint ["/fromimage"]
status1 := podmanTest.Podman([]string{"pod", "inspect", "--format", "{{ .State }}", podName})
status1.WaitWithDefaultTimeout()
Expect(status1).Should(Exit(0))
- Expect(strings.Contains(status1.OutputToString(), "Created")).To(BeTrue())
+ Expect(status1.OutputToString()).To(ContainSubstring("Created"))
ctr1 := podmanTest.Podman([]string{"run", "--pod", podName, "-d", ALPINE, "top"})
ctr1.WaitWithDefaultTimeout()
@@ -483,7 +483,7 @@ entrypoint ["/fromimage"]
status2 := podmanTest.Podman([]string{"pod", "inspect", "--format", "{{ .State }}", podName})
status2.WaitWithDefaultTimeout()
Expect(status2).Should(Exit(0))
- Expect(strings.Contains(status2.OutputToString(), "Running")).To(BeTrue())
+ Expect(status2.OutputToString()).To(ContainSubstring("Running"))
ctr2 := podmanTest.Podman([]string{"create", "--pod", podName, ALPINE, "top"})
ctr2.WaitWithDefaultTimeout()
@@ -492,7 +492,7 @@ entrypoint ["/fromimage"]
status3 := podmanTest.Podman([]string{"pod", "inspect", "--format", "{{ .State }}", podName})
status3.WaitWithDefaultTimeout()
Expect(status3).Should(Exit(0))
- Expect(strings.Contains(status3.OutputToString(), "Degraded")).To(BeTrue())
+ Expect(status3.OutputToString()).To(ContainSubstring("Degraded"))
})
It("podman create with unsupported network options", func() {
@@ -725,7 +725,7 @@ ENTRYPOINT ["sleep","99999"]
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
l := session.OutputToString()
- Expect(strings.Contains(l, "1024")).To(BeTrue())
+ Expect(l).To(ContainSubstring("1024"))
m[l] = l
}
// check for no duplicates
diff --git a/test/e2e/pod_inspect_test.go b/test/e2e/pod_inspect_test.go
index 5728cf9b9..8a6f2a367 100644
--- a/test/e2e/pod_inspect_test.go
+++ b/test/e2e/pod_inspect_test.go
@@ -56,7 +56,7 @@ var _ = Describe("Podman pod inspect", func() {
inspect := podmanTest.Podman([]string{"pod", "inspect", podid})
inspect.WaitWithDefaultTimeout()
Expect(inspect).Should(Exit(0))
- Expect(inspect.IsJSONOutputValid()).To(BeTrue())
+ Expect(inspect.OutputToString()).To(BeValidJSON())
podData := inspect.InspectPodToJSON()
Expect(podData.ID).To(Equal(podid))
})
@@ -75,7 +75,7 @@ var _ = Describe("Podman pod inspect", func() {
inspect := podmanTest.Podman([]string{"pod", "inspect", podName})
inspect.WaitWithDefaultTimeout()
Expect(inspect).Should(Exit(0))
- Expect(inspect.IsJSONOutputValid()).To(BeTrue())
+ Expect(inspect.OutputToString()).To(BeValidJSON())
podData := inspect.InspectPodToJSON()
// Let's get the last len(createCommand) items in the command.
inspectCreateCommand := podData.CreateCommand
diff --git a/test/e2e/pod_stats_test.go b/test/e2e/pod_stats_test.go
index 5ec209034..bb145088e 100644
--- a/test/e2e/pod_stats_test.go
+++ b/test/e2e/pod_stats_test.go
@@ -149,7 +149,7 @@ var _ = Describe("Podman pod stats", func() {
stats := podmanTest.Podman([]string{"pod", "stats", "--format", "json", "--no-stream", "-a"})
stats.WaitWithDefaultTimeout()
Expect(stats).Should(Exit(0))
- Expect(stats.IsJSONOutputValid()).To(BeTrue())
+ Expect(stats.OutputToString()).To(BeValidJSON())
})
It("podman pod stats with GO template", func() {
_, ec, podid := podmanTest.CreatePod(nil)
@@ -189,6 +189,6 @@ var _ = Describe("Podman pod stats", func() {
stats := podmanTest.Podman([]string{"pod", "stats", "--format", "json", "--no-stream", podName})
stats.WaitWithDefaultTimeout()
Expect(stats).Should(Exit(0))
- Expect(stats.IsJSONOutputValid()).To(BeTrue())
+ Expect(stats.OutputToString()).To(BeValidJSON())
})
})
diff --git a/test/e2e/ps_test.go b/test/e2e/ps_test.go
index c0b0e0aa6..3334250db 100644
--- a/test/e2e/ps_test.go
+++ b/test/e2e/ps_test.go
@@ -239,7 +239,7 @@ var _ = Describe("Podman ps", func() {
result := podmanTest.Podman([]string{"ps", "--format", "json"})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
- Expect(result.IsJSONOutputValid()).To(BeTrue())
+ Expect(result.OutputToString()).To(BeValidJSON())
})
It("podman ps namespace flag with json format", func() {
@@ -249,7 +249,7 @@ var _ = Describe("Podman ps", func() {
result := podmanTest.Podman([]string{"ps", "-a", "--ns", "--format", "json"})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
- Expect(result.IsJSONOutputValid()).To(BeTrue())
+ Expect(result.OutputToString()).To(BeValidJSON())
})
It("podman ps json format Created field is int64", func() {
@@ -275,7 +275,7 @@ var _ = Describe("Podman ps", func() {
result := podmanTest.Podman([]string{"ps", "-a", "--format", "json"})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
- Expect(result.IsJSONOutputValid()).To(BeTrue())
+ Expect(result.OutputToString()).To(BeValidJSON())
// must contain "Status"
match, StatusLine := result.GrepString(`Status`)
Expect(match).To(BeTrue())
diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go
index 5898cc38d..c0840c83b 100644
--- a/test/e2e/run_networking_test.go
+++ b/test/e2e/run_networking_test.go
@@ -758,7 +758,7 @@ EXPOSE 2004-2005/tcp`, ALPINE)
run := podmanTest.Podman([]string{"run", "--net=host", "--hostname", hostname, ALPINE, "hostname"})
run.WaitWithDefaultTimeout()
Expect(run).Should(Exit(0))
- Expect(strings.Contains(run.OutputToString(), hostname)).To(BeTrue())
+ Expect(run.OutputToString()).To(ContainSubstring(hostname))
})
It("podman run with --net=none sets hostname", func() {
@@ -766,7 +766,7 @@ EXPOSE 2004-2005/tcp`, ALPINE)
run := podmanTest.Podman([]string{"run", "--net=none", "--hostname", hostname, ALPINE, "hostname"})
run.WaitWithDefaultTimeout()
Expect(run).Should(Exit(0))
- Expect(strings.Contains(run.OutputToString(), hostname)).To(BeTrue())
+ Expect(run.OutputToString()).To(ContainSubstring(hostname))
})
It("podman run with --net=none adds hostname to /etc/hosts", func() {
@@ -774,7 +774,7 @@ EXPOSE 2004-2005/tcp`, ALPINE)
run := podmanTest.Podman([]string{"run", "--net=none", "--hostname", hostname, ALPINE, "cat", "/etc/hosts"})
run.WaitWithDefaultTimeout()
Expect(run).Should(Exit(0))
- Expect(strings.Contains(run.OutputToString(), hostname)).To(BeTrue())
+ Expect(run.OutputToString()).To(ContainSubstring(hostname))
})
It("podman run with pod does not add extra 127 entry to /etc/hosts", func() {
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 7b08c48c3..6c47e9179 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -1518,7 +1518,7 @@ USER mail`, BB)
session := podmanTest.Podman([]string{"run", "-t", "-i", "--group-add", groupName, "--privileged", fedoraMinimal, "groups"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(strings.Contains(session.OutputToString(), groupName)).To(BeTrue())
+ Expect(session.OutputToString()).To(ContainSubstring(groupName))
})
It("podman run --tz", func() {
diff --git a/test/e2e/run_userns_test.go b/test/e2e/run_userns_test.go
index 9b981ef72..50f8087f1 100644
--- a/test/e2e/run_userns_test.go
+++ b/test/e2e/run_userns_test.go
@@ -153,7 +153,7 @@ var _ = Describe("Podman UserNS support", func() {
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
l := session.OutputToString()
- Expect(strings.Contains(l, "1024")).To(BeTrue())
+ Expect(l).To(ContainSubstring("1024"))
m[l] = l
}
// check for no duplicates
diff --git a/test/e2e/run_volume_test.go b/test/e2e/run_volume_test.go
index 196c5778a..10c191bd9 100644
--- a/test/e2e/run_volume_test.go
+++ b/test/e2e/run_volume_test.go
@@ -287,7 +287,7 @@ var _ = Describe("Podman run with volumes", func() {
os.Stderr.Sync()
mountOut1 := strings.Join(strings.Fields(string(mountCmd1.Out.Contents())), " ")
fmt.Printf("Output: %s", mountOut1)
- Expect(strings.Contains(mountOut1, volName)).To(BeFalse())
+ Expect(mountOut1).To(Not(ContainSubstring(volName)))
ctrName := "testctr"
podmanSession := podmanTest.Podman([]string{"run", "-d", "--name", ctrName, "-v", fmt.Sprintf("%s:/testvol", volName), ALPINE, "top"})
@@ -303,7 +303,7 @@ var _ = Describe("Podman run with volumes", func() {
os.Stderr.Sync()
mountOut2 := strings.Join(strings.Fields(string(mountCmd2.Out.Contents())), " ")
fmt.Printf("Output: %s", mountOut2)
- Expect(strings.Contains(mountOut2, volName)).To(BeTrue())
+ Expect(mountOut2).To(ContainSubstring(volName))
// Stop the container to unmount
podmanStopSession := podmanTest.Podman([]string{"stop", "--time", "0", ctrName})
@@ -324,7 +324,7 @@ var _ = Describe("Podman run with volumes", func() {
os.Stderr.Sync()
mountOut3 := strings.Join(strings.Fields(string(mountCmd3.Out.Contents())), " ")
fmt.Printf("Output: %s", mountOut3)
- Expect(strings.Contains(mountOut3, volName)).To(BeFalse())
+ Expect(mountOut3).To(Not(ContainSubstring(volName)))
})
It("podman named volume copyup", func() {
@@ -516,7 +516,7 @@ RUN sh -c "cd /etc/apk && ln -s ../../testfile"`, ALPINE)
Expect(runLs).Should(Exit(0))
outputArr := runLs.OutputToStringArray()
Expect(len(outputArr)).To(Equal(1))
- Expect(strings.Contains(outputArr[0], fileName)).To(BeTrue())
+ Expect(outputArr[0]).To(ContainSubstring(fileName))
})
It("Podman mount over image volume with trailing /", func() {
@@ -752,7 +752,7 @@ USER testuser`, fedoraMinimal)
test1 := podmanTest.Podman([]string{"run", "-v", "testvol1:/test", imgName, "bash", "-c", "ls -al /test | grep -v root | grep -v total"})
test1.WaitWithDefaultTimeout()
Expect(test1).Should(Exit(0))
- Expect(strings.Contains(test1.OutputToString(), testString)).To(BeTrue())
+ Expect(test1.OutputToString()).To(ContainSubstring(testString))
volName := "testvol2"
vol := podmanTest.Podman([]string{"volume", "create", volName})
@@ -762,7 +762,7 @@ USER testuser`, fedoraMinimal)
test2 := podmanTest.Podman([]string{"run", "-v", fmt.Sprintf("%s:/test", volName), imgName, "bash", "-c", "ls -al /test | grep -v root | grep -v total"})
test2.WaitWithDefaultTimeout()
Expect(test2).Should(Exit(0))
- Expect(strings.Contains(test2.OutputToString(), testString)).To(BeTrue())
+ Expect(test2.OutputToString()).To(ContainSubstring(testString))
})
diff --git a/test/e2e/runlabel_test.go b/test/e2e/runlabel_test.go
index e473119b2..b7b27dc14 100644
--- a/test/e2e/runlabel_test.go
+++ b/test/e2e/runlabel_test.go
@@ -94,14 +94,14 @@ var _ = Describe("podman container runlabel", func() {
result.WaitWithDefaultTimeout()
Expect(result).To(ExitWithError())
// should not panic when label missing the value or don't have the label
- Expect(result.LineInOutputContains("panic")).NotTo(BeTrue())
+ Expect(result.OutputToString()).To(Not(ContainSubstring("panic")))
})
It("podman container runlabel bogus label in remote image should result in non-zero exit", func() {
result := podmanTest.Podman([]string{"container", "runlabel", "RUN", "docker.io/library/ubuntu:latest"})
result.WaitWithDefaultTimeout()
Expect(result).To(ExitWithError())
// should not panic when label missing the value or don't have the label
- Expect(result.LineInOutputContains("panic")).NotTo(BeTrue())
+ Expect(result.OutputToString()).To(Not(ContainSubstring("panic")))
})
It("podman container runlabel global options", func() {
diff --git a/test/e2e/search_test.go b/test/e2e/search_test.go
index 2ea88eb5e..54bc5252e 100644
--- a/test/e2e/search_test.go
+++ b/test/e2e/search_test.go
@@ -134,7 +134,7 @@ registries = ['{{.Host}}:{{.Port}}']`
search := podmanTest.Podman([]string{"search", "--format", "json", "alpine"})
search.WaitWithDefaultTimeout()
Expect(search).Should(Exit(0))
- Expect(search.IsJSONOutputValid()).To(BeTrue())
+ Expect(search.OutputToString()).To(BeValidJSON())
Expect(search.OutputToString()).To(ContainSubstring("docker.io/library/alpine"))
// Test for https://github.com/containers/podman/issues/11894
@@ -151,7 +151,7 @@ registries = ['{{.Host}}:{{.Port}}']`
search := podmanTest.Podman([]string{"search", "--list-tags", "--format", "json", "alpine"})
search.WaitWithDefaultTimeout()
Expect(search).Should(Exit(0))
- Expect(search.IsJSONOutputValid()).To(BeTrue())
+ Expect(search.OutputToString()).To(BeValidJSON())
Expect(search.OutputToString()).To(ContainSubstring("docker.io/library/alpine"))
Expect(search.OutputToString()).To(ContainSubstring("3.10"))
Expect(search.OutputToString()).To(ContainSubstring("2.7"))
diff --git a/test/e2e/secret_test.go b/test/e2e/secret_test.go
index df0cd24d0..758ed7edc 100644
--- a/test/e2e/secret_test.go
+++ b/test/e2e/secret_test.go
@@ -78,7 +78,7 @@ var _ = Describe("Podman secret", func() {
inspect := podmanTest.Podman([]string{"secret", "inspect", secrID})
inspect.WaitWithDefaultTimeout()
Expect(inspect).Should(Exit(0))
- Expect(inspect.IsJSONOutputValid()).To(BeTrue())
+ Expect(inspect.OutputToString()).To(BeValidJSON())
})
It("podman secret inspect with --format", func() {
@@ -115,7 +115,7 @@ var _ = Describe("Podman secret", func() {
inspect := podmanTest.Podman([]string{"secret", "inspect", secrID, secrID2})
inspect.WaitWithDefaultTimeout()
Expect(inspect).Should(Exit(0))
- Expect(inspect.IsJSONOutputValid()).To(BeTrue())
+ Expect(inspect.OutputToString()).To(BeValidJSON())
})
It("podman secret inspect bogus", func() {
diff --git a/test/e2e/stats_test.go b/test/e2e/stats_test.go
index c0d56fdbc..a58e2485c 100644
--- a/test/e2e/stats_test.go
+++ b/test/e2e/stats_test.go
@@ -148,7 +148,7 @@ var _ = Describe("Podman stats", func() {
stats := podmanTest.Podman([]string{"stats", "--all", "--no-stream", "--format", "json"})
stats.WaitWithDefaultTimeout()
Expect(stats).Should(Exit(0))
- Expect(stats.IsJSONOutputValid()).To(BeTrue())
+ Expect(stats.OutputToString()).To(BeValidJSON())
})
It("podman stats on a container with no net ns", func() {
diff --git a/test/e2e/systemd_test.go b/test/e2e/systemd_test.go
index 2ad8e81e6..bbbec1648 100644
--- a/test/e2e/systemd_test.go
+++ b/test/e2e/systemd_test.go
@@ -93,7 +93,7 @@ WantedBy=default.target
systemctl := podmanTest.Podman([]string{"exec", "-t", "-i", ctrName, "systemctl", "status", "--no-pager"})
systemctl.WaitWithDefaultTimeout()
Expect(systemctl).Should(Exit(0))
- Expect(strings.Contains(systemctl.OutputToString(), "State:")).To(BeTrue())
+ Expect(systemctl.OutputToString()).To(ContainSubstring("State:"))
result := podmanTest.Podman([]string{"inspect", ctrName})
result.WaitWithDefaultTimeout()
diff --git a/test/e2e/trust_test.go b/test/e2e/trust_test.go
index b591e1c02..9a0d57d7a 100644
--- a/test/e2e/trust_test.go
+++ b/test/e2e/trust_test.go
@@ -76,7 +76,7 @@ var _ = Describe("Podman trust", func() {
session := podmanTest.Podman([]string{"image", "trust", "show", "--registrypath", filepath.Join(INTEGRATION_ROOT, "test"), "--policypath", filepath.Join(INTEGRATION_ROOT, "test/policy.json"), "--json"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.IsJSONOutputValid()).To(BeTrue())
+ Expect(session.OutputToString()).To(BeValidJSON())
var teststruct []map[string]string
json.Unmarshal(session.Out.Contents(), &teststruct)
Expect(len(teststruct)).To(Equal(3))
@@ -118,7 +118,7 @@ var _ = Describe("Podman trust", func() {
Expect(session).Should(Exit(0))
contents, err := ioutil.ReadFile(filepath.Join(INTEGRATION_ROOT, "test/policy.json"))
Expect(err).ShouldNot(HaveOccurred())
- Expect(session.IsJSONOutputValid()).To(BeTrue())
+ Expect(session.OutputToString()).To(BeValidJSON())
Expect(string(session.Out.Contents())).To(Equal(string(contents) + "\n"))
})
})
diff --git a/test/e2e/volume_inspect_test.go b/test/e2e/volume_inspect_test.go
index db95ba675..172063b90 100644
--- a/test/e2e/volume_inspect_test.go
+++ b/test/e2e/volume_inspect_test.go
@@ -2,7 +2,6 @@ package integration
import (
"os"
- "strings"
. "github.com/containers/podman/v3/test/utils"
. "github.com/onsi/ginkgo"
@@ -43,7 +42,7 @@ var _ = Describe("Podman volume inspect", func() {
session = podmanTest.Podman([]string{"volume", "inspect", volName})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.IsJSONOutputValid()).To(BeTrue())
+ Expect(session.OutputToString()).To(BeValidJSON())
})
It("podman inspect volume with Go format", func() {
@@ -86,6 +85,6 @@ var _ = Describe("Podman volume inspect", func() {
inspect := podmanTest.Podman([]string{"volume", "inspect", volName})
inspect.WaitWithDefaultTimeout()
Expect(inspect).Should(Exit(0))
- Expect(strings.Contains(inspect.OutputToString(), "tmpfs")).To(BeTrue())
+ Expect(inspect.OutputToString()).To(ContainSubstring("tmpfs"))
})
})
diff --git a/test/e2e/volume_ls_test.go b/test/e2e/volume_ls_test.go
index 6c4b22fa5..c1214366b 100644
--- a/test/e2e/volume_ls_test.go
+++ b/test/e2e/volume_ls_test.go
@@ -64,7 +64,7 @@ var _ = Describe("Podman volume ls", func() {
session = podmanTest.Podman([]string{"volume", "ls", "--format", "json"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.IsJSONOutputValid()).To(BeTrue())
+ Expect(session.OutputToString()).To(BeValidJSON())
})
It("podman ls volume with Go template", func() {
diff --git a/test/utils/matchers.go b/test/utils/matchers.go
index 69fb0cdfe..288779b63 100644
--- a/test/utils/matchers.go
+++ b/test/utils/matchers.go
@@ -1,6 +1,7 @@
package utils
import (
+ "encoding/json"
"fmt"
"net/url"
@@ -166,3 +167,32 @@ func (matcher *ExitMatcher) MatchMayChangeInTheFuture(actual interface{}) bool {
}
return true
}
+
+type ValidJSONMatcher struct {
+ types.GomegaMatcher
+}
+
+func BeValidJSON() *ValidJSONMatcher {
+ return &ValidJSONMatcher{}
+}
+
+func (matcher *ValidJSONMatcher) Match(actual interface{}) (success bool, err error) {
+ s, ok := actual.(string)
+ if !ok {
+ return false, fmt.Errorf("ValidJSONMatcher expects a string, not %q", actual)
+ }
+
+ var i interface{}
+ if err := json.Unmarshal([]byte(s), &i); err != nil {
+ return false, nil
+ }
+ return true, nil
+}
+
+func (matcher *ValidJSONMatcher) FailureMessage(actual interface{}) (message string) {
+ return format.Message(actual, "to be valid JSON")
+}
+
+func (matcher *ValidJSONMatcher) NegatedFailureMessage(actual interface{}) (message string) {
+ return format.Message(actual, "to _not_ be valid JSON")
+}