Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit 5bfa5e4

Browse files
authored
Merge pull request #528 from cpuguy83/skip_selinux_test
Minor cleanup on selinux test
2 parents f6437b4 + 2a07847 commit 5bfa5e4

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pkg/server/helpers_selinux_test.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828

2929
func TestInitSelinuxOpts(t *testing.T) {
3030
if !selinux.GetEnabled() {
31-
return
31+
t.Skip("selinux is not enabled")
3232
}
3333

3434
for desc, test := range map[string]struct {
@@ -62,10 +62,11 @@ func TestInitSelinuxOpts(t *testing.T) {
6262
mountLabels: []string{"user_u:object_r:container_file_t:s0:c1,c2", "user_u:object_r:svirt_sandbox_file_t:s0:c1,c2"},
6363
},
6464
} {
65-
t.Logf("TestCase %q", desc)
66-
processLabel, mountLabel, err := initSelinuxOpts(test.selinuxOpt)
67-
assert.NoError(t, err)
68-
assert.Equal(t, test.processLabel, processLabel)
69-
assert.Contains(t, test.mountLabels, mountLabel)
65+
t.Run(desc, func(t *testing.T) {
66+
processLabel, mountLabel, err := initSelinuxOpts(test.selinuxOpt)
67+
assert.NoError(t, err)
68+
assert.Equal(t, test.processLabel, processLabel)
69+
assert.Contains(t, test.mountLabels, mountLabel)
70+
})
7071
}
7172
}

0 commit comments

Comments
 (0)