2014-02-25 16:17:48 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os/exec"
|
|
|
|
"strings"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
// search for repos named "registry" on the central registry
|
|
|
|
func TestSearchOnCentralRegistry(t *testing.T) {
|
2014-08-19 16:52:46 +00:00
|
|
|
searchCmd := exec.Command(dockerBinary, "search", "busybox")
|
2014-02-25 16:17:48 +00:00
|
|
|
out, exitCode, err := runCommandWithOutput(searchCmd)
|
|
|
|
errorOut(err, t, fmt.Sprintf("encountered error while searching: %v", err))
|
|
|
|
|
|
|
|
if err != nil || exitCode != 0 {
|
|
|
|
t.Fatal("failed to search on the central registry")
|
|
|
|
}
|
|
|
|
|
2014-06-24 21:16:34 +00:00
|
|
|
if !strings.Contains(out, "Busybox base image.") {
|
|
|
|
t.Fatal("couldn't find any repository named (or containing) 'Busybox base image.'")
|
2014-02-25 16:17:48 +00:00
|
|
|
}
|
|
|
|
|
2014-06-24 21:16:34 +00:00
|
|
|
logDone("search - search for repositories named (or containing) 'Busybox base image.'")
|
2014-02-25 16:17:48 +00:00
|
|
|
}
|