Add test for commiting container with bind mount

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: d31c37fceb6c09a48b5dd9d6c33a95d734e02704
Component: engine
This commit is contained in:
Michael Crosby
2014-05-19 22:57:29 +00:00
parent 2c620b9486
commit 446a0e28d3

View File

@ -83,3 +83,28 @@ func TestCommitTTY(t *testing.T) {
t.Fatal(err)
}
}
func TestCommitWithHostBindMount(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--name", "bind-commit", "-v", "/dev/null:/winning", "busybox", "true")
if _, err := runCommand(cmd); err != nil {
t.Fatal(err)
}
cmd = exec.Command(dockerBinary, "commit", "bind-commit", "bindtest")
imageId, _, err := runCommandWithOutput(cmd)
if err != nil {
t.Fatal(err)
}
imageId = strings.Trim(imageId, "\r\n")
cmd = exec.Command(dockerBinary, "run", "bindtest", "true")
if _, err := runCommand(cmd); err != nil {
t.Fatal(err)
}
deleteAllContainers()
deleteImages(imageId)
logDone("commit - commit bind mounted file")
}