Browse Source

integration-cli: add test requirement ExecSupport

Skip tests based on remote daemon's exec support (to exclude
these tests from `make test` ran in LXC case). Makes use of
`test_no_exec` build tag passed by build scripts.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Ahmet Alp Balkan 10 years ago
parent
commit
102e061147

+ 2 - 2
integration-cli/docker_cli_links_test.go

@@ -231,7 +231,7 @@ func TestLinksNotStartedParentNotFail(t *testing.T) {
 }
 
 func TestLinksHostsFilesInject(t *testing.T) {
-	testRequires(t, SameHostDaemon)
+	testRequires(t, SameHostDaemon, ExecSupport)
 
 	defer deleteAllContainers()
 
@@ -285,7 +285,7 @@ func TestLinksNetworkHostContainer(t *testing.T) {
 }
 
 func TestLinksUpdateOnRestart(t *testing.T) {
-	testRequires(t, SameHostDaemon)
+	testRequires(t, SameHostDaemon, ExecSupport)
 
 	defer deleteAllContainers()
 

+ 4 - 0
integration-cli/requirements.go

@@ -21,6 +21,10 @@ var (
 		func() bool { return isUnixCli },
 		"Test requires posix utilities or functionality to run.",
 	}
+	ExecSupport = TestRequirement{
+		func() bool { return supportsExec },
+		"Test requires 'docker exec' capabilities on the tested daemon.",
+	}
 )
 
 // testRequires checks if the environment satisfies the requirements

+ 8 - 0
integration-cli/test_vars_exec.go

@@ -0,0 +1,8 @@
+// +build !test_no_exec
+
+package main
+
+const (
+	// indicates docker daemon tested supports 'docker exec'
+	supportsExec = true
+)

+ 8 - 0
integration-cli/test_vars_noexec.go

@@ -0,0 +1,8 @@
+// +build test_no_exec
+
+package main
+
+const (
+	// indicates docker daemon tested supports 'docker exec'
+	supportsExec = false
+)