From 142ce68175f5321ccde23eafda4830707f20e67b Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Tue, 9 Apr 2019 19:27:54 +0200 Subject: pkg/runtest: add simple USB runtest --- pkg/runtest/run.go | 3 +++ sys/linux/test/vusb | 3 +++ tools/syz-runtest/runtest.go | 3 +++ 3 files changed, 9 insertions(+) create mode 100644 sys/linux/test/vusb diff --git a/pkg/runtest/run.go b/pkg/runtest/run.go index 67f736657..b30d284c6 100644 --- a/pkg/runtest/run.go +++ b/pkg/runtest/run.go @@ -140,6 +140,9 @@ func (ctx *Context) generatePrograms(progs chan *RunRequest) error { if strings.HasSuffix(file.Name(), "~") { continue } + if strings.HasSuffix(file.Name(), ".swp") { + continue + } p, requires, results, err := ctx.parseProg(file.Name()) if err != nil { return err diff --git a/sys/linux/test/vusb b/sys/linux/test/vusb new file mode 100644 index 000000000..500eef14e --- /dev/null +++ b/sys/linux/test/vusb @@ -0,0 +1,3 @@ +# requires: -sandbox=setuid -sandbox=namespace + +syz_usb_connect(0x0, 0x24, &(0x7f0000000000)={0x12, 0x1, 0x0, 0x97, 0xff, 0x82, 0x8, 0x2058, 0x1005, 0xc19b, 0x0, 0x0, 0x0, 0x1, [{0x9, 0x2, 0x12, 0x1, 0x0, 0x0, 0x0, 0x0, [{0x9, 0x4, 0x8f, 0x0, 0x0, 0xbf, 0x57, 0x5a, 0x0, [], []}]}]}, 0x0) diff --git a/tools/syz-runtest/runtest.go b/tools/syz-runtest/runtest.go index e507db571..61b89a809 100644 --- a/tools/syz-runtest/runtest.go +++ b/tools/syz-runtest/runtest.go @@ -284,6 +284,9 @@ func testParsing(target *prog.Target, dir string) error { if strings.HasSuffix(file.Name(), "~") { continue } + if strings.HasSuffix(file.Name(), ".swp") { + continue + } if err := runtest.TestParseProg(target, dir, file.Name()); err != nil { return err } -- cgit mrf-deployment