forked from barak/tarpoon
Add glide.yaml and vendor deps
This commit is contained in:
parent
db918f12ad
commit
5b3d5e81bd
18880 changed files with 5166045 additions and 1 deletions
93
vendor/github.com/opencontainers/runc/libcontainer/rootfs_linux_test.go
generated
vendored
Normal file
93
vendor/github.com/opencontainers/runc/libcontainer/rootfs_linux_test.go
generated
vendored
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
// +build linux
|
||||
|
||||
package libcontainer
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/opencontainers/runc/libcontainer/configs"
|
||||
)
|
||||
|
||||
func TestCheckMountDestOnProc(t *testing.T) {
|
||||
dest := "/rootfs/proc/"
|
||||
err := checkMountDestination("/rootfs", dest)
|
||||
if err == nil {
|
||||
t.Fatal("destination inside proc should return an error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCheckMountDestInSys(t *testing.T) {
|
||||
dest := "/rootfs//sys/fs/cgroup"
|
||||
err := checkMountDestination("/rootfs", dest)
|
||||
if err != nil {
|
||||
t.Fatal("destination inside /sys should not return an error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCheckMountDestFalsePositive(t *testing.T) {
|
||||
dest := "/rootfs/sysfiles/fs/cgroup"
|
||||
err := checkMountDestination("/rootfs", dest)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNeedsSetupDev(t *testing.T) {
|
||||
config := &configs.Config{
|
||||
Mounts: []*configs.Mount{
|
||||
{
|
||||
Device: "bind",
|
||||
Source: "/dev",
|
||||
Destination: "/dev",
|
||||
},
|
||||
},
|
||||
}
|
||||
if needsSetupDev(config) {
|
||||
t.Fatal("expected needsSetupDev to be false, got true")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNeedsSetupDevStrangeSource(t *testing.T) {
|
||||
config := &configs.Config{
|
||||
Mounts: []*configs.Mount{
|
||||
{
|
||||
Device: "bind",
|
||||
Source: "/devx",
|
||||
Destination: "/dev",
|
||||
},
|
||||
},
|
||||
}
|
||||
if needsSetupDev(config) {
|
||||
t.Fatal("expected needsSetupDev to be false, got true")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNeedsSetupDevStrangeDest(t *testing.T) {
|
||||
config := &configs.Config{
|
||||
Mounts: []*configs.Mount{
|
||||
{
|
||||
Device: "bind",
|
||||
Source: "/dev",
|
||||
Destination: "/devx",
|
||||
},
|
||||
},
|
||||
}
|
||||
if !needsSetupDev(config) {
|
||||
t.Fatal("expected needsSetupDev to be true, got false")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNeedsSetupDevStrangeSourceDest(t *testing.T) {
|
||||
config := &configs.Config{
|
||||
Mounts: []*configs.Mount{
|
||||
{
|
||||
Device: "bind",
|
||||
Source: "/devx",
|
||||
Destination: "/devx",
|
||||
},
|
||||
},
|
||||
}
|
||||
if !needsSetupDev(config) {
|
||||
t.Fatal("expected needsSetupDev to be true, got false")
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue