diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-05-21 21:13:39 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-05-27 07:21:25 +0000 |
| commit | 282e82b3010e362d6160ad2b137c13c74fc3fd12 (patch) | |
| tree | bfc205a0ea4b728deb98b865fa529d8e61c4fbd9 /pkg/instance/instance_test.go | |
| parent | a10a183e260f0ea1a0c37e84ca5c60f28c13e3fd (diff) | |
pkg/instance: use execprog to do basic instance testing
When we accept new kernels for fuzzing we need more extensive testing,
but syz-ci switched to using syz-manager for this purpose.
Now instance testing is used only for bisection and patch testing,
which does not need such extensive image testing (it may even harm).
So just run a simple program as a testing.
It also uses the same features as the target reproducer,
so e.g. if the reproducer does not use wifi, we won't test it,
which reduces changes of unrelated kernel bugs.
Diffstat (limited to 'pkg/instance/instance_test.go')
| -rw-r--r-- | pkg/instance/instance_test.go | 65 |
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. |
