From 0b45cac3dc627e9b6702daf3d578d970440972e9 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Tue, 24 Sep 2024 17:22:33 +0200 Subject: pkg/instance: refactor ExecprogCmd Reduce the number of arguments by using a csource.Option value directly. --- pkg/instance/instance_test.go | 15 ++++++++++++++- 1 file changed, 14 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 40328fb15..a8f50cc2d 100644 --- a/pkg/instance/instance_test.go +++ b/pkg/instance/instance_test.go @@ -10,6 +10,7 @@ import ( "strings" "testing" + "github.com/google/syzkaller/pkg/csource" "github.com/google/syzkaller/pkg/tool" "github.com/google/syzkaller/sys/targets" ) @@ -36,7 +37,19 @@ func TestExecprogCmd(t *testing.T) { 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, "vmtype", - "namespace", 3, true, false, true, 7, 2, 3, true, 10, "myprog") + csource.Options{ + Sandbox: "namespace", + SandboxArg: 3, + Repeat: true, + Threaded: false, + Procs: 7, + LegacyOptions: csource.LegacyOptions{ + Collide: true, + Fault: true, + FaultCall: 2, + FaultNth: 3, + }, + }, true, 10, "myprog") args := strings.Split(cmdLine, " ")[1:] if err := tool.ParseFlags(flags, args); err != nil { t.Fatal(err) -- cgit mrf-deployment