Skip to content

Commit

Permalink
fix TestExportContainerWithOutputAndImportImage on windows
Browse files Browse the repository at this point in the history
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <[email protected]> (github: jfrazelle)
  • Loading branch information
jessfraz committed Mar 17, 2015
1 parent 5ff122f commit 6a313e8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions integration-cli/docker_cli_export_import_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"fmt"
"os"
"os/exec"
"strings"
Expand Down Expand Up @@ -66,15 +65,18 @@ func TestExportContainerWithOutputAndImportImage(t *testing.T) {
t.Fatalf("output should've been a container id: %s %s ", cleanedContainerID, err)
}

exportCmdTemplate := `%v export --output=/tmp/testexp.tar %v`
exportCmdFinal := fmt.Sprintf(exportCmdTemplate, dockerBinary, cleanedContainerID)
exportCmd := exec.Command(exportCmdFinal)
exportCmd := exec.Command(dockerBinary, "export", "--output=testexp.tar", cleanedContainerID)
if out, _, err = runCommandWithOutput(exportCmd); err != nil {
t.Fatalf("failed to export container: %s, %v", out, err)
}

importCmdFinal := `cat /tmp/testexp.tar | docker import - repo/testexp:v1`
importCmd := exec.Command(importCmdFinal)
out, _, err = runCommandWithOutput(exec.Command("cat", "testexp.tar"))
if err != nil {
t.Fatal(out, err)
}

importCmd := exec.Command(dockerBinary, "import", "-", "repo/testexp:v1")
importCmd.Stdin = strings.NewReader(out)
out, _, err = runCommandWithOutput(importCmd)
if err != nil {
t.Fatalf("failed to import image: %s, %v", out, err)
Expand Down

0 comments on commit 6a313e8

Please sign in to comment.