From 349a68c4b056a06438a1e75e9b8a3a583b06d511 Mon Sep 17 00:00:00 2001 From: Laura Peskin Date: Mon, 16 Sep 2024 17:03:51 -0700 Subject: tools/syz-execprog: pass the VM type to execprog This makes it possible to skip certain machine checks depending on the VM type, as syz-manager already does. --- pkg/instance/instance_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pkg/instance/instance_test.go') diff --git a/pkg/instance/instance_test.go b/pkg/instance/instance_test.go index 283921224..40328fb15 100644 --- a/pkg/instance/instance_test.go +++ b/pkg/instance/instance_test.go @@ -16,7 +16,9 @@ import ( func TestExecprogCmd(t *testing.T) { // IMPORTANT: if this test fails, do not fix it by changing flags here! - // See comment in TestFuzzerCmd. + // This test checks that an old version of syz-execprog can parse flags generated by the + // current ExecprogCmd. + // If you need to make changes to syz-execprog's flags, consider using `OptionalFlags`. flags := flag.NewFlagSet("", flag.ContinueOnError) flagOS := flags.String("os", runtime.GOOS, "target os") flagArch := flags.String("arch", "", "target arch") @@ -33,7 +35,7 @@ func TestExecprogCmd(t *testing.T) { flagSignal := flags.Bool("cover", false, "collect feedback signals (coverage)") flagSandbox := flags.String("sandbox", "none", "sandbox for fuzzing (none/setuid/namespace/android)") flagSlowdown := flags.Int("slowdown", 1, "") - cmdLine := ExecprogCmd(os.Args[0], "/myexecutor", targets.FreeBSD, targets.I386, + cmdLine := ExecprogCmd(os.Args[0], "/myexecutor", targets.FreeBSD, targets.I386, "vmtype", "namespace", 3, true, false, true, 7, 2, 3, true, 10, "myprog") args := strings.Split(cmdLine, " ")[1:] if err := tool.ParseFlags(flags, args); err != nil { -- cgit mrf-deployment