mirror of
https://github.com/containers/podman.git
synced 2025-10-17 19:24:04 +08:00
Fix unconfined AppArmor profile usage for unsupported systems
If we select "unconfined" as AppArmor profile, then we should not error even if the host does not support it at all. This behavior has been fixed and a corresponding e2e test has been added as well. Signed-off-by: Sascha Grunert <sgrunert@suse.com>
This commit is contained in:
@ -155,4 +155,17 @@ profile aa-test-profile flags=(attach_disconnected,mediate_deleted) {
|
||||
inspect := podmanTest.InspectContainer(cid)
|
||||
Expect(inspect[0].AppArmorProfile).To(Equal(""))
|
||||
})
|
||||
|
||||
It("podman run apparmor disabled unconfined", func() {
|
||||
skipIfAppArmorEnabled()
|
||||
|
||||
session := podmanTest.Podman([]string{"create", "--security-opt", "apparmor=unconfined", ALPINE, "ls"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
|
||||
cid := session.OutputToString()
|
||||
// Verify that apparmor.Profile is being set
|
||||
inspect := podmanTest.InspectContainer(cid)
|
||||
Expect(inspect[0].AppArmorProfile).To(Equal(""))
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user