Skip to content

Commit 4f9138e

Browse files
committed
syz-cluster: perform a patched kernel boot test
Report the findings only for the boot test of the patched kernel.
1 parent 41b2b2c commit 4f9138e

File tree

3 files changed

+43
-5
lines changed

3 files changed

+43
-5
lines changed

syz-cluster/pkg/workflow/template.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,37 @@ spec:
120120
value: "{{=jsonpath(steps['base-build'].outputs.parameters.result, '$.build_id')}}"
121121
- name: test-name
122122
value: "Boot test: Base"
123+
- name: boot-test-patched
124+
templateRef:
125+
name: boot-step-template
126+
template: boot-step
127+
arguments:
128+
artifacts:
129+
- name: kernel
130+
from: "{{steps.patched-build.outputs.artifacts.kernel}}"
131+
parameters:
132+
- name: config
133+
value: "{{=jsonpath(inputs.parameters.element, '$.config')}}"
134+
- name: patched-build-id
135+
value: "{{=jsonpath(steps['patched-build'].outputs.parameters.result, '$.build_id')}}"
136+
- name: report-findings
137+
value: "true"
138+
- name: test-name
139+
value: "Boot test: Patched"
123140
- - name: break-if-base-boot-failed
124141
template: exit-workflow
125142
arguments:
126143
parameters:
127144
- name: code
128145
value: 0
129146
when: "{{=jsonpath(steps['boot-test-base'].outputs.parameters.result, '$.success') == false}}"
147+
- - name: break-if-patched-boot-failed
148+
template: exit-workflow
149+
arguments:
150+
parameters:
151+
- name: code
152+
value: 0
153+
when: "{{=jsonpath(steps['boot-test-patched'].outputs.parameters.result, '$.success') == false}}"
130154
- name: extract-request
131155
inputs:
132156
parameters:

syz-cluster/workflow/boot-step/main.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var (
2424
flagBaseBuild = flag.String("base_build", "", "base build ID")
2525
flagPatchedBuild = flag.String("patched_build", "", "patched build ID")
2626
flagOutput = flag.String("output", "", "where to store the result")
27+
flagFindings = flag.Bool("findings", false, "report failur as findings")
2728
)
2829

2930
func main() {
@@ -79,9 +80,13 @@ func runTest(ctx context.Context, client *api.Client) (bool, error) {
7980
rep, err := instance.RunSmokeTest(cfg)
8081
if err != nil {
8182
return false, err
83+
} else if rep == nil {
84+
return true, nil
8285
}
83-
if rep != nil {
84-
log.Printf("uploading the finding %q", rep.Title)
86+
87+
log.Printf("found: %q", rep.Title)
88+
if *flagFindings {
89+
log.Printf("reporting the finding")
8590
findingErr := client.UploadFinding(ctx, &api.Finding{
8691
SessionID: *flagSession,
8792
TestName: *flagTestName,
@@ -92,7 +97,6 @@ func runTest(ctx context.Context, client *api.Client) (bool, error) {
9297
if findingErr != nil {
9398
return false, fmt.Errorf("failed to report the finding: %w", findingErr)
9499
}
95-
return false, nil
96100
}
97-
return true, nil
101+
return false, nil
98102
}

syz-cluster/workflow/boot-step/workflow-template.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ spec:
1818
value: ""
1919
- name: test-name
2020
value: ""
21+
- name: report-findings
22+
value: "false"
2123
artifacts:
2224
- name: kernel
2325
path: /kernel
@@ -31,8 +33,16 @@ spec:
3133
"--session", "{{workflow.parameters.session-id}}",
3234
"--test_name", "{{inputs.parameters.test-name}}",
3335
"--base_build", "{{inputs.parameters.base-build-id}}",
34-
"--patched_build", "{{inputs.parameters.patched-build-id}}"
36+
"--patched_build", "{{inputs.parameters.patched-build-id}}",
37+
"-findings={{inputs.parameters.report-findings}}"
3538
]
39+
resources:
40+
requests:
41+
cpu: 6
42+
memory: 12G
43+
limits:
44+
cpu: 8
45+
memory: 24G
3646
volumeMounts:
3747
- name: workdir
3848
mountPath: /workdir

0 commit comments

Comments
 (0)