diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-06-21 14:38:08 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-06-22 16:40:45 +0200 |
| commit | 2a075d57ab619ae5333c823cc260a722ab0c47fe (patch) | |
| tree | 0877143833caae9b98744a237b0e3a3694348a6b /pkg/report/linux_test.go | |
| parent | c31f96a8c65c0757078ea77218905c73fc1068d4 (diff) | |
pkg/report: allow to specify suppressions per OS
Currently all (linux-specific) suppressions are hardcoded in mgrconfig.
This is very wrong. Move them to pkg/report and allow to specify per OS.
Add gvisor-specific suppressions.
This required a bit of refactoring. Introduce mgrconfig.KernelObj finally.
Make report.NewReporter and vm.Create accept mgrconfig directly
instead of passing it as multiple scattered args.
Remove tools/syz-parse and it always did the same as tools/syz-symbolize.
Simplify global vars in syz-manager/cover.go.
Create reporter eagerly in manager. Use sort.Slice more.
Overall -90 lines removed.
Diffstat (limited to 'pkg/report/linux_test.go')
| -rw-r--r-- | pkg/report/linux_test.go | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/pkg/report/linux_test.go b/pkg/report/linux_test.go index 0543fcbe0..338ab27a0 100644 --- a/pkg/report/linux_test.go +++ b/pkg/report/linux_test.go @@ -5,38 +5,32 @@ package report import ( "fmt" - "regexp" "testing" "github.com/google/syzkaller/pkg/symbolizer" + "github.com/google/syzkaller/syz-manager/mgrconfig" ) func TestLinuxIgnores(t *testing.T) { - reporter, err := NewReporter("linux", "", "", "", nil, nil) + cfg := &mgrconfig.Config{ + TargetOS: "linux", + } + reporter, err := NewReporter(cfg) if err != nil { t.Fatal(err) } - ignores1 := []*regexp.Regexp{ - regexp.MustCompile("BUG: bug3"), - } - reporter1, err := NewReporter("linux", "", "", "", nil, ignores1) + cfg.Ignores = []string{"BUG: bug3"} + reporter1, err := NewReporter(cfg) if err != nil { t.Fatal(err) } - ignores2 := []*regexp.Regexp{ - regexp.MustCompile("BUG: bug3"), - regexp.MustCompile("BUG: bug1"), - } - reporter2, err := NewReporter("linux", "", "", "", nil, ignores2) + cfg.Ignores = []string{"BUG: bug3", "BUG: bug1"} + reporter2, err := NewReporter(cfg) if err != nil { t.Fatal(err) } - ignores3 := []*regexp.Regexp{ - regexp.MustCompile("BUG: bug3"), - regexp.MustCompile("BUG: bug1"), - regexp.MustCompile("BUG: bug2"), - } - reporter3, err := NewReporter("linux", "", "", "", nil, ignores3) + cfg.Ignores = []string{"BUG: bug3", "BUG: bug1", "BUG: bug2"} + reporter3, err := NewReporter(cfg) if err != nil { t.Fatal(err) } |
