Skip to content

Commit 3181850

Browse files
committed
pkg/aflow/action/crash: add simple testing action
1 parent f790098 commit 3181850

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

pkg/aflow/action/crash/test.go

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright 2026 syzkaller project authors. All rights reserved.
2+
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
3+
4+
package crash
5+
6+
import (
7+
"encoding/json"
8+
9+
"github.com/google/syzkaller/pkg/aflow"
10+
)
11+
12+
// TestPatch action does an in-tree kernel build in KernelScratchSrc dir,
13+
// and runs the reproducer on the newly built kernel.
14+
// If there are build/boot/test errors, a detailed error message is returned in TestError.
15+
// The action also collects diff of the local changes, returns it in PatchDiff,
16+
// and resets source code state to HEAD (removes all local edits).
17+
var TestPatch = aflow.NewFuncAction("test-patch", testPatch)
18+
19+
type testArgs struct {
20+
Syzkaller string
21+
Image string
22+
Type string
23+
VM json.RawMessage
24+
ReproOpts string
25+
ReproSyz string
26+
ReproC string
27+
SyzkallerCommit string
28+
KernelScratchSrc string
29+
KernelCommit string
30+
KernelConfig string
31+
}
32+
33+
type testResult struct {
34+
PatchDiff string
35+
TestError string
36+
}
37+
38+
func testPatch(ctx *aflow.Context, args testArgs) (testResult, error) {
39+
return testResult{}, nil
40+
}

0 commit comments

Comments
 (0)