summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2019-06-11 09:37:01 -0700
committerShentubot <shentubot@google.com>2019-06-11 09:38:07 -0700
commit307a9854edd4a1257b0393d39d8b4fca7b4223e4 (patch)
treecad55831c66a70e13e212f7415172d206350d216
parent74e397e39accbeb9fcb5382ce963df55014ae7ce (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.go6
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)
}