From 2a075d57ab619ae5333c823cc260a722ab0c47fe Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 21 Jun 2018 14:38:08 +0200 Subject: 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. --- pkg/report/linux_test.go | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'pkg/report/linux_test.go') 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) } -- cgit mrf-deployment