diff --git a/tests/main/component-hooks/task.yaml b/tests/main/component-hooks/task.yaml index edd8fd9937d..0ad61febd15 100644 --- a/tests/main/component-hooks/task.yaml +++ b/tests/main/component-hooks/task.yaml @@ -25,3 +25,14 @@ execute: | # the hook writes this file if it runs (and uses the network via the network # plug) successfully test -f /var/snap/snap-with-comps/common/install-done + + # make sure that security profiles got generated + test -f /var/lib/snapd/apparmor/profiles/snap.snap-with-comps+comp-with-install-hook.hook.install + test -f /var/lib/snapd/seccomp/bpf/snap.snap-with-comps+comp-with-install-hook.hook.install.src + test -f /var/lib/snapd/seccomp/bpf/snap.snap-with-comps+comp-with-install-hook.hook.install.bin2 + + # remove the snap and make sure that the profiles get removed + snap remove snap-with-comps + not test -f /var/lib/snapd/apparmor/profiles/snap.snap-with-comps+comp-with-install-hook.hook.install + not test -f /var/lib/snapd/seccomp/bpf/snap.snap-with-comps+comp-with-install-hook.hook.install.src + not test -f /var/lib/snapd/seccomp/bpf/snap.snap-with-comps+comp-with-install-hook.hook.install.bin2