Skip to content

Commit

Permalink
selinux/mustrunas_test.go(TestMustRunAsValidate): rename a member to …
Browse files Browse the repository at this point in the history
…make its meaning obvious.
  • Loading branch information
php-coder committed Jan 24, 2018
1 parent 2e55ffb commit 3f26153
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/security/podsecuritypolicy/selinux/mustrunas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,31 +100,31 @@ func TestMustRunAsValidate(t *testing.T) {
seType.Type = "invalid"

tests := map[string]struct {
seLinux *api.SELinuxOptions
podSeLinux *api.SELinuxOptions
expectedMsg string
}{
"invalid role": {
seLinux: role,
podSeLinux: role,
expectedMsg: "role: Invalid value",
},
"invalid user": {
seLinux: user,
podSeLinux: user,
expectedMsg: "user: Invalid value",
},
"invalid level": {
seLinux: level,
podSeLinux: level,
expectedMsg: "level: Invalid value",
},
"invalid type": {
seLinux: seType,
podSeLinux: seType,
expectedMsg: "type: Invalid value",
},
"valid": {
seLinux: newValidOpts(),
podSeLinux: newValidOpts(),
expectedMsg: "",
},
"valid with different order of categories": {
seLinux: newValidOptsWithLevel("s0:c6,c0"),
podSeLinux: newValidOptsWithLevel("s0:c6,c0"),
expectedMsg: "",
},
}
Expand All @@ -140,7 +140,7 @@ func TestMustRunAsValidate(t *testing.T) {
continue
}

errs := mustRunAs.Validate(nil, nil, nil, tc.seLinux)
errs := mustRunAs.Validate(nil, nil, nil, tc.podSeLinux)
//should've passed but didn't
if len(tc.expectedMsg) == 0 && len(errs) > 0 {
t.Errorf("%s expected no errors but received %v", name, errs)
Expand Down

0 comments on commit 3f26153

Please sign in to comment.