Update runc and specs vendor deps
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
52a1dfb418
commit
2db0341e38
361 changed files with 47493 additions and 369 deletions
39
vendor/src/github.com/opencontainers/runc/spec_test.go
vendored
Normal file
39
vendor/src/github.com/opencontainers/runc/spec_test.go
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
// build +linux
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/opencontainers/specs/specs-go"
|
||||
)
|
||||
|
||||
func TestLinuxCgroupsPathSpecified(t *testing.T) {
|
||||
cgroupsPath := "/user/cgroups/path/id"
|
||||
|
||||
spec := &specs.Spec{}
|
||||
spec.Linux.CgroupsPath = &cgroupsPath
|
||||
|
||||
cgroup, err := createCgroupConfig("ContainerID", spec)
|
||||
if err != nil {
|
||||
t.Errorf("Couldn't create Cgroup config: %v", err)
|
||||
}
|
||||
|
||||
if cgroup.Path != cgroupsPath {
|
||||
t.Errorf("Wrong cgroupsPath, expected '%s' got '%s'", cgroupsPath, cgroup.Path)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLinuxCgroupsPathNotSpecified(t *testing.T) {
|
||||
spec := &specs.Spec{}
|
||||
|
||||
cgroup, err := createCgroupConfig("ContainerID", spec)
|
||||
if err != nil {
|
||||
t.Errorf("Couldn't create Cgroup config: %v", err)
|
||||
}
|
||||
|
||||
if !strings.HasSuffix(cgroup.Path, "/ContainerID") {
|
||||
t.Errorf("Wrong cgroupsPath, expected it to have suffix '%s' got '%s'", "/ContainerID", cgroup.Path)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue