Merge pull request #528 from cpuguy83/skip_selinux_test
Minor cleanup on selinux test
This commit is contained in:
commit
5bfa5e451a
@ -28,7 +28,7 @@ import (
|
|||||||
|
|
||||||
func TestInitSelinuxOpts(t *testing.T) {
|
func TestInitSelinuxOpts(t *testing.T) {
|
||||||
if !selinux.GetEnabled() {
|
if !selinux.GetEnabled() {
|
||||||
return
|
t.Skip("selinux is not enabled")
|
||||||
}
|
}
|
||||||
|
|
||||||
for desc, test := range map[string]struct {
|
for desc, test := range map[string]struct {
|
||||||
@ -62,10 +62,11 @@ func TestInitSelinuxOpts(t *testing.T) {
|
|||||||
mountLabels: []string{"user_u:object_r:container_file_t:s0:c1,c2", "user_u:object_r:svirt_sandbox_file_t:s0:c1,c2"},
|
mountLabels: []string{"user_u:object_r:container_file_t:s0:c1,c2", "user_u:object_r:svirt_sandbox_file_t:s0:c1,c2"},
|
||||||
},
|
},
|
||||||
} {
|
} {
|
||||||
t.Logf("TestCase %q", desc)
|
t.Run(desc, func(t *testing.T) {
|
||||||
processLabel, mountLabel, err := initSelinuxOpts(test.selinuxOpt)
|
processLabel, mountLabel, err := initSelinuxOpts(test.selinuxOpt)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Equal(t, test.processLabel, processLabel)
|
assert.Equal(t, test.processLabel, processLabel)
|
||||||
assert.Contains(t, test.mountLabels, mountLabel)
|
assert.Contains(t, test.mountLabels, mountLabel)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user