From 18f846ca807cfc6df9c3da3c0ab08251277dfefb Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Wed, 1 Dec 2021 17:25:40 +0000 Subject: 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. --- prog/minimization_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'prog/minimization_test.go') 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 { -- cgit mrf-deployment