diff options
| author | Mara Mihali <maramihali@google.com> | 2021-07-19 08:05:31 +0000 |
|---|---|---|
| committer | maramihali <maramihali@google.com> | 2021-07-19 16:00:14 +0300 |
| commit | bc48c9ab65ed47d707bedef64ca52e1a5c383250 (patch) | |
| tree | a77c540b44c24c667dee862dce2405571b515880 /pkg | |
| parent | 78bd9c70f4d022d9e022faf06f5122c981dd1c36 (diff) | |
pkg/instance, syz-runner, syz-verifier: add option to create a new environment for each program
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/instance/instance.go | 5 | ||||
| -rw-r--r-- | pkg/instance/instance_test.go | 7 |
2 files changed, 8 insertions, 4 deletions
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) + } } |
