diff options
author | Andrei Vagin <avagin@google.com> | 2019-06-11 09:37:01 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-06-11 09:38:07 -0700 |
commit | 307a9854edd4a1257b0393d39d8b4fca7b4223e4 (patch) | |
tree | cad55831c66a70e13e212f7415172d206350d216 | |
parent | 74e397e39accbeb9fcb5382ce963df55014ae7ce (diff) |
gvisor/test: create a per-testcase directory for runsc logs
Otherwise it's hard to find a directory for a specific test case.
PiperOrigin-RevId: 252636901
-rw-r--r-- | test/syscalls/syscall_test_runner.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/syscalls/syscall_test_runner.go b/test/syscalls/syscall_test_runner.go index eb04a4fab..476248184 100644 --- a/test/syscalls/syscall_test_runner.go +++ b/test/syscalls/syscall_test_runner.go @@ -200,7 +200,11 @@ func runTestCaseRunsc(testBin string, tc gtest.TestCase, t *testing.T) { args = append(args, "-strace") } if outDir, ok := syscall.Getenv("TEST_UNDECLARED_OUTPUTS_DIR"); ok { - debugLogDir, err := ioutil.TempDir(outDir, "runsc") + tdir := filepath.Join(outDir, strings.Replace(tc.FullName(), "/", "_", -1)) + if err := os.MkdirAll(tdir, 0755); err != nil { + t.Fatalf("could not create test dir: %v", err) + } + debugLogDir, err := ioutil.TempDir(tdir, "runsc") if err != nil { t.Fatalf("could not create temp dir: %v", err) } |