aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/instance/instance_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/instance/instance_test.go')
-rw-r--r--pkg/instance/instance_test.go65
1 files changed, 0 insertions, 65 deletions
diff --git a/pkg/instance/instance_test.go b/pkg/instance/instance_test.go
index 843334ebd..283921224 100644
--- a/pkg/instance/instance_test.go
+++ b/pkg/instance/instance_test.go
@@ -14,71 +14,6 @@ import (
"github.com/google/syzkaller/sys/targets"
)
-func TestFuzzerCmd(t *testing.T) {
- // IMPORTANT: if this test fails, do not fix it by changing flags here!
- // Test how an old version of syz-fuzzer parses flags generated by the current FuzzerCmd.
- // This actually happens in syz-ci when we test a patch for an old bug and use an old syz-fuzzer/execprog.
- flags := flag.NewFlagSet("", flag.ContinueOnError)
- flagName := flags.String("name", "", "unique name for manager")
- flagArch := flags.String("arch", "", "target arch")
- flagManager := flags.String("manager", "", "manager rpc address")
- flagProcs := flags.Int("procs", 1, "number of parallel test processes")
- flagLeak := flags.Bool("leak", false, "detect memory leaks")
- flagOutput := flags.String("output", "stdout", "write programs to none/stdout/dmesg/file")
- flagPprof := flags.String("pprof", "", "address to serve pprof profiles")
- flagTest := flags.Bool("test", false, "enable image testing mode") // used by syz-ci
- flagExecutor := flags.String("executor", "./syz-executor", "path to executor binary")
- flagSignal := flags.Bool("cover", false, "collect feedback signals (coverage)")
- flagSandbox := flags.String("sandbox", "none", "sandbox for fuzzing (none/setuid/namespace/android)")
- flagDebug := flags.Bool("debug", false, "debug output from executor")
- flagV := flags.Int("v", 0, "verbosity")
- cmdLine := OldFuzzerCmd(os.Args[0], "/myexecutor", "myname", targets.Linux, targets.I386, "localhost:1234",
- "namespace", 23, 3, true, true, false, 5)
- args := strings.Split(cmdLine, " ")[1:]
- if err := flags.Parse(args); err != nil {
- t.Fatal(err)
- }
- if *flagName != "myname" {
- t.Errorf("bad name: %q, want: %q", *flagName, "myname")
- }
- if *flagArch != targets.I386 {
- t.Errorf("bad arch: %q, want: %q", *flagArch, targets.I386)
- }
- if *flagManager != "localhost:1234" {
- t.Errorf("bad manager: %q, want: %q", *flagManager, "localhost:1234")
- }
- if *flagProcs != 3 {
- t.Errorf("bad procs: %v, want: %v", *flagProcs, 3)
- }
- if *flagLeak {
- t.Errorf("bad leak: %v, want: %v", *flagLeak, false)
- }
- if *flagOutput != "stdout" {
- t.Errorf("bad output: %q, want: %q", *flagOutput, "stdout")
- }
- if *flagPprof != "" {
- t.Errorf("bad pprof: %q, want: %q", *flagPprof, "")
- }
- if !*flagTest {
- t.Errorf("bad test: %v, want: %v", *flagTest, true)
- }
- if *flagExecutor != "/myexecutor" {
- t.Errorf("bad executor: %q, want: %q", *flagExecutor, "/myexecutor")
- }
- if *flagSandbox != "namespace" {
- t.Errorf("bad sandbox: %q, want: %q", *flagSandbox, "namespace")
- }
- if !*flagSignal {
- t.Errorf("bad signal: %v, want: %v", *flagSignal, true)
- }
- if *flagDebug {
- t.Errorf("bad debug: %v, want: %v", *flagDebug, false)
- }
- if *flagV != 0 {
- t.Errorf("bad verbosity: %v, want: %v", *flagV, 0)
- }
-}
-
func TestExecprogCmd(t *testing.T) {
// IMPORTANT: if this test fails, do not fix it by changing flags here!
// See comment in TestFuzzerCmd.