summaryrefslogtreecommitdiffhomepage
path: root/runsc/container
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-04-29 13:13:51 -0700
committergVisor bot <gvisor-bot@google.com>2020-04-29 13:13:51 -0700
commitd5c34ba2ffef0b0aee38d4f96f06bc00b04b0a53 (patch)
tree8dd5bb4876c81d7f0ce44eb1e1c3e35b7ceec1b9 /runsc/container
parentce19497c1c0829af6ba56f0cc68e3a4cb33cf1c8 (diff)
parentfc53d6436776d5de052075e98f44417f04ced7e7 (diff)
Merge pull request #2487 from moricho:fix/bindmount
PiperOrigin-RevId: 309082540
Diffstat (limited to 'runsc/container')
-rw-r--r--runsc/container/container_test.go22
-rw-r--r--runsc/container/multi_container_test.go2
2 files changed, 23 insertions, 1 deletions
diff --git a/runsc/container/container_test.go b/runsc/container/container_test.go
index a1d4d3b7e..f607fe8af 100644
--- a/runsc/container/container_test.go
+++ b/runsc/container/container_test.go
@@ -1535,6 +1535,28 @@ func TestReadonlyMount(t *testing.T) {
}
}
+func TestBindMountByOption(t *testing.T) {
+ for _, conf := range configs(t, overlay) {
+ t.Logf("Running test with conf: %+v", conf)
+
+ dir, err := ioutil.TempDir(testutil.TmpDir(), "bind-mount")
+ spec := testutil.NewSpecWithArgs("/bin/touch", path.Join(dir, "file"))
+ if err != nil {
+ t.Fatalf("ioutil.TempDir() failed: %v", err)
+ }
+ spec.Mounts = append(spec.Mounts, specs.Mount{
+ Destination: dir,
+ Source: dir,
+ Type: "none",
+ Options: []string{"rw", "bind"},
+ })
+
+ if err := run(spec, conf); err != nil {
+ t.Fatalf("error running sandbox: %v", err)
+ }
+ }
+}
+
// TestAbbreviatedIDs checks that runsc supports using abbreviated container
// IDs in place of full IDs.
func TestAbbreviatedIDs(t *testing.T) {
diff --git a/runsc/container/multi_container_test.go b/runsc/container/multi_container_test.go
index e3704b453..f6861b1dd 100644
--- a/runsc/container/multi_container_test.go
+++ b/runsc/container/multi_container_test.go
@@ -1394,7 +1394,7 @@ func TestMultiContainerSharedMountUnsupportedOptions(t *testing.T) {
Destination: "/mydir/test",
Source: "/some/dir",
Type: "tmpfs",
- Options: []string{"rw", "rbind", "relatime"},
+ Options: []string{"rw", "relatime"},
}
podSpec[0].Mounts = append(podSpec[0].Mounts, mnt0)