diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/syz-runtest/runtest.go | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/tools/syz-runtest/runtest.go b/tools/syz-runtest/runtest.go index c1a1525d2..a84bc005d 100644 --- a/tools/syz-runtest/runtest.go +++ b/tools/syz-runtest/runtest.go @@ -15,6 +15,7 @@ import ( "net" "os" "path/filepath" + "strings" "sync" "time" @@ -44,6 +45,10 @@ func main() { if err != nil { log.Fatal(err) } + testDir := filepath.Join(cfg.Syzkaller, "sys", target.OS, "test") + if err := testParsing(target, testDir); err != nil { + log.Fatal(err) + } vmPool, err := vm.Create(cfg, *flagDebug) if err != nil { log.Fatal(err) @@ -111,7 +116,7 @@ func main() { fmt.Printf("%-24v: %v calls enabled\n", sandbox+" sandbox", len(calls)) } ctx := &runtest.Context{ - Dir: filepath.Join(cfg.Syzkaller, "sys", target.OS, "test"), + Dir: testDir, Target: target, Features: mgr.checkResult.Features, EnabledCalls: enabledCalls, @@ -268,3 +273,19 @@ func (mgr *Manager) Done(a *rpctype.RunTestDoneArgs, r *int) error { close(req.Done) return nil } + +func testParsing(target *prog.Target, dir string) error { + files, err := ioutil.ReadDir(dir) + if err != nil { + return fmt.Errorf("failed to read %v: %v", dir, err) + } + for _, file := range files { + if strings.HasSuffix(file.Name(), "~") { + continue + } + if err := runtest.TestParseProg(target, dir, file.Name()); err != nil { + return err + } + } + return nil +} |
