gvisor/tests: save runsc logs for each container in a separate directory

PiperOrigin-RevId: 232990964
Change-Id: Icfa426d5e83c7d3e56b0b92e6a9e1229bcb8361b
This commit is contained in:
Andrei Vagin
2019-02-07 19:32:51 -08:00
committed by Shentubot
parent 2ba74f84be
commit fda4d1f4f1
+7 -1
View File
@@ -171,7 +171,13 @@ func runTestCaseRunsc(testBin string, tc gtest.TestCase, t *testing.T) {
args = append(args, "-strace")
}
if outDir, ok := syscall.Getenv("TEST_UNDECLARED_OUTPUTS_DIR"); ok {
args = append(args, "-debug-log", outDir+"/")
debugLogDir, err := ioutil.TempDir(outDir, "runsc")
if err != nil {
t.Fatalf("could not create temp dir: %v", err)
}
debugLogDir += "/"
log.Infof("runsc logs: %s", debugLogDir)
args = append(args, "-debug-log", debugLogDir)
}
// Current process doesn't have CAP_SYS_ADMIN, create user namespace and run