summaryrefslogtreecommitdiff
path: root/test/e2e/run_volume_test.go
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2021-12-01 08:49:55 -0700
committerEd Santiago <santiago@redhat.com>2021-12-02 07:54:53 -0700
commitc0a8814fb4d55a950ebf2b2c48731ac939318d7e (patch)
treede7c1c548a5b9486333fe6417bbb659d28dbec33 /test/e2e/run_volume_test.go
parent92f9e117670bb060307aadbd6bdeee303923091c (diff)
downloadpodman-c0a8814fb4d55a950ebf2b2c48731ac939318d7e.tar.gz
podman-c0a8814fb4d55a950ebf2b2c48731ac939318d7e.tar.bz2
podman-c0a8814fb4d55a950ebf2b2c48731ac939318d7e.zip
Use HaveLen(x) instead of Expect(len(y)).To(Equal(x))
sed -i -e 's/Expect(len(\(.*\)))\.To(Equal(\(.*\)))/Expect(\1).To(HaveLen(\2))/' test/e2e/*.go Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/e2e/run_volume_test.go')
-rw-r--r--test/e2e/run_volume_test.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/e2e/run_volume_test.go b/test/e2e/run_volume_test.go
index 74aa69c96..3d05e0f70 100644
--- a/test/e2e/run_volume_test.go
+++ b/test/e2e/run_volume_test.go
@@ -410,7 +410,7 @@ RUN sh -c "cd /etc/apk && ln -s ../../testfile"`, ALPINE)
list2.WaitWithDefaultTimeout()
Expect(list2).Should(Exit(0))
arr := list2.OutputToStringArray()
- Expect(len(arr)).To(Equal(1))
+ Expect(arr).To(HaveLen(1))
Expect(arr[0]).To(Not(Equal("")))
})
@@ -429,7 +429,7 @@ RUN sh -c "cd /etc/apk && ln -s ../../testfile"`, ALPINE)
list2.WaitWithDefaultTimeout()
Expect(list2).Should(Exit(0))
arr := list2.OutputToStringArray()
- Expect(len(arr)).To(Equal(1))
+ Expect(arr).To(HaveLen(1))
Expect(arr[0]).To(Not(Equal("")))
remove := podmanTest.Podman([]string{"rm", "-v", ctrName})
@@ -458,7 +458,7 @@ RUN sh -c "cd /etc/apk && ln -s ../../testfile"`, ALPINE)
list2.WaitWithDefaultTimeout()
Expect(list2).Should(Exit(0))
arr := list2.OutputToStringArray()
- Expect(len(arr)).To(Equal(1))
+ Expect(arr).To(HaveLen(1))
Expect(arr[0]).To(Equal(volName))
remove := podmanTest.Podman([]string{"rm", "-v", ctrName})
@@ -469,7 +469,7 @@ RUN sh -c "cd /etc/apk && ln -s ../../testfile"`, ALPINE)
list3.WaitWithDefaultTimeout()
Expect(list3).Should(Exit(0))
arr2 := list3.OutputToStringArray()
- Expect(len(arr2)).To(Equal(1))
+ Expect(arr2).To(HaveLen(1))
Expect(arr2[0]).To(Equal(volName))
})
@@ -511,7 +511,7 @@ RUN sh -c "cd /etc/apk && ln -s ../../testfile"`, ALPINE)
runLs.WaitWithDefaultTimeout()
Expect(runLs).Should(Exit(0))
outputArr := runLs.OutputToStringArray()
- Expect(len(outputArr)).To(Equal(1))
+ Expect(outputArr).To(HaveLen(1))
Expect(outputArr[0]).To(ContainSubstring(fileName))
})
@@ -527,8 +527,8 @@ VOLUME /test/`, ALPINE)
Expect(create).Should(Exit(0))
data := podmanTest.InspectContainer(ctrName)
- Expect(len(data)).To(Equal(1))
- Expect(len(data[0].Mounts)).To(Equal(1))
+ Expect(data).To(HaveLen(1))
+ Expect(data[0].Mounts).To(HaveLen(1))
Expect(data[0].Mounts[0].Source).To(Equal("/tmp"))
Expect(data[0].Mounts[0].Destination).To(Equal("/test"))
})
@@ -626,7 +626,7 @@ VOLUME /test/`, ALPINE)
session := podmanTest.Podman([]string{"run", "-t", "-i", "-v", fmt.Sprintf("%s:/test1", volName), "-v", fmt.Sprintf("%s:/test2", volName), "--rm", ALPINE, "sh", "-c", "mount | grep /test"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(len(session.OutputToStringArray())).To(Equal(2))
+ Expect(session.OutputToStringArray()).To(HaveLen(2))
})
It("podman run with --volume and U flag", func() {