diff options
author | Ed Santiago <santiago@redhat.com> | 2020-07-20 09:53:43 -0600 |
---|---|---|
committer | Ed Santiago <santiago@redhat.com> | 2020-07-20 12:32:17 -0600 |
commit | 1405c3a20524134fed8371b4e9f5e9900a050cce (patch) | |
tree | 33762f19caf4cb6a41b08284777069a6e3ea1247 /test/e2e/run_device_test.go | |
parent | 17f9b80600bc008e7c0a4060ff3a6bb5eb56d0cc (diff) | |
download | podman-1405c3a20524134fed8371b4e9f5e9900a050cce.tar.gz podman-1405c3a20524134fed8371b4e9f5e9900a050cce.tar.bz2 podman-1405c3a20524134fed8371b4e9f5e9900a050cce.zip |
BATS tests: more resilient remove_same_dev_warning
Some CI tests are flaking in the SELinux test, possibly because
there's a new variation of the "multiple devices" warning I hadn't
seen before:
WARNING: Creating device "/dev/null" with same type, major and minor as existing "/dev/foodevdir/null".
Solution: in remove_same_dev_warning(), remove "multiple" from
the match string.
Also: fix a Go test that wasn't cleaning up after itself. And
add an actual test to it, not just check-exit-status.
Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/e2e/run_device_test.go')
-rw-r--r-- | test/e2e/run_device_test.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/e2e/run_device_test.go b/test/e2e/run_device_test.go index a5e1e0269..b1a4c9cb2 100644 --- a/test/e2e/run_device_test.go +++ b/test/e2e/run_device_test.go @@ -75,11 +75,17 @@ var _ = Describe("Podman run device", func() { It("podman run device host device and container device parameter are directories", func() { SkipIfRootless() - SystemExec("mkdir", []string{"/dev/foodevdir"}) - SystemExec("mknod", []string{"/dev/foodevdir/null", "c", "1", "3"}) - session := podmanTest.Podman([]string{"run", "-q", "--device", "/dev/foodevdir:/dev/bar", ALPINE, "ls", "/dev/bar/null"}) + Expect(os.MkdirAll("/dev/foodevdir", os.ModePerm)).To(BeNil()) + defer os.RemoveAll("/dev/foodevdir") + + mknod := SystemExec("mknod", []string{"/dev/foodevdir/null", "c", "1", "3"}) + mknod.WaitWithDefaultTimeout() + Expect(mknod.ExitCode()).To(Equal(0)) + + session := podmanTest.Podman([]string{"run", "-q", "--device", "/dev/foodevdir:/dev/bar", ALPINE, "stat", "-c%t:%T", "/dev/bar/null"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) + Expect(session.OutputToString()).To(Equal("1:3")) }) It("podman run device host device with --privileged", func() { |