build: exex directive: add support for transition.

This commit is contained in:
Alexandre Pujol 2024-03-22 19:47:45 +00:00
parent a5f71675ea
commit 73fe7a7475
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
2 changed files with 38 additions and 10 deletions

View file

@ -30,6 +30,20 @@ func TestExec_Apply(t *testing.T) {
profile: ` #aa:exec DiscoverNotifier`,
want: ` @{lib}/DiscoverNotifier Px,
@{lib}/@{multiarch}/{,libexec/}DiscoverNotifier Px,
`,
},
{
name: "exec-unconfined",
rootApparmord: paths.New("../../../apparmor.d/groups/freedesktop/"),
opt: &Option{
Name: "exec",
Args: map[string]string{"U": "", "polkit-agent-helper": ""},
File: nil,
Raw: " #aa:exec U polkit-agent-helper",
},
profile: ` #aa:exec U polkit-agent-helper`,
want: ` @{lib}/polkit-[0-9]/polkit-agent-helper-[0-9] Ux,
@{lib}/polkit-agent-helper-[0-9] Ux,
`,
},
}