From 1729cf6917b3e2fe4a22101a05e833f717bca8ce Mon Sep 17 00:00:00 2001 From: Mara Mihali Date: Tue, 6 Jul 2021 11:36:45 +0000 Subject: pkg/instance: added threaded and collide flags These can be used to disable threaded execution and collision mode for program's system calls. --- pkg/instance/instance_test.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'pkg/instance/instance_test.go') diff --git a/pkg/instance/instance_test.go b/pkg/instance/instance_test.go index c5d8cd1d1..7d2ce3031 100644 --- a/pkg/instance/instance_test.go +++ b/pkg/instance/instance_test.go @@ -149,8 +149,10 @@ func TestRunnerCmd(t *testing.T) { flagArch := flags.String("arch", "", "target architecture") flagPool := flags.Int("pool", 0, "index of pool that started VM") 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") - cmdLine := RunnerCmd(os.Args[0], "localhost:1234", targets.Linux, targets.AMD64, 0, 0) + cmdLine := RunnerCmd(os.Args[0], "localhost:1234", targets.Linux, targets.AMD64, 0, 0, false, false) args := strings.Split(cmdLine, " ")[1:] if err := flags.Parse(args); err != nil { t.Fatalf("error parsing flags: %v, want: nil", err) @@ -175,4 +177,12 @@ func TestRunnerCmd(t *testing.T) { if got, want := *flagVM, 0; got != want { t.Errorf("bad vm index: %d, want: %d", got, want) } + + if got, want := *flagCollide, false; got != want { + t.Errorf("bad collide: %t, want: %t", got, want) + } + + if got, want := *flagThreaded, false; got != want { + t.Errorf("bad threaded: %t, want: %t", got, want) + } } -- cgit mrf-deployment