mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2024-11-15 07:54:17 +01:00
test: add more profile sorting test.
This commit is contained in:
parent
c0bc903101
commit
95c322d62a
@ -5,6 +5,13 @@
|
||||
package aa
|
||||
|
||||
var (
|
||||
// Include
|
||||
includeLocal1 = &Include{
|
||||
IfExists: true,
|
||||
IsMagic: true,
|
||||
Path: "local/foo",
|
||||
}
|
||||
|
||||
// Capability
|
||||
capability1Log = map[string]string{
|
||||
"apparmor": "ALLOWED",
|
||||
|
@ -155,11 +155,7 @@ func TestAppArmorProfile_String(t *testing.T) {
|
||||
Path: "@{sys}/devices/pci[0-9]*/**/class",
|
||||
Access: "r",
|
||||
},
|
||||
&Include{
|
||||
IfExists: true,
|
||||
IsMagic: true,
|
||||
Path: "local/foo",
|
||||
},
|
||||
includeLocal1,
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -276,12 +272,18 @@ func TestAppArmorProfile_Sort(t *testing.T) {
|
||||
name: "all",
|
||||
origin: &AppArmorProfile{
|
||||
Profile: Profile{
|
||||
Rules: []ApparmorRule{file2, network1, dbus2, signal1, ptrace1, capability2, file1, dbus1, unix2, signal2, mount2},
|
||||
Rules: []ApparmorRule{
|
||||
file2, network1, includeLocal1, dbus2, signal1, ptrace1,
|
||||
capability2, file1, dbus1, unix2, signal2, mount2,
|
||||
},
|
||||
},
|
||||
},
|
||||
want: &AppArmorProfile{
|
||||
Profile: Profile{
|
||||
Rules: []ApparmorRule{capability2, network1, mount2, signal1, signal2, ptrace1, unix2, dbus2, dbus1, file2, file1},
|
||||
Rules: []ApparmorRule{
|
||||
capability2, network1, mount2, signal1, signal2, ptrace1,
|
||||
unix2, dbus2, dbus1, file1, file2, includeLocal1,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user