Skip to content

Commit

Permalink
admission_test.go(TestAdmitSuccess): remove hardcoded SELinux level.
Browse files Browse the repository at this point in the history
  • Loading branch information
php-coder committed Nov 16, 2017
1 parent 0016ceb commit 268aea6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/security/admission/admission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,13 @@ func testSCCAdmit(testCaseName string, sccs []*securityapi.SecurityContextConstr
}

func TestAdmitSuccess(t *testing.T) {
tc := setupClientSet()
// create the annotated namespace and add it to the fake client
namespace := admissiontesting.CreateNamespaceForTest()

serviceAccount := admissiontesting.CreateSAForTest()
serviceAccount.Namespace = namespace.Name

tc := clientsetfake.NewSimpleClientset(namespace, serviceAccount)

// used for cases where things are preallocated
defaultGroup := int64(2)
Expand Down Expand Up @@ -223,8 +229,7 @@ func TestAdmitSuccess(t *testing.T) {
Level: "s0:c1,c0",
}

// level matches a value from namespace (see CreateNamespaceForTest())
seLinuxLevelFromNamespace := "s0:c1,c0"
seLinuxLevelFromNamespace := namespace.Annotations[allocator.MCSAnnotation]

testCases := map[string]struct {
pod *kapi.Pod
Expand Down

0 comments on commit 268aea6

Please sign in to comment.