mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
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:
committed by
gVisor bot
parent
1e61310ce6
commit
58cbc1af95
@@ -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
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
+102
-549
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user