docker_cli_search_test.go 657 B

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