summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/e2e/events_test.go4
-rw-r--r--test/e2e/run_device_test.go12
-rw-r--r--test/system/helpers.bash10
3 files changed, 19 insertions, 7 deletions
diff --git a/test/e2e/events_test.go b/test/e2e/events_test.go
index 93c51098f..9b527b88e 100644
--- a/test/e2e/events_test.go
+++ b/test/e2e/events_test.go
@@ -136,6 +136,7 @@ var _ = Describe("Podman events", func() {
Expect(ec).To(Equal(0))
test := podmanTest.Podman([]string{"events", "--stream=false", "--format", "json"})
test.WaitWithDefaultTimeout()
+ Expect(test.ExitCode()).To(BeZero())
jsonArr := test.OutputToStringArray()
Expect(len(jsonArr)).To(Not(BeZero()))
eventsMap := make(map[string]string)
@@ -143,10 +144,10 @@ var _ = Describe("Podman events", func() {
Expect(err).To(BeNil())
_, exist := eventsMap["Status"]
Expect(exist).To(BeTrue())
- Expect(test.ExitCode()).To(BeZero())
test = podmanTest.Podman([]string{"events", "--stream=false", "--format", "{{json.}}"})
test.WaitWithDefaultTimeout()
+ Expect(test.ExitCode()).To(BeZero())
jsonArr = test.OutputToStringArray()
Expect(len(jsonArr)).To(Not(BeZero()))
eventsMap = make(map[string]string)
@@ -154,6 +155,5 @@ var _ = Describe("Podman events", func() {
Expect(err).To(BeNil())
_, exist = eventsMap["Status"]
Expect(exist).To(BeTrue())
- Expect(test.ExitCode()).To(BeZero())
})
})
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() {
diff --git a/test/system/helpers.bash b/test/system/helpers.bash
index 4239ef876..abca91739 100644
--- a/test/system/helpers.bash
+++ b/test/system/helpers.bash
@@ -404,7 +404,13 @@ function find_exec_pid_files() {
#
# This obviously screws us up when we look at output results.
#
-# This function removes the warning from $output and $lines
+# This function removes the warning from $output and $lines. We don't
+# do a full string match because there's another variant of that message:
+#
+# WARNING: Creating device "/dev/null" with same type, major and minor as existing "/dev/foodevdir/null".
+#
+# (We should never again see that precise error ever again, but we could
+# see variants of it).
#
function remove_same_dev_warning() {
# No input arguments. We operate in-place on $output and $lines
@@ -412,7 +418,7 @@ function remove_same_dev_warning() {
local i=0
local -a new_lines=()
while [[ $i -lt ${#lines[@]} ]]; do
- if expr "${lines[$i]}" : 'WARNING: .* same type, major.* multiple' >/dev/null; then
+ if expr "${lines[$i]}" : 'WARNING: .* same type, major' >/dev/null; then
:
else
new_lines+=("${lines[$i]}")