From bc48c9ab65ed47d707bedef64ca52e1a5c383250 Mon Sep 17 00:00:00 2001 From: Mara Mihali Date: Mon, 19 Jul 2021 08:05:31 +0000 Subject: pkg/instance, syz-runner, syz-verifier: add option to create a new environment for each program --- pkg/instance/instance.go | 5 ++--- pkg/instance/instance_test.go | 7 ++++++- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'pkg/instance') diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index c65d97cce..e0c1e3ce8 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -500,8 +500,7 @@ var MakeBin = func() string { return "make" }() -func RunnerCmd(prog, fwdAddr, os, arch string, poolIdx, vmIdx int, collide, threaded bool) string { +func RunnerCmd(prog, fwdAddr, os, arch string, poolIdx, vmIdx int, collide, threaded, newEnv bool) string { return fmt.Sprintf("%s -addr=%s -os=%s -arch=%s -pool=%d -vm=%d "+ - "-collide=%t -threaded=%t", prog, fwdAddr, os, arch, poolIdx, vmIdx, - collide, threaded) + "-collide=%t -threaded=%t -new-env=%t", prog, fwdAddr, os, arch, poolIdx, vmIdx, collide, threaded, newEnv) } diff --git a/pkg/instance/instance_test.go b/pkg/instance/instance_test.go index 7d2ce3031..5b0bcd4e6 100644 --- a/pkg/instance/instance_test.go +++ b/pkg/instance/instance_test.go @@ -151,8 +151,9 @@ func TestRunnerCmd(t *testing.T) { flagVM := flags.Int("vm", 0, "index of VM that started the Runner") flagCollide := flags.Bool("collide", true, "collide syscalls to provoke data races") flagThreaded := flags.Bool("threaded", true, "use threaded mode in executor") + flagEnv := flags.Bool("new-env", true, "create a new environment for each program") - cmdLine := RunnerCmd(os.Args[0], "localhost:1234", targets.Linux, targets.AMD64, 0, 0, false, false) + cmdLine := RunnerCmd(os.Args[0], "localhost:1234", targets.Linux, targets.AMD64, 0, 0, false, false, false) args := strings.Split(cmdLine, " ")[1:] if err := flags.Parse(args); err != nil { t.Fatalf("error parsing flags: %v, want: nil", err) @@ -185,4 +186,8 @@ func TestRunnerCmd(t *testing.T) { if got, want := *flagThreaded, false; got != want { t.Errorf("bad threaded: %t, want: %t", got, want) } + + if got, want := *flagEnv, false; got != want { + t.Errorf("bad new-env: %t, want: %t", got, want) + } } -- cgit mrf-deployment