summaryrefslogtreecommitdiffhomepage
path: root/runsc/container/container_test.go
diff options
context:
space:
mode:
authormoricho <ikeda.morito@gmail.com>2020-04-22 15:04:18 +0900
committermoricho <ikeda.morito@gmail.com>2020-04-26 17:24:34 +0900
commitfc53d6436776d5de052075e98f44417f04ced7e7 (patch)
treef4f0c237595b0a6d9745cf6870abc4fb2917b92f /runsc/container/container_test.go
parent0b3166f6243472fbb72cc749c57d3a59aa481979 (diff)
refactor and add test for bindmount
Signed-off-by: moricho <ikeda.morito@gmail.com>
Diffstat (limited to 'runsc/container/container_test.go')
-rw-r--r--runsc/container/container_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/runsc/container/container_test.go b/runsc/container/container_test.go
index 3ff89f38c..c963c2153 100644
--- a/runsc/container/container_test.go
+++ b/runsc/container/container_test.go
@@ -1523,6 +1523,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) {