-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
- Loading branch information
Showing
15 changed files
with
503 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
vendor/src/github.com/docker/libcontainer/label/label_selinux_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// +build selinux,linux | ||
|
||
package label | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/docker/libcontainer/selinux" | ||
) | ||
|
||
func TestInit(t *testing.T) { | ||
if selinux.SelinuxEnabled() { | ||
var testNull []string | ||
plabel, mlabel, err := InitLabels(testNull) | ||
if err != nil { | ||
t.Log("InitLabels Failed") | ||
t.Fatal(err) | ||
} | ||
testDisabled := []string{"disable"} | ||
plabel, mlabel, err = InitLabels(testDisabled) | ||
if err != nil { | ||
t.Log("InitLabels Disabled Failed") | ||
t.Fatal(err) | ||
} | ||
if plabel != "" { | ||
t.Log("InitLabels Disabled Failed") | ||
t.Fatal() | ||
} | ||
testUser := []string{"user:user_u", "role:user_r", "type:user_t", "level:s0:c1,c15"} | ||
plabel, mlabel, err = InitLabels(testUser) | ||
if err != nil { | ||
t.Log("InitLabels User Failed") | ||
t.Fatal(err) | ||
} | ||
if plabel != "user_u:user_r:user_t:s0:c1,c15" || mlabel != "user_u:object_r:svirt_sandbox_file_t:s0:c1,c15" { | ||
t.Log("InitLabels User Failed") | ||
t.Log(plabel, mlabel) | ||
t.Fatal(err) | ||
} | ||
|
||
testBadData := []string{"user", "role:user_r", "type:user_t", "level:s0:c1,c15"} | ||
plabel, mlabel, err = InitLabels(testBadData) | ||
if err == nil { | ||
t.Log("InitLabels Bad Failed") | ||
t.Fatal(err) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// +build linux,cgo | ||
// +build cgo | ||
|
||
package system | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
vendor/src/github.com/docker/libcontainer/system/sysconfig_notcgo.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// +build linux,!cgo | ||
// +build !cgo | ||
|
||
package system | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Tianon Gravi <admwiggin@gmail.com> (@tianon) |
Oops, something went wrong.