aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/instance/instance_test.go
diff options
context:
space:
mode:
authorMara Mihali <maramihali@google.com>2021-07-06 11:36:45 +0000
committerDmitry Vyukov <dvyukov@google.com>2021-07-06 15:47:33 +0200
commit1729cf6917b3e2fe4a22101a05e833f717bca8ce (patch)
tree2f2c835115a75eec528a9cd39e33e9e9396f486e /pkg/instance/instance_test.go
parent22ff12bdbb3509fbf00cd979af4629b50aaff7a3 (diff)
pkg/instance: added threaded and collide flags
These can be used to disable threaded execution and collision mode for program's system calls.
Diffstat (limited to 'pkg/instance/instance_test.go')
-rw-r--r--pkg/instance/instance_test.go12
1 files changed, 11 insertions, 1 deletions
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)
+ }
}