github.com/aimxhaisse/docker@v1.6.2/integration-cli/docker_cli_search_test.go (about) 1 package main 2 3 import ( 4 "os/exec" 5 "strings" 6 "testing" 7 ) 8 9 // search for repos named "registry" on the central registry 10 func TestSearchOnCentralRegistry(t *testing.T) { 11 searchCmd := exec.Command(dockerBinary, "search", "busybox") 12 out, exitCode, err := runCommandWithOutput(searchCmd) 13 if err != nil || exitCode != 0 { 14 t.Fatalf("failed to search on the central registry: %s, %v", out, err) 15 } 16 17 if !strings.Contains(out, "Busybox base image.") { 18 t.Fatal("couldn't find any repository named (or containing) 'Busybox base image.'") 19 } 20 21 logDone("search - search for repositories named (or containing) 'Busybox base image.'") 22 }