From 307a9854edd4a1257b0393d39d8b4fca7b4223e4 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Tue, 11 Jun 2019 09:37:01 -0700 Subject: 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 --- test/syscalls/syscall_test_runner.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test') 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) } -- cgit v1.2.3