chore: cleanup test data.

This commit is contained in:
Alexandre Pujol 2023-09-29 20:10:38 +01:00
parent c7485326e8
commit d810acd58f
Failed to generate hash of commit
2 changed files with 26 additions and 54 deletions

View file

@ -15,14 +15,8 @@ var (
"profile": "pkexec", "profile": "pkexec",
"comm": "pkexec", "comm": "pkexec",
} }
capability1 = &Capability{ capability1 = &Capability{Name: "net_admin"}
Qualifier: Qualifier{}, capability2 = &Capability{Name: "sys_ptrace"}
Name: "net_admin",
}
capability2 = &Capability{
Qualifier: Qualifier{},
Name: "sys_ptrace",
}
// Network // Network
network1Log = map[string]string{ network1Log = map[string]string{
@ -38,18 +32,13 @@ var (
"comm": "sddm-greeter", "comm": "sddm-greeter",
} }
network1 = &Network{ network1 = &Network{
Qualifier: Qualifier{}, Domain: "netlink",
Domain: "netlink", Type: "raw",
Type: "raw", Protocol: "15",
Protocol: "15",
AddressExpr: AddressExpr{},
} }
network2 = &Network{ network2 = &Network{
Qualifier: Qualifier{}, Domain: "inet",
Domain: "inet", Type: "dgram",
Type: "dgram",
Protocol: "",
AddressExpr: AddressExpr{},
} }
// Mount // Mount
@ -69,7 +58,7 @@ var (
"apparmor": "ALLOWED", "apparmor": "ALLOWED",
"class": "mount", "class": "mount",
"operation": "mount", "operation": "mount",
"info": "failed perms check", "info": "failed perms check", // TODO: not attach_disconnected
"error": "-13", "error": "-13",
"profile": "dockerd", "profile": "dockerd",
"name": "/var/lib/docker/overlay2/metacopy-check906831159/merged/", "name": "/var/lib/docker/overlay2/metacopy-check906831159/merged/",
@ -78,26 +67,14 @@ var (
"srcname": "overlay", "srcname": "overlay",
} }
mount1 = &Mount{ mount1 = &Mount{
Qualifier: Qualifier{}, MountConditions: MountConditions{FsType: "overlay", Options: []string{}},
MountConditions: MountConditions{ Source: "overlay",
Fs: "", MountPoint: "/var/lib/docker/overlay2/opaque-bug-check1209538631/merged/",
Op: "",
FsType: "overlay",
Options: []string{},
},
Source: "overlay",
MountPoint: "/var/lib/docker/overlay2/opaque-bug-check1209538631/merged/",
} }
mount2 = &Mount{ mount2 = &Mount{
Qualifier: Qualifier{}, MountConditions: MountConditions{FsType: "overlay", Options: []string{}},
MountConditions: MountConditions{ Source: "overlay",
Fs: "", MountPoint: "/var/lib/docker/overlay2/metacopy-check906831159/merged/",
Op: "",
FsType: "overlay",
Options: []string{},
},
Source: "overlay",
MountPoint: "/var/lib/docker/overlay2/metacopy-check906831159/merged/",
} }
// Signal // Signal
@ -113,16 +90,14 @@ var (
"peer": "firefox//&firejail-default", "peer": "firefox//&firejail-default",
} }
signal1 = &Signal{ signal1 = &Signal{
Qualifier: Qualifier{}, Access: "receive",
Access: "receive", Set: "kill",
Set: "kill", Peer: "firefox//&firejail-default",
Peer: "firefox//&firejail-default",
} }
signal2 = &Signal{ signal2 = &Signal{
Qualifier: Qualifier{}, Access: "receive",
Access: "receive", Set: "up",
Set: "up", Peer: "firefox//&firejail-default",
Peer: "firefox//&firejail-default",
} }
// Ptrace // Ptrace

View file

@ -53,9 +53,8 @@ func TestAppArmorProfile_String(t *testing.T) {
}, },
Includes: []Include{ Includes: []Include{
{ {
IfExists: false, IsMagic: true,
IsMagic: true, Path: "tunables/global",
Path: "tunables/global",
}, },
}, },
Aliases: []Alias{ Aliases: []Alias{
@ -78,14 +77,12 @@ func TestAppArmorProfile_String(t *testing.T) {
Flags: []string{"complain", "attach_disconnected"}, Flags: []string{"complain", "attach_disconnected"},
Rules: []ApparmorRule{ Rules: []ApparmorRule{
&Include{ &Include{
IfExists: false, IsMagic: true,
IsMagic: true, Path: "abstractions/base",
Path: "abstractions/base",
}, },
&Include{ &Include{
IfExists: false, IsMagic: true,
IsMagic: true, Path: "abstractions/nameservice-strict",
Path: "abstractions/nameservice-strict",
}, },
&Rlimit{ &Rlimit{
Key: "nproc", Key: "nproc",