Browse code

integcli: add test to ensure -v /:/ isn't allowed

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)

unclejack authored on 2014/06/28 01:51:24
Showing 1 changed files
... ...
@@ -971,3 +971,15 @@ func TestAllowBindMountingRoot(t *testing.T) {
971 971
 
972 972
 	logDone("run - bind mount / as volume")
973 973
 }
974
+
975
+func TestDisallowBindMountingRootToRoot(t *testing.T) {
976
+	cmd := exec.Command(dockerBinary, "run", "-v", "/:/", "busybox", "ls", "/host")
977
+	out, _, err := runCommandWithOutput(cmd)
978
+	if err == nil {
979
+		t.Fatal(out, err)
980
+	}
981
+
982
+	deleteAllContainers()
983
+
984
+	logDone("run - bind mount /:/ as volume should fail")
985
+}