Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 38aaf06

Browse files
committed
add tests for single volume multiple mount case
Signed-off-by: Peng Tao <bergwolf@gmail.com>
1 parent 5dafce6 commit 38aaf06

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package main
2+
3+
import (
4+
"time"
5+
6+
"github.com/docker/docker/pkg/integration/checker"
7+
"github.com/go-check/check"
8+
)
9+
10+
func (s *DockerSuite) TestMultiMountImplicitVolume(c *check.C) {
11+
printTestCaseName()
12+
defer printTestDuration(time.Now())
13+
volName := "testvolume"
14+
_, err := dockerCmd(c, "run", "-d", "--name=voltest", "-v", volName+":/data1", "-v", volName+":/vol/data", "busybox")
15+
c.Assert(err, checker.Equals, 0)
16+
dockerCmd(c, "rm", "-fv", "voltest")
17+
}
18+
19+
func (s *DockerSuite) TestMultiMountNamedVolume(c *check.C) {
20+
printTestCaseName()
21+
defer printTestDuration(time.Now())
22+
volName := "testvolume"
23+
_, err := dockerCmd(c, "volume", "create", "--name", volName)
24+
c.Assert(err, checker.Equals, 0)
25+
_, err = dockerCmd(c, "run", "-d", "--name=voltest", "-v", volName+":/data1", "-v", volName+":/vol/data", "busybox")
26+
c.Assert(err, checker.Equals, 0)
27+
dockerCmd(c, "rm", "-fv", "voltest")
28+
}

0 commit comments

Comments
 (0)