1
0
mirror of https://github.com/moby/moby.git synced 2025-07-30 18:23:29 +03:00

Refactor and extract TestRequire functionality

This will help when extracting suites in their own package.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester
2016-12-16 15:13:23 +01:00
parent ba1c20f8d6
commit 930a9869f6
10 changed files with 402 additions and 453 deletions

View File

@ -1665,7 +1665,7 @@ func (s *DockerSuite) TestContainersAPICreateMountsValidation(c *check.C) {
},
}
if SameHostDaemon.Condition() {
if SameHostDaemon() {
tmpDir, err := ioutils.TempDir("", "test-mounts-api")
c.Assert(err, checker.IsNil)
defer os.RemoveAll(tmpDir)
@ -1696,7 +1696,7 @@ func (s *DockerSuite) TestContainersAPICreateMountsValidation(c *check.C) {
}...)
}
if DaemonIsLinux.Condition() {
if DaemonIsLinux() {
cases = append(cases, []testCase{
{
config: cfg{
@ -1823,7 +1823,7 @@ func (s *DockerSuite) TestContainersAPICreateMountsCreate(c *check.C) {
{mounttypes.Mount{Type: "volume", Target: destPath, Source: "test3", VolumeOptions: &mounttypes.VolumeOptions{DriverConfig: &mounttypes.Driver{Name: volume.DefaultDriverName}}}, types.MountPoint{Driver: volume.DefaultDriverName, Type: "volume", Name: "test3", RW: true, Destination: destPath}},
}
if SameHostDaemon.Condition() {
if SameHostDaemon() {
// setup temp dir for testing binds
tmpDir1, err := ioutil.TempDir("", "test-mounts-api-1")
c.Assert(err, checker.IsNil)
@ -1834,7 +1834,7 @@ func (s *DockerSuite) TestContainersAPICreateMountsCreate(c *check.C) {
}...)
// for modes only supported on Linux
if DaemonIsLinux.Condition() {
if DaemonIsLinux() {
tmpDir3, err := ioutils.TempDir("", "test-mounts-api-3")
c.Assert(err, checker.IsNil)
defer os.RemoveAll(tmpDir3)