aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/instance
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2019-08-19 18:23:15 -0700
committerDmitry Vyukov <dvyukov@google.com>2019-08-27 14:39:18 -0700
commitfd37b39ea8db38458059092f5f94b582392e8922 (patch)
treee72046a32eb190e7d069bd38c4d132a72d6fa05b /pkg/instance
parentd21c5d9de0cd2f3124a8218f70c46ab97863a7a2 (diff)
all: convert Fuchsia to use "host fuzzing" mode
Go support is not a priority for Fuchsia at the moment, so it's preferable to use host fuzzing mode for Fuchsia like currently done for Akaros. This commit basically looks for all the places where there was special logic for OS=="akaros" and extends the same logic for OS=="fuchsia".
Diffstat (limited to 'pkg/instance')
-rw-r--r--pkg/instance/instance.go6
-rw-r--r--pkg/instance/instance_test.go2
2 files changed, 5 insertions, 3 deletions
diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go
index f46673d47..cc1b147f1 100644
--- a/pkg/instance/instance.go
+++ b/pkg/instance/instance.go
@@ -394,7 +394,8 @@ func (inst *inst) testProgram(command string, testTime time.Duration) error {
func FuzzerCmd(fuzzer, executor, name, OS, arch, fwdAddr, sandbox string, procs, verbosity int,
cover, debug, test, runtest bool) string {
osArg := ""
- if OS == "akaros" {
+ switch OS {
+ case "akaros", "fuchsia":
// Only akaros needs OS, because the rest assume host OS.
// But speciying OS for all OSes breaks patch testing on syzbot
// because old execprog does not have os flag.
@@ -425,7 +426,8 @@ func ExecprogCmd(execprog, executor, OS, arch, sandbox string, repeat, threaded,
repeatCount = 0
}
osArg := ""
- if OS == "akaros" {
+ switch OS {
+ case "akaros", "fuchsia":
osArg = " -os=" + OS
}
return fmt.Sprintf("%v -executor=%v -arch=%v%v -sandbox=%v"+
diff --git a/pkg/instance/instance_test.go b/pkg/instance/instance_test.go
index f4ab3a588..5b9a28404 100644
--- a/pkg/instance/instance_test.go
+++ b/pkg/instance/instance_test.go
@@ -91,7 +91,7 @@ func TestExecprogCmd(t *testing.T) {
flagCollide := flags.Bool("collide", true, "collide syscalls to provoke data races")
flagSignal := flags.Bool("cover", false, "collect feedback signals (coverage)")
flagSandbox := flags.String("sandbox", "none", "sandbox for fuzzing (none/setuid/namespace)")
- cmdLine := ExecprogCmd(os.Args[0], "/myexecutor", "fuchsia", "386", "namespace", true, false, false, 7, 2, 3, "myprog")
+ cmdLine := ExecprogCmd(os.Args[0], "/myexecutor", "freebsd", "386", "namespace", true, false, false, 7, 2, 3, "myprog")
args := strings.Split(cmdLine, " ")[1:]
if err := flags.Parse(args); err != nil {
t.Fatal(err)