docker_cli_import_test.go 539 B

1234567891011121314151617181920
  1. package main
  2. import (
  3. "fmt"
  4. "os/exec"
  5. "strings"
  6. "testing"
  7. )
  8. func TestImportDisplay(t *testing.T) {
  9. importCmd := exec.Command(dockerBinary, "import", "https://github.com/ewindisch/docker-cirros/raw/master/cirros-0.3.0-x86_64-lxc.tar.gz")
  10. out, _, err := runCommandWithOutput(importCmd)
  11. errorOut(err, t, fmt.Sprintf("import failed with errors: %v", err))
  12. if n := len(strings.Split(out, "\n")); n != 3 {
  13. t.Fatalf("display is messed up: %d '\\n' instead of 3", n)
  14. }
  15. logDone("import - cirros was imported and display is fine")
  16. }