aboutsummaryrefslogtreecommitdiffstats
path: root/prog/minimization_test.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2021-12-01 17:25:40 +0000
committerAleksandr Nogikh <wp32pw@gmail.com>2021-12-10 12:30:07 +0100
commit18f846ca807cfc6df9c3da3c0ab08251277dfefb (patch)
treee14f783b914409f21ae77a01a6b74ededaba6901 /prog/minimization_test.go
parent52c8379f77b5f292e2d527c66dfe17a899381d20 (diff)
all: add the `rerun` call property
To be able to collide specific syscalls more precisely, we need to repeat the process many times. Introduce the `rerun` call property, which instructs `syz-executor` to repeat the call the specified number of times. The intended use is: call1() (rerun: 100, async) call2() (rerun: 100) For now, assign rerun values randomly to consecutive pairs of calls, where the first one is async.
Diffstat (limited to 'prog/minimization_test.go')
-rw-r--r--prog/minimization_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/prog/minimization_test.go b/prog/minimization_test.go
index cf499b7f1..697937e92 100644
--- a/prog/minimization_test.go
+++ b/prog/minimization_test.go
@@ -8,6 +8,7 @@ import (
"testing"
)
+// nolint:gocyclo
func TestMinimize(t *testing.T) {
tests := []struct {
os string
@@ -193,6 +194,28 @@ func TestMinimize(t *testing.T) {
"pipe2(0x0, 0x0) (async)\n",
-1,
},
+ // Clear unneeded rerun.
+ {
+ "linux", "amd64",
+ "pipe2(0x0, 0x0) (rerun: 100)\n",
+ -1,
+ func(p *Prog, callIndex int) bool {
+ return len(p.Calls) == 1 && p.Calls[0].Meta.Name == "pipe2"
+ },
+ "pipe2(0x0, 0x0)\n",
+ -1,
+ },
+ // Keep important rerun.
+ {
+ "linux", "amd64",
+ "pipe2(0x0, 0x0) (rerun: 100)\n",
+ -1,
+ func(p *Prog, callIndex int) bool {
+ return len(p.Calls) == 1 && p.Calls[0].Meta.Name == "pipe2" && p.Calls[0].Props.Rerun >= 100
+ },
+ "pipe2(0x0, 0x0) (rerun: 100)\n",
+ -1,
+ },
}
t.Parallel()
for ti, test := range tests {