diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2025-08-13 15:13:30 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2025-08-20 11:02:17 +0000 |
| commit | bd178e579d4e464637c6f58c476bd45e60296748 (patch) | |
| tree | 2daa144e5048d4293917938cce81c6081a56c498 /pkg/instance | |
| parent | e4aed695dda3b9b6c5185feb5f5f993955843594 (diff) | |
pkg/instance: fix sandbox_arg passing
We used the wrong name for the optional argument.
Diffstat (limited to 'pkg/instance')
| -rw-r--r-- | pkg/instance/instance.go | 2 | ||||
| -rw-r--r-- | pkg/instance/instance_test.go | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index bcb56e8e4..622d1620e 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -483,7 +483,7 @@ func ExecprogCmd(execprog, executor, OS, arch, vmType string, opts csource.Optio if optionalFlags { optionalArg += " " + tool.OptionalFlags([]tool.Flag{ {Name: "slowdown", Value: fmt.Sprint(slowdown)}, - {Name: "sandboxArg", Value: fmt.Sprint(opts.SandboxArg)}, + {Name: "sandbox_arg", Value: fmt.Sprint(opts.SandboxArg)}, {Name: "type", Value: fmt.Sprint(vmType)}, }) } diff --git a/pkg/instance/instance_test.go b/pkg/instance/instance_test.go index a8f50cc2d..cd291233c 100644 --- a/pkg/instance/instance_test.go +++ b/pkg/instance/instance_test.go @@ -36,6 +36,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, "") + flagSandboxArg := flags.Int("sandbox_arg", 0, "argument for sandbox runner to adjust it via config") cmdLine := ExecprogCmd(os.Args[0], "/myexecutor", targets.FreeBSD, targets.I386, "vmtype", csource.Options{ Sandbox: "namespace", @@ -81,6 +82,9 @@ func TestExecprogCmd(t *testing.T) { if *flagSandbox != "namespace" { t.Errorf("bad sandbox: %q, want: %q", *flagSandbox, "namespace") } + if *flagSandboxArg != 3 { + t.Errorf("bad sandbox_arg: %q, want: %q", *flagSandboxArg, 3) + } if *flagSignal { t.Errorf("bad signal: %v, want: %v", *flagSignal, false) } |
