Windows: Workaround for CI

Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
John Howard
2015-08-05 11:20:30 -07:00
parent 6206cbe193
commit ac120567e8
7 changed files with 53 additions and 36 deletions
@@ -1,4 +1,4 @@
// +build daemon,experimental
// +build daemon,experimental,!windows
package main
@@ -22,6 +22,7 @@ func assertNetwork(c *check.C, d *Daemon, name string) {
}
func (s *DockerDaemonSuite) TestDaemonDefaultNetwork(c *check.C) {
testRequires(c, SameHostDaemon)
d := s.d
networkName := "testdefault"
+1 -1
View File
@@ -1,4 +1,4 @@
// +build daemon
// +build daemon,!windows
package main
+26
View File
@@ -24,6 +24,10 @@ var (
execDriverPath = runtimePath + "/execdriver/native"
workingDirectory string
// isLocalDaemon is true if the daemon under test is on the same
// host as the CLI.
isLocalDaemon bool
)
func init() {
@@ -43,4 +47,26 @@ func init() {
privateRegistryURL = registry
}
workingDirectory, _ = os.Getwd()
// Deterministically working out the environment in which CI is running
// to evaluate whether the daemon is local or remote is not possible through
// a build tag.
//
// For example Windows CI under Jenkins test the 64-bit
// Windows binary build with the daemon build tag, but calls a remote
// Linux daemon.
//
// We can't just say if Windows then assume the daemon is local as at
// some point, we will be testing the Windows CLI against a Windows daemon.
//
// Similarly, it will be perfectly valid to also run CLI tests from
// a Linux CLI (built with the daemon tag) against a Windows daemon.
if len(os.Getenv("DOCKER_REMOTE_DAEMON")) > 0 {
fmt.Println("INFO: Testing against a remote daemon")
isLocalDaemon = false
} else {
fmt.Println("INFO: Testing against a local daemon")
isLocalDaemon = true
}
}
-8
View File
@@ -1,8 +0,0 @@
// +build !daemon
package main
const (
// tests should not assume daemon runs on the same machine as CLI
isLocalDaemon = false
)
@@ -1,8 +0,0 @@
// +build daemon
package main
const (
// tests can assume daemon runs on the same machine as CLI
isLocalDaemon = true
)