docker_cli_import_test.go 544 B

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