Some pull/push tests are launching `registry-v2`
binary which is compiled and installed if the tests
are running in-container through `make test-integration-cli`.
However, registry is not supported to run on non-linux
platforms and we can't really spin up any registry-v2
containers in the remote DOCKER_TEST_HOST at this point.
Just skipping those with the new TestRequirement called
`RegistryHosting`.
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
| ... | ... |
@@ -1,6 +1,8 @@ |
| 1 | 1 |
package main |
| 2 | 2 |
|
| 3 | 3 |
import ( |
| 4 |
+ "fmt" |
|
| 5 |
+ "os/exec" |
|
| 4 | 6 |
"testing" |
| 5 | 7 |
) |
| 6 | 8 |
|
| ... | ... |
@@ -25,6 +27,16 @@ var ( |
| 25 | 25 |
func() bool { return supportsExec },
|
| 26 | 26 |
"Test requires 'docker exec' capabilities on the tested daemon.", |
| 27 | 27 |
} |
| 28 |
+ RegistryHosting = TestRequirement{
|
|
| 29 |
+ func() bool {
|
|
| 30 |
+ // for now registry binary is built only if we're running inside |
|
| 31 |
+ // container through `make test`. Figure that out by testing if |
|
| 32 |
+ // registry binary is in PATH. |
|
| 33 |
+ _, err := exec.LookPath(v2binary) |
|
| 34 |
+ return err == nil |
|
| 35 |
+ }, |
|
| 36 |
+ fmt.Sprintf("Test requires an environment that can host %s in the same host", v2binary),
|
|
| 37 |
+ } |
|
| 28 | 38 |
) |
| 29 | 39 |
|
| 30 | 40 |
// testRequires checks if the environment satisfies the requirements |