Browse code

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 authored on 2015/02/21 16:24:30
Showing 4 changed files
... ...
@@ -231,7 +231,7 @@ func TestLinksNotStartedParentNotFail(t *testing.T) {
231 231
 }
232 232
 
233 233
 func TestLinksHostsFilesInject(t *testing.T) {
234
-	testRequires(t, SameHostDaemon)
234
+	testRequires(t, SameHostDaemon, ExecSupport)
235 235
 
236 236
 	defer deleteAllContainers()
237 237
 
... ...
@@ -285,7 +285,7 @@ func TestLinksNetworkHostContainer(t *testing.T) {
285 285
 }
286 286
 
287 287
 func TestLinksUpdateOnRestart(t *testing.T) {
288
-	testRequires(t, SameHostDaemon)
288
+	testRequires(t, SameHostDaemon, ExecSupport)
289 289
 
290 290
 	defer deleteAllContainers()
291 291
 
... ...
@@ -21,6 +21,10 @@ var (
21 21
 		func() bool { return isUnixCli },
22 22
 		"Test requires posix utilities or functionality to run.",
23 23
 	}
24
+	ExecSupport = TestRequirement{
25
+		func() bool { return supportsExec },
26
+		"Test requires 'docker exec' capabilities on the tested daemon.",
27
+	}
24 28
 )
25 29
 
26 30
 // testRequires checks if the environment satisfies the requirements
27 31
new file mode 100644
... ...
@@ -0,0 +1,8 @@
0
+// +build !test_no_exec
1
+
2
+package main
3
+
4
+const (
5
+	// indicates docker daemon tested supports 'docker exec'
6
+	supportsExec = true
7
+)
0 8
new file mode 100644
... ...
@@ -0,0 +1,8 @@
0
+// +build test_no_exec
1
+
2
+package main
3
+
4
+const (
5
+	// indicates docker daemon tested supports 'docker exec'
6
+	supportsExec = false
7
+)