Browse code

Fix TestMount under a selinux system

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Vincent Demeester authored on 2017/09/25 17:42:20
Showing 1 changed files
... ...
@@ -8,6 +8,8 @@ import (
8 8
 	"os"
9 9
 	"strings"
10 10
 	"testing"
11
+
12
+	selinux "github.com/opencontainers/selinux/go-selinux"
11 13
 )
12 14
 
13 15
 func TestMount(t *testing.T) {
... ...
@@ -101,7 +103,11 @@ func TestMount(t *testing.T) {
101 101
 				t.Fatal(err)
102 102
 			}
103 103
 			defer ensureUnmount(t, target)
104
-			validateMount(t, target, tc.expectedOpts, tc.expectedOptional, tc.expectedVFS)
104
+			expectedVFS := tc.expectedVFS
105
+			if selinux.GetEnabled() && expectedVFS != "" {
106
+				expectedVFS = expectedVFS + ",seclabel"
107
+			}
108
+			validateMount(t, target, tc.expectedOpts, tc.expectedOptional, expectedVFS)
105 109
 		})
106 110
 	}
107 111
 }