From 6cc1688b7dcbbfc29192326ed3a7a9d421d9d067 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 14 Nov 2024 14:32:00 +0100 Subject: 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. --- prog/resources_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'prog') 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, -- cgit mrf-deployment