From 614c57c52161c0440247a4e4e36808116214770e Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Tue, 17 Jun 2014 00:59:51 +0000 Subject: [PATCH] improve test Docker-DCO-1.1-Signed-off-by: Victor Vieux (github: vieux) --- integration-cli/docker_cli_save_load_test.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/integration-cli/docker_cli_save_load_test.go b/integration-cli/docker_cli_save_load_test.go index d728c7de95..3dc5b8d010 100644 --- a/integration-cli/docker_cli_save_load_test.go +++ b/integration-cli/docker_cli_save_load_test.go @@ -25,6 +25,10 @@ func TestSaveAndLoadRepo(t *testing.T) { out, _, err = runCommandWithOutput(commitCmd) errorOut(err, t, fmt.Sprintf("failed to commit container: %v %v", out, err)) + inspectCmd = exec.Command(dockerBinary, "inspect", repoName) + before, _, err := runCommandWithOutput(inspectCmd) + errorOut(err, t, fmt.Sprintf("the repo should exist before saving it: %v %v", before, err)) + saveCmdTemplate := `%v save %v > /tmp/foobar-save-load-test.tar` saveCmdFinal := fmt.Sprintf(saveCmdTemplate, dockerBinary, repoName) saveCmd := exec.Command("bash", "-c", saveCmdFinal) @@ -39,8 +43,12 @@ func TestSaveAndLoadRepo(t *testing.T) { errorOut(err, t, fmt.Sprintf("failed to load repo: %v %v", out, err)) inspectCmd = exec.Command(dockerBinary, "inspect", repoName) - out, _, err = runCommandWithOutput(inspectCmd) - errorOut(err, t, fmt.Sprintf("the repo should exist after loading it: %v %v", out, err)) + after, _, err := runCommandWithOutput(inspectCmd) + errorOut(err, t, fmt.Sprintf("the repo should exist after loading it: %v %v", after, err)) + + if before != after { + t.Fatalf("inspect is not the same after a save / load") + } deleteContainer(cleanedContainerID) deleteImages(repoName)