Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
09333b3a
Commit
09333b3a
authored
Jan 24, 2018
by
Slava Semushin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
selinux/mustrunas_test.go(TestMustRunAsValidate): add more test cases to improve code coverage.
parent
26fb4ed5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
mustrunas_test.go
pkg/security/podsecuritypolicy/selinux/mustrunas_test.go
+12
-10
No files found.
pkg/security/podsecuritypolicy/selinux/mustrunas_test.go
View file @
09333b3a
...
...
@@ -93,9 +93,6 @@ func TestMustRunAsValidate(t *testing.T) {
user
:=
newValidOpts
()
user
.
User
=
"invalid"
level
:=
newValidOpts
()
level
.
Level
=
"invalid"
seType
:=
newValidOpts
()
seType
.
Type
=
"invalid"
...
...
@@ -116,15 +113,20 @@ func TestMustRunAsValidate(t *testing.T) {
pspSeLinux
:
validOpts
,
expectedMsg
:
"user: Invalid value"
,
},
"
invalid leve
l"
:
{
podSeLinux
:
level
,
pspSeLinux
:
validOpts
,
"
levels are not equa
l"
:
{
podSeLinux
:
newValidOptsWithLevel
(
"s0"
)
,
pspSeLinux
:
newValidOptsWithLevel
(
"s0:c1,c2"
)
,
expectedMsg
:
"level: Invalid value"
,
},
"invalid type"
:
{
podSeLinux
:
seType
,
pspSeLinux
:
validOpts
,
expectedMsg
:
"type: Invalid value"
,
"levels differ by sensitivity"
:
{
podSeLinux
:
newValidOptsWithLevel
(
"s0:c6"
),
pspSeLinux
:
newValidOptsWithLevel
(
"s1:c6"
),
expectedMsg
:
"level: Invalid value"
,
},
"levels differ by categories"
:
{
podSeLinux
:
newValidOptsWithLevel
(
"s0:c0,c8"
),
pspSeLinux
:
newValidOptsWithLevel
(
"s0:c1,c7"
),
expectedMsg
:
"level: Invalid value"
,
},
"valid"
:
{
podSeLinux
:
validOpts
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment