c6b2c2f6b0
Someone probably got really used to typing er on the end of contain :) Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
35 lines
678 B
Go
35 lines
678 B
Go
package libcontainer
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestNamespacesContains(t *testing.T) {
|
|
ns := Namespaces{
|
|
GetNamespace("NEWPID"),
|
|
GetNamespace("NEWNS"),
|
|
GetNamespace("NEWUTS"),
|
|
}
|
|
|
|
if ns.Contains("NEWNET") {
|
|
t.Fatal("namespaces should not contain NEWNET")
|
|
}
|
|
|
|
if !ns.Contains("NEWPID") {
|
|
t.Fatal("namespaces should contain NEWPID but does not")
|
|
}
|
|
}
|
|
|
|
func TestCapabilitiesContains(t *testing.T) {
|
|
caps := Capabilities{
|
|
GetCapability("MKNOD"),
|
|
GetCapability("SETPCAP"),
|
|
}
|
|
|
|
if caps.Contains("SYS_ADMIN") {
|
|
t.Fatal("capabilities should not contain SYS_ADMIN")
|
|
}
|
|
if !caps.Contains("MKNOD") {
|
|
t.Fatal("capabilities should contain MKNOD but does not")
|
|
}
|
|
}
|