From 6dc90bbb492fd93da310988ae3a0ea44b8dc40db Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 5 Mar 2026 16:19:10 +0100 Subject: pkg/aflow/tool/syzlang: provide list of description files Update #6878 --- pkg/aflow/tool/syzlang/descriptions.go | 21 +++++++++++++++++++++ pkg/aflow/tool/syzlang/descriptions_test.go | 16 ++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 pkg/aflow/tool/syzlang/descriptions.go create mode 100644 pkg/aflow/tool/syzlang/descriptions_test.go (limited to 'pkg/aflow/tool') 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") +} -- cgit mrf-deployment