aboutsummaryrefslogtreecommitdiffstats
path: root/prog
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-11-14 14:32:00 +0100
committerDmitry Vyukov <dvyukov@google.com>2024-11-14 17:05:16 +0000
commit6cc1688b7dcbbfc29192326ed3a7a9d421d9d067 (patch)
tree6dc62b43bc05d2e5b94f9d063df4c6f3691eb232 /prog
parent77f3eeb755d0c3e79023775a7e72e05dded0f8a1 (diff)
sys/linux: ensure that auto descriptions are self-sufficient
Test that if we enable only auto descriptions, nothing gets disabled. Currently nothing can create fd_cgroup which is used by the descriptions.
Diffstat (limited to 'prog')
-rw-r--r--prog/resources_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/prog/resources_test.go b/prog/resources_test.go
index 334f9bbe5..3804ef494 100644
--- a/prog/resources_test.go
+++ b/prog/resources_test.go
@@ -103,6 +103,24 @@ func TestTransitivelyEnabledCallsLinux(t *testing.T) {
}
}
+func TestTransitivelyEnabledAutoCalls(t *testing.T) {
+ t.Parallel()
+ target, err := GetTarget("linux", "amd64")
+ if err != nil {
+ t.Fatal(err)
+ }
+ calls := make(map[*Syscall]bool)
+ for _, c := range target.Syscalls {
+ if c.Attrs.Automatic || c.Attrs.AutomaticHelper {
+ calls[c] = true
+ }
+ }
+ _, disabled := target.TransitivelyEnabledCalls(calls)
+ for c, reason := range disabled {
+ t.Errorf("disabled call %v: %v", c.Name, reason)
+ }
+}
+
func TestGetInputResources(t *testing.T) {
expectedRequiredResources := map[string]bool{
"required_res1": false,