소스 검색

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 년 전
부모
커밋
102e061147
4개의 변경된 파일22개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      integration-cli/docker_cli_links_test.go
  2. 4 0
      integration-cli/requirements.go
  3. 8 0
      integration-cli/test_vars_exec.go
  4. 8 0
      integration-cli/test_vars_noexec.go

+ 2 - 2
integration-cli/docker_cli_links_test.go

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

+ 4 - 0
integration-cli/requirements.go

@@ -21,6 +21,10 @@ var (
 		func() bool { return isUnixCli },
 		func() bool { return isUnixCli },
 		"Test requires posix utilities or functionality to run.",
 		"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
 // 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
+)