|
@@ -3,6 +3,7 @@ package main
|
|
|
import (
|
|
|
"fmt"
|
|
|
"io/ioutil"
|
|
|
+ "net/http"
|
|
|
"os"
|
|
|
"os/exec"
|
|
|
"path/filepath"
|
|
@@ -52,6 +53,18 @@ http:
|
|
|
}, nil
|
|
|
}
|
|
|
|
|
|
+func (t *testRegistryV2) Ping() error {
|
|
|
+ // We always ping through HTTP for our test registry.
|
|
|
+ resp, err := http.Get(fmt.Sprintf("http://%s/v2/", privateRegistryURL))
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ if resp.StatusCode != 200 {
|
|
|
+ return fmt.Errorf("registry ping replied with an unexpected status code %s", resp.StatusCode)
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
func (r *testRegistryV2) Close() {
|
|
|
r.cmd.Process.Kill()
|
|
|
os.RemoveAll(r.dir)
|