mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
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 <kolyshkin@gmail.com>
(cherry picked from commit 6d27922005)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -72,7 +72,7 @@ function teardown() {
|
||||
|
||||
runc run test_tmpfs
|
||||
[ "$status" -eq 0 ]
|
||||
[ "$output" = "$mode" ]
|
||||
[ "${lines[0]}" = "$mode" ]
|
||||
}
|
||||
|
||||
@test "runc run with tmpfs perms" {
|
||||
@@ -83,13 +83,13 @@ function teardown() {
|
||||
# Directory is to be created by runc.
|
||||
runc run test_tmpfs
|
||||
[ "$status" -eq 0 ]
|
||||
[ "$output" = "444" ]
|
||||
[ "${lines[0]}" = "444" ]
|
||||
|
||||
# Run a 2nd time with the pre-existing directory.
|
||||
# Ref: https://github.com/opencontainers/runc/issues/3911
|
||||
runc run test_tmpfs
|
||||
[ "$status" -eq 0 ]
|
||||
[ "$output" = "444" ]
|
||||
[ "${lines[0]}" = "444" ]
|
||||
|
||||
# Existing directory, custom perms, no mode on the mount,
|
||||
# so it should use the directory's perms.
|
||||
@@ -98,7 +98,7 @@ function teardown() {
|
||||
# shellcheck disable=SC2016
|
||||
runc run test_tmpfs
|
||||
[ "$status" -eq 0 ]
|
||||
[ "$output" = "710" ]
|
||||
[ "${lines[0]}" = "710" ]
|
||||
|
||||
# Add back the mode on the mount, and it should use that instead.
|
||||
# Just for fun, use different perms than was used earlier.
|
||||
@@ -106,7 +106,7 @@ function teardown() {
|
||||
update_config '.mounts[-1].options = ["mode=0410"]'
|
||||
runc run test_tmpfs
|
||||
[ "$status" -eq 0 ]
|
||||
[ "$output" = "410" ]
|
||||
[ "${lines[0]}" = "410" ]
|
||||
}
|
||||
|
||||
@test "runc run [joining existing container namespaces]" {
|
||||
|
||||
Reference in New Issue
Block a user