add docker import test with a tag. Fixes #7714

Signed-off-by: Lei Jitang <leijitang@huawei.com>
This commit is contained in:
Lei Jitang 2014-08-26 15:03:38 +08:00
parent 79cf839527
commit 7e72ed70f9

View file

@ -29,7 +29,7 @@ func TestExportContainerAndImportImage(t *testing.T) {
out, _, err = runCommandWithOutput(exportCmd) out, _, err = runCommandWithOutput(exportCmd)
errorOut(err, t, fmt.Sprintf("failed to export container: %v %v", out, err)) errorOut(err, t, fmt.Sprintf("failed to export container: %v %v", out, err))
importCmdFinal := `cat /tmp/testexp.tar | docker import - testexp` importCmdFinal := `cat /tmp/testexp.tar | docker import - repo/testexp:v1`
importCmd := exec.Command("bash", "-c", importCmdFinal) importCmd := exec.Command("bash", "-c", importCmdFinal)
out, _, err = runCommandWithOutput(importCmd) out, _, err = runCommandWithOutput(importCmd)
errorOut(err, t, fmt.Sprintf("failed to import image: %v %v", out, err)) errorOut(err, t, fmt.Sprintf("failed to import image: %v %v", out, err))
@ -41,7 +41,7 @@ func TestExportContainerAndImportImage(t *testing.T) {
errorOut(err, t, fmt.Sprintf("output should've been an image id: %v %v", out, err)) errorOut(err, t, fmt.Sprintf("output should've been an image id: %v %v", out, err))
deleteContainer(cleanedContainerID) deleteContainer(cleanedContainerID)
deleteImages("testexp") deleteImages("repo/testexp:v1")
os.Remove("/tmp/testexp.tar") os.Remove("/tmp/testexp.tar")