mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Fix tests which fail in kokoro
* open_create_test_runsc_ptrace_shared doesn't expect the write access to / * exec_test_runsc_ptrace_shared could not find /usr/share/zoneinfo/ * clock_gettime_test_runsc_ptrace_shared didn't expect that a thread cpu time can be zero. * affinity_test_runsc_ptrace_shared expected minimum 3 cpus PiperOrigin-RevId: 237509429 Change-Id: I477937e5d2cdf3f8720836bfa972abd35d8220a3
This commit is contained in:
+1
-7
@@ -177,16 +177,10 @@ run_root_tests() {
|
||||
# Run syscall unit tests.
|
||||
run_syscall_tests() {
|
||||
cd ${WORKSPACE_DIR}
|
||||
# TODO: Exclude tests which fail.
|
||||
bazel \
|
||||
"${BAZEL_RBE_FLAGS[@]}" \
|
||||
test "${BAZEL_BUILD_RBE_FLAGS[@]}" \
|
||||
`bazel query //test/syscalls/... |
|
||||
grep runsc_ptrace |
|
||||
grep -v affinity_test_runsc_ptrace |
|
||||
grep -v exec_test_runsc_ptrace |
|
||||
grep -v open_create_test_runsc_ptrace |
|
||||
grep -v clock_gettime_test_runsc_ptrace`
|
||||
--test_tag_filters=runsc_ptrace //test/syscalls/...
|
||||
}
|
||||
|
||||
# Find and rename all test xml and log files so that Sponge can pick them up.
|
||||
|
||||
@@ -34,10 +34,6 @@ platform(
|
||||
name: "dockerPrivileged"
|
||||
value: "true"
|
||||
}
|
||||
properties: {
|
||||
name: "dockerRunAsRoot"
|
||||
value: "true"
|
||||
}
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
+4
-1
@@ -49,7 +49,10 @@ syscall_test(test = "//test/syscalls/linux:chroot_test")
|
||||
|
||||
syscall_test(test = "//test/syscalls/linux:clock_getres_test")
|
||||
|
||||
syscall_test(test = "//test/syscalls/linux:clock_gettime_test")
|
||||
syscall_test(
|
||||
size = "medium",
|
||||
test = "//test/syscalls/linux:clock_gettime_test",
|
||||
)
|
||||
|
||||
syscall_test(test = "//test/syscalls/linux:clock_nanosleep_test")
|
||||
|
||||
|
||||
@@ -155,6 +155,7 @@ TEST_F(AffinityTest, Sanity) {
|
||||
}
|
||||
|
||||
TEST_F(AffinityTest, NewThread) {
|
||||
SKIP_IF(CPU_COUNT(&mask_) < 3);
|
||||
ASSERT_NO_ERRNO(ClearLowestBit());
|
||||
ASSERT_NO_ERRNO(ClearLowestBit());
|
||||
EXPECT_THAT(sched_setaffinity(/*pid=*/0, sizeof(cpu_set_t), &mask_),
|
||||
|
||||
@@ -87,7 +87,12 @@ TEST(ClockGettime, JavaThreadTime) {
|
||||
ASSERT_EQ(0, pthread_getcpuclockid(pthread_self(), &clockid));
|
||||
struct timespec tp;
|
||||
ASSERT_THAT(clock_getres(clockid, &tp), SyscallSucceeds());
|
||||
ASSERT_THAT(clock_gettime(clockid, &tp), SyscallSucceeds());
|
||||
EXPECT_TRUE(tp.tv_sec > 0 || tp.tv_nsec > 0);
|
||||
// A thread cputime is updated each 10msec and there is no approximation
|
||||
// if a task is running.
|
||||
do {
|
||||
ASSERT_THAT(clock_gettime(clockid, &tp), SyscallSucceeds());
|
||||
} while (tp.tv_sec == 0 && tp.tv_nsec == 0);
|
||||
EXPECT_TRUE(tp.tv_sec > 0 || tp.tv_nsec > 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -476,8 +476,10 @@ TEST(ProcSelfExe, ChangesAcrossExecve) {
|
||||
}
|
||||
|
||||
TEST(ExecTest, CloexecNormalFile) {
|
||||
const FileDescriptor fd_closed_on_exec = ASSERT_NO_ERRNO_AND_VALUE(
|
||||
Open("/usr/share/zoneinfo", O_RDONLY | O_CLOEXEC));
|
||||
TempPath tempFile = ASSERT_NO_ERRNO_AND_VALUE(
|
||||
TempPath::CreateFileWith(GetAbsoluteTestTmpdir(), "bar", 0755));
|
||||
const FileDescriptor fd_closed_on_exec =
|
||||
ASSERT_NO_ERRNO_AND_VALUE(Open(tempFile.path(), O_RDONLY | O_CLOEXEC));
|
||||
|
||||
CheckOutput(WorkloadPath(kAssertClosedWorkload),
|
||||
{WorkloadPath(kAssertClosedWorkload),
|
||||
@@ -487,7 +489,7 @@ TEST(ExecTest, CloexecNormalFile) {
|
||||
// The assert closed workload exits with code 2 if the file still exists. We
|
||||
// can use this to do a negative test.
|
||||
const FileDescriptor fd_open_on_exec =
|
||||
ASSERT_NO_ERRNO_AND_VALUE(Open("/usr/share/zoneinfo", O_RDONLY));
|
||||
ASSERT_NO_ERRNO_AND_VALUE(Open(tempFile.path(), O_RDONLY));
|
||||
|
||||
CheckOutput(WorkloadPath(kAssertClosedWorkload),
|
||||
{WorkloadPath(kAssertClosedWorkload),
|
||||
|
||||
Reference in New Issue
Block a user