mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add integration test for volumes-from as file
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
parent
a57900e35f
commit
28015f8e57
1 changed files with 18 additions and 0 deletions
|
@ -253,3 +253,21 @@ func TestDockerRunWithoutNetworking(t *testing.T) {
|
||||||
logDone("run - disable networking with --networking=false")
|
logDone("run - disable networking with --networking=false")
|
||||||
logDone("run - disable networking with -n=false")
|
logDone("run - disable networking with -n=false")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Regression test for #4741
|
||||||
|
func TestDockerRunWithVolumesAsFiles(t *testing.T) {
|
||||||
|
runCmd := exec.Command(dockerBinary, "run", "--name", "test-data", "--volume", "/etc/hosts:/target-file", "busybox", "true")
|
||||||
|
out, stderr, exitCode, err := runCommandWithStdoutStderr(runCmd)
|
||||||
|
if err != nil && exitCode != 0 {
|
||||||
|
t.Fatal("1", out, stderr, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
runCmd = exec.Command(dockerBinary, "run", "--volumes-from", "test-data", "busybox", "cat", "/target-file")
|
||||||
|
out, stderr, exitCode, err = runCommandWithStdoutStderr(runCmd)
|
||||||
|
if err != nil && exitCode != 0 {
|
||||||
|
t.Fatal("2", out, stderr, err)
|
||||||
|
}
|
||||||
|
deleteAllContainers()
|
||||||
|
|
||||||
|
logDone("run - regression test for #4741 - volumes from as files")
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue