1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Test image api through local V1 repo

Closes #10967
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
This commit is contained in:
Srini Brahmaroutu 2015-02-27 22:18:11 +00:00
parent ded0ada9b4
commit 5daa9260bc
2 changed files with 13 additions and 0 deletions

View file

@ -108,6 +108,8 @@ func TestPullNonExistingImage(t *testing.T) {
// pulling an image from the central registry using official names should work // pulling an image from the central registry using official names should work
// ensure all pulls result in the same image // ensure all pulls result in the same image
func TestPullImageOfficialNames(t *testing.T) { func TestPullImageOfficialNames(t *testing.T) {
testRequires(t, Network)
names := []string{ names := []string{
"docker.io/hello-world", "docker.io/hello-world",
"index.docker.io/hello-world", "index.docker.io/hello-world",

View file

@ -4,6 +4,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"log" "log"
"net/http"
"os/exec" "os/exec"
"strings" "strings"
"testing" "testing"
@ -32,6 +33,16 @@ var (
func() bool { return supportsExec }, func() bool { return supportsExec },
"Test requires 'docker exec' capabilities on the tested daemon.", "Test requires 'docker exec' capabilities on the tested daemon.",
} }
Network = TestRequirement{
func() bool {
resp, err := http.Get("http://hub.docker.com")
if resp != nil {
resp.Body.Close()
}
return err == nil
},
"Test requires network availability, environment variable set to none to run in a non-network enabled mode.",
}
RegistryHosting = TestRequirement{ RegistryHosting = TestRequirement{
func() bool { func() bool {
// for now registry binary is built only if we're running inside // for now registry binary is built only if we're running inside