From bf0b1b9d767736e632fa56b90d904fee968d8d3d Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Thu, 6 Jun 2019 14:37:12 -0700 Subject: Add overlay dimension to FS related syscall tests PiperOrigin-RevId: 251929314 --- test/syscalls/syscall_test_runner.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test/syscalls/syscall_test_runner.go') diff --git a/test/syscalls/syscall_test_runner.go b/test/syscalls/syscall_test_runner.go index 9a8e0600b..eb04a4fab 100644 --- a/test/syscalls/syscall_test_runner.go +++ b/test/syscalls/syscall_test_runner.go @@ -47,6 +47,7 @@ var ( platform = flag.String("platform", "ptrace", "platform to run on") useTmpfs = flag.Bool("use-tmpfs", false, "mounts tmpfs for /tmp") fileAccess = flag.String("file-access", "exclusive", "mounts root in exclusive or shared mode") + overlay = flag.Bool("overlay", false, "wrap filesystem mounts with writable tmpfs overlay") parallel = flag.Bool("parallel", false, "run tests in parallel") runscPath = flag.String("runsc", "", "path to runsc binary") ) @@ -184,10 +185,13 @@ func runTestCaseRunsc(testBin string, tc gtest.TestCase, t *testing.T) { "-platform", *platform, "-root", rootDir, "-file-access", *fileAccess, - "--network=none", + "-network=none", "-log-format=text", "-TESTONLY-unsafe-nonroot=true", - "--net-raw=true", + "-net-raw=true", + } + if *overlay { + args = append(args, "-overlay") } if *debug { args = append(args, "-debug", "-log-packets=true") -- cgit v1.2.3 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/syscalls/syscall_test_runner.go') 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