docker_cli_search_test.go 631 B

12345678910111213141516171819202122
  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. searchCmd := exec.Command(dockerBinary, "search", "busybox")
  10. out, exitCode, err := runCommandWithOutput(searchCmd)
  11. if err != nil || exitCode != 0 {
  12. t.Fatalf("failed to search on the central registry: %s, %v", out, err)
  13. }
  14. if !strings.Contains(out, "Busybox base image.") {
  15. t.Fatal("couldn't find any repository named (or containing) 'Busybox base image.'")
  16. }
  17. logDone("search - search for repositories named (or containing) 'Busybox base image.'")
  18. }