diff options
author | Andrei Vagin <avagin@google.com> | 2019-03-08 13:32:37 -0800 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-03-08 13:33:32 -0800 |
commit | 832589cb076a638ca53076ebb66afb9fac4597d1 (patch) | |
tree | 6918d3d1a5cbd135fcb4e50355de296ea976da1c /test/syscalls/linux/exec.cc | |
parent | fbacb350391667fa9ffb78a84ae51a37d477aa02 (diff) |
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
Diffstat (limited to 'test/syscalls/linux/exec.cc')
-rw-r--r-- | test/syscalls/linux/exec.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/syscalls/linux/exec.cc b/test/syscalls/linux/exec.cc index 1ef40b502..2d2287c2a 100644 --- a/test/syscalls/linux/exec.cc +++ b/test/syscalls/linux/exec.cc @@ -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), |