Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,20 @@ |
| 0 |
+package main |
|
| 1 |
+ |
|
| 2 |
+import ( |
|
| 3 |
+ "fmt" |
|
| 4 |
+ "os/exec" |
|
| 5 |
+ "strings" |
|
| 6 |
+ "testing" |
|
| 7 |
+) |
|
| 8 |
+ |
|
| 9 |
+func TestImportDisplay(t *testing.T) {
|
|
| 10 |
+ importCmd := exec.Command(dockerBinary, "import", "https://github.com/ewindisch/docker-cirros/raw/master/cirros-0.3.0-x86_64-lxc.tar.gz") |
|
| 11 |
+ out, _, err := runCommandWithOutput(importCmd) |
|
| 12 |
+ errorOut(err, t, fmt.Sprintf("import failed with errors: %v", err))
|
|
| 13 |
+ |
|
| 14 |
+ if n := len(strings.Split(out, "\n")); n != 3 {
|
|
| 15 |
+ t.Fatalf("display is messed up: %d '\\n' instead of 3", n)
|
|
| 16 |
+ } |
|
| 17 |
+ |
|
| 18 |
+ logDone("import - cirros was imported and display is fine")
|
|
| 19 |
+} |