Skip to content

Commit bd178e5

Browse files
committed
pkg/instance: fix sandbox_arg passing
We used the wrong name for the optional argument.
1 parent e4aed69 commit bd178e5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pkg/instance/instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ func ExecprogCmd(execprog, executor, OS, arch, vmType string, opts csource.Optio
483483
if optionalFlags {
484484
optionalArg += " " + tool.OptionalFlags([]tool.Flag{
485485
{Name: "slowdown", Value: fmt.Sprint(slowdown)},
486-
{Name: "sandboxArg", Value: fmt.Sprint(opts.SandboxArg)},
486+
{Name: "sandbox_arg", Value: fmt.Sprint(opts.SandboxArg)},
487487
{Name: "type", Value: fmt.Sprint(vmType)},
488488
})
489489
}

pkg/instance/instance_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func TestExecprogCmd(t *testing.T) {
3636
flagSignal := flags.Bool("cover", false, "collect feedback signals (coverage)")
3737
flagSandbox := flags.String("sandbox", "none", "sandbox for fuzzing (none/setuid/namespace/android)")
3838
flagSlowdown := flags.Int("slowdown", 1, "")
39+
flagSandboxArg := flags.Int("sandbox_arg", 0, "argument for sandbox runner to adjust it via config")
3940
cmdLine := ExecprogCmd(os.Args[0], "/myexecutor", targets.FreeBSD, targets.I386, "vmtype",
4041
csource.Options{
4142
Sandbox: "namespace",
@@ -81,6 +82,9 @@ func TestExecprogCmd(t *testing.T) {
8182
if *flagSandbox != "namespace" {
8283
t.Errorf("bad sandbox: %q, want: %q", *flagSandbox, "namespace")
8384
}
85+
if *flagSandboxArg != 3 {
86+
t.Errorf("bad sandbox_arg: %q, want: %q", *flagSandboxArg, 3)
87+
}
8488
if *flagSignal {
8589
t.Errorf("bad signal: %v, want: %v", *flagSignal, false)
8690
}

0 commit comments

Comments
 (0)