Modify cgroup tests to make the tests pass with the new behavior.

The cgroups mounting is changed, in the root container cgroups are mounted
by default and for other containers the cgroups are mounted if the spec has a
cgroup mount. These tests mount cgroups directly which will fail. This CL
modifies the cgroup tests to pass with the new behavior.

PiperOrigin-RevId: 596739547
This commit is contained in:
Nayana Bidari
2024-01-08 16:56:25 -08:00
committed by gVisor bot
parent 1e61310ce6
commit 58cbc1af95
4 changed files with 112 additions and 557 deletions
+5
View File
@@ -651,6 +651,11 @@ func runTestCaseRunsc(testBin string, tc *gtest.TestCase, args []string, t *test
defer cleanup()
}
// Add cgroup mount to enable cgroups for all tests.
spec.Mounts = append(spec.Mounts, specs.Mount{
Destination: "/sys/fs/cgroup",
Type: "cgroup",
})
if err := runRunsc(tc, spec); err != nil {
t.Errorf("test %q failed with error %v, want nil", tc.FullName(), err)
}
+4 -8
View File
@@ -64,14 +64,10 @@ syscall_test(
test = "//test/syscalls/linux:brk_test",
)
# TODO(b/315355651): Fix cgroup tests in runsc. Cgroups are mounted in the
# root/pause container by default and for other containers cgroups are bind
# mounted if the container spec has a cgroup mount. These cgroup tests
# explicitly mount the cgroups which will fail now in runsc.
# syscall_test(
# one_sandbox = False,
# test = "//test/syscalls/linux:cgroup_test",
# )
syscall_test(
one_sandbox = False,
test = "//test/syscalls/linux:cgroup_test",
)
syscall_test(
add_fusefs = True,
+1
View File
@@ -4576,6 +4576,7 @@ cc_binary(
"//test/util:mount_util",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
gtest,
"//test/util:cleanup",
"//test/util:posix_error",
File diff suppressed because it is too large Load Diff