Skip to content

Commit 6d27922

Browse files
committed
tests/int: fix flaky "runc run with tmpfs perm"
Apparently, sometimes a short-lived "runc run" produces result with \r and sometimes without. As a result, we have an occasional failure of "runc run with tmpfs perms" test. The solution (to the flaky test) is to use the first line of the output (like many other tests do). Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent edd00eb commit 6d27922

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/integration/run.bats

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function teardown() {
9090

9191
runc run test_tmpfs
9292
[ "$status" -eq 0 ]
93-
[ "$output" = "$mode" ]
93+
[ "${lines[0]}" = "$mode" ]
9494
}
9595

9696
@test "runc run with tmpfs perms" {
@@ -101,13 +101,13 @@ function teardown() {
101101
# Directory is to be created by runc.
102102
runc run test_tmpfs
103103
[ "$status" -eq 0 ]
104-
[ "$output" = "444" ]
104+
[ "${lines[0]}" = "444" ]
105105

106106
# Run a 2nd time with the pre-existing directory.
107107
# Ref: https://github.com/opencontainers/runc/issues/3911
108108
runc run test_tmpfs
109109
[ "$status" -eq 0 ]
110-
[ "$output" = "444" ]
110+
[ "${lines[0]}" = "444" ]
111111

112112
# Existing directory, custom perms, no mode on the mount,
113113
# so it should use the directory's perms.
@@ -116,15 +116,15 @@ function teardown() {
116116
# shellcheck disable=SC2016
117117
runc run test_tmpfs
118118
[ "$status" -eq 0 ]
119-
[ "$output" = "710" ]
119+
[ "${lines[0]}" = "710" ]
120120

121121
# Add back the mode on the mount, and it should use that instead.
122122
# Just for fun, use different perms than was used earlier.
123123
# shellcheck disable=SC2016
124124
update_config '.mounts[-1].options = ["mode=0410"]'
125125
runc run test_tmpfs
126126
[ "$status" -eq 0 ]
127-
[ "$output" = "410" ]
127+
[ "${lines[0]}" = "410" ]
128128
}
129129

130130
@test "runc run [runc-dmz]" {

0 commit comments

Comments
 (0)