summaryrefslogtreecommitdiffhomepage
path: root/runsc/test/root/chroot_test.go
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2019-01-22 16:45:45 -0800
committerShentubot <shentubot@google.com>2019-01-22 16:46:42 -0800
commit5f08f8fd8162fa2fc2ca7b862263081d8d07b206 (patch)
treedf94de296220411b976f5730f71f6495ea1dc650 /runsc/test/root/chroot_test.go
parentceb3dcfb72fe050bb0d90a7285cd1b56d1b4dfeb (diff)
Don't bind-mount runsc into a sandbox mntns
PiperOrigin-RevId: 230437407 Change-Id: Id9d8ceeb018aad2fe317407c78c6ee0f4b47aa2b
Diffstat (limited to 'runsc/test/root/chroot_test.go')
-rw-r--r--runsc/test/root/chroot_test.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/runsc/test/root/chroot_test.go b/runsc/test/root/chroot_test.go
index 04124703d..89f90c3e0 100644
--- a/runsc/test/root/chroot_test.go
+++ b/runsc/test/root/chroot_test.go
@@ -26,8 +26,6 @@ import (
"os"
"os/exec"
"path/filepath"
- "reflect"
- "sort"
"strconv"
"strings"
"testing"
@@ -73,16 +71,13 @@ func TestChroot(t *testing.T) {
if err != nil {
t.Fatalf("error listing %q: %v", chroot, err)
}
- if want, got := 2, len(fi); want != got {
+ if want, got := 1, len(fi); want != got {
t.Fatalf("chroot dir got %d entries, want %d", got, want)
}
- // chroot dir is prepared by runsc and should contains only the executable
- // and /proc.
- files := []string{fi[0].Name(), fi[1].Name()}
- sort.Strings(files)
- if want := []string{"proc", "runsc"}; !reflect.DeepEqual(files, want) {
- t.Errorf("chroot got children %v, want %v", files, want)
+ // chroot dir is prepared by runsc and should contains only /proc.
+ if fi[0].Name() != "proc" {
+ t.Errorf("chroot got children %v, want %v", fi[0].Name(), "proc")
}
d.CleanUp()