diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2026-03-05 16:19:10 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2026-03-05 19:54:06 +0000 |
| commit | 6dc90bbb492fd93da310988ae3a0ea44b8dc40db (patch) | |
| tree | 654e28e0f8422cb0e7429e167b6d56952e3b825b /pkg/aflow/tool | |
| parent | b31d884d1ac0e8242c5e81e1937cc300b1073c3d (diff) | |
pkg/aflow/tool/syzlang: provide list of description files
Update #6878
Diffstat (limited to 'pkg/aflow/tool')
| -rw-r--r-- | pkg/aflow/tool/syzlang/descriptions.go | 21 | ||||
| -rw-r--r-- | pkg/aflow/tool/syzlang/descriptions_test.go | 16 |
2 files changed, 37 insertions, 0 deletions
diff --git a/pkg/aflow/tool/syzlang/descriptions.go b/pkg/aflow/tool/syzlang/descriptions.go new file mode 100644 index 000000000..9af410c3c --- /dev/null +++ b/pkg/aflow/tool/syzlang/descriptions.go @@ -0,0 +1,21 @@ +// Copyright 2026 syzkaller project authors. All rights reserved. +// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +package syzlang + +import ( + "github.com/google/syzkaller/sys" + "github.com/google/syzkaller/sys/targets" +) + +func DescriptionFiles() []string { + entries, err := sys.Files.ReadDir(targets.Linux) + if err != nil { + panic(err) + } + var files []string + for _, ent := range entries { + files = append(files, ent.Name()) + } + return files +} diff --git a/pkg/aflow/tool/syzlang/descriptions_test.go b/pkg/aflow/tool/syzlang/descriptions_test.go new file mode 100644 index 000000000..23ca890e2 --- /dev/null +++ b/pkg/aflow/tool/syzlang/descriptions_test.go @@ -0,0 +1,16 @@ +// Copyright 2026 syzkaller project authors. All rights reserved. +// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +package syzlang + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestDescriptionFiles(t *testing.T) { + files := DescriptionFiles() + require.Greater(t, len(files), 50) + require.Contains(t, files, "sys.txt") +} |
