diff options
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/csource/csource_test.go | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/pkg/csource/csource_test.go b/pkg/csource/csource_test.go index 1dae0202d..9e9dadf86 100644 --- a/pkg/csource/csource_test.go +++ b/pkg/csource/csource_test.go @@ -38,6 +38,10 @@ func TestGenerate(t *testing.T) { t.Parallel() checked := make(map[string]bool) for _, target := range prog.AllTargets() { + // Auto-generated descriptions currently do not properly mark arch-specific syscalls, see + // https://github.com/google/syzkaller/issues/5410#issuecomment-3570190241. + // Until it's fixed, let's remove these syscalls from csource tests. + ct := target.NoAutoChoiceTable() sysTarget := targets.Get(target.OS, target.Arch) if runtime.GOOS != sysTarget.BuildOS { continue @@ -50,14 +54,14 @@ func TestGenerate(t *testing.T) { if full || !testing.Short() { checked[target.OS] = true t.Parallel() - testTarget(t, target, full) + testTarget(t, target, full, ct) } - testPseudoSyscalls(t, target) + testPseudoSyscalls(t, target, ct) }) } } -func testPseudoSyscalls(t *testing.T, target *prog.Target) { +func testPseudoSyscalls(t *testing.T, target *prog.Target, ct *prog.ChoiceTable) { // Use options that are as minimal as possible. // We want to ensure that the code can always be compiled. opts := Options{ @@ -65,7 +69,7 @@ func testPseudoSyscalls(t *testing.T, target *prog.Target) { } rs := testutil.RandSource(t) for _, meta := range target.PseudoSyscalls() { - p := target.GenSampleProg(meta, rs) + p := target.GenSampleProg(meta, rs, ct) t.Run(fmt.Sprintf("single_%s", meta.CallName), func(t *testing.T) { t.Parallel() testOne(t, p, opts) @@ -73,9 +77,9 @@ func testPseudoSyscalls(t *testing.T, target *prog.Target) { } } -func testTarget(t *testing.T, target *prog.Target, full bool) { +func testTarget(t *testing.T, target *prog.Target, full bool, ct *prog.ChoiceTable) { rs := testutil.RandSource(t) - p := target.Generate(rs, 10, target.DefaultChoiceTable()) + p := target.Generate(rs, 10, ct) // Turns out that fully minimized program can trigger new interesting warnings, // e.g. about NULL arguments for functions that require non-NULL arguments in syz_ functions. // We could append both AllSyzProg as-is and a minimized version of it, |
