aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/subsystem/extractor_test.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-03-28 11:51:46 +0200
committerAleksandr Nogikh <wp32pw@gmail.com>2023-03-28 13:53:08 +0200
commit7df4f03f0bca2ce51d72b78e2cfe3823733810aa (patch)
treec7c31300f67445f37ed1486c5e5db7bd29a93e42 /pkg/subsystem/extractor_test.go
parent47f3aaf18b57644f3c07714c9ce073a210f061b4 (diff)
pkg/subsystem: take only always present calls from repros
We're not yet perfect at eliminating unneeded calls from reproducers, so let's make the subsystem extraction rules stricter: only take a subsystem from the reproducer if it's present in all reproducers. Consider more crashes (7 instead of 5) to give more opportunities to drop an unneeded call.
Diffstat (limited to 'pkg/subsystem/extractor_test.go')
-rw-r--r--pkg/subsystem/extractor_test.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/pkg/subsystem/extractor_test.go b/pkg/subsystem/extractor_test.go
index c2d165973..a78509e0f 100644
--- a/pkg/subsystem/extractor_test.go
+++ b/pkg/subsystem/extractor_test.go
@@ -13,7 +13,7 @@ import (
func TestExtractor(t *testing.T) {
// Objects used in tests.
fsPath := "fs/"
- extProg, nfsProg := []byte("ext prog"), []byte("nfs prog")
+ extProg, nfsProg, extNfsProg := []byte("ext"), []byte("nfs"), []byte("ext nfs")
fs := &Subsystem{Name: "fs"}
ext := &Subsystem{Name: "ext", Parents: []*Subsystem{fs}}
nfs := &Subsystem{Name: "nfs", Parents: []*Subsystem{fs}}
@@ -46,7 +46,7 @@ func TestExtractor(t *testing.T) {
want: []*Subsystem{ext},
},
{
- name: `Two equally present children`,
+ name: `Reproducers hint at different subsystems`,
crashes: []*Crash{
{
GuiltyPath: fsPath,
@@ -60,10 +60,10 @@ func TestExtractor(t *testing.T) {
SyzRepro: nfsProg,
},
},
- want: []*Subsystem{nfs, ext},
+ want: []*Subsystem{fs},
},
{
- name: `One child is more present than another`,
+ name: `One subsystem from reproducers is irrelevant`,
crashes: []*Crash{
{
GuiltyPath: fsPath,
@@ -74,11 +74,7 @@ func TestExtractor(t *testing.T) {
},
{
GuiltyPath: fsPath,
- SyzRepro: nfsProg,
- },
- {
- GuiltyPath: fsPath,
- SyzRepro: extProg,
+ SyzRepro: extNfsProg,
},
},
want: []*Subsystem{ext},
@@ -92,6 +88,7 @@ func TestExtractor(t *testing.T) {
perProg: []progSubsystems{
{extProg, []*Subsystem{ext}},
{nfsProg, []*Subsystem{nfs}},
+ {extNfsProg, []*Subsystem{ext, nfs}},
},
},
}