diff options
author | Adrian Reber <areber@redhat.com> | 2019-12-04 15:06:51 +0000 |
---|---|---|
committer | Adrian Reber <areber@redhat.com> | 2019-12-09 13:29:36 +0100 |
commit | 225c7ae6c98300fc8d9536fa31c0ae9f8231c5c0 (patch) | |
tree | c84b22b8fb5ac6ee45d6ff1fb19f6ab1505969f3 /test/e2e/checkpoint_test.go | |
parent | 7287f69b52e5bcb59f9977b261ee488942465ecb (diff) | |
download | podman-225c7ae6c98300fc8d9536fa31c0ae9f8231c5c0.tar.gz podman-225c7ae6c98300fc8d9536fa31c0ae9f8231c5c0.tar.bz2 podman-225c7ae6c98300fc8d9536fa31c0ae9f8231c5c0.zip |
Correctly export the root file-system changes
When doing a checkpoint with --export the root file-system diff was not
working as expected. Instead of getting the changes from the running
container to the highest storage layer it got the changes from the
highest layer to that parent's layer. For a one layer container this
could mean that the complete root file-system is part of the checkpoint.
With this commit this changes to use the same functionality as 'podman
diff'. This actually enables to correctly diff the root file-system
including tracking deleted files.
This also removes the non-working helper functions from libpod/diff.go.
Signed-off-by: Adrian Reber <areber@redhat.com>
Diffstat (limited to 'test/e2e/checkpoint_test.go')
-rw-r--r-- | test/e2e/checkpoint_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/e2e/checkpoint_test.go b/test/e2e/checkpoint_test.go index f208a4cf0..237223283 100644 --- a/test/e2e/checkpoint_test.go +++ b/test/e2e/checkpoint_test.go @@ -439,6 +439,18 @@ var _ = Describe("Podman checkpoint", func() { result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To(Equal(0)) + result = podmanTest.Podman([]string{"exec", "-l", "/bin/sh", "-c", "rm /etc/motd"}) + result.WaitWithDefaultTimeout() + Expect(result.ExitCode()).To(Equal(0)) + + result = podmanTest.Podman([]string{"diff", "-l"}) + result.WaitWithDefaultTimeout() + Expect(result.ExitCode()).To(Equal(0)) + Expect(result.OutputToString()).To(ContainSubstring("C /etc")) + Expect(result.OutputToString()).To(ContainSubstring("A /test.output")) + Expect(result.OutputToString()).To(ContainSubstring("D /etc/motd")) + Expect(len(result.OutputToStringArray())).To(Equal(3)) + // Checkpoint the container result = podmanTest.Podman([]string{"container", "checkpoint", "-l", "-e", fileName}) result.WaitWithDefaultTimeout() @@ -462,6 +474,14 @@ var _ = Describe("Podman checkpoint", func() { Expect(result.ExitCode()).To(Equal(0)) Expect(result.OutputToString()).To(ContainSubstring("test" + cid + "test")) + result = podmanTest.Podman([]string{"diff", "-l"}) + result.WaitWithDefaultTimeout() + Expect(result.ExitCode()).To(Equal(0)) + Expect(result.OutputToString()).To(ContainSubstring("C /etc")) + Expect(result.OutputToString()).To(ContainSubstring("A /test.output")) + Expect(result.OutputToString()).To(ContainSubstring("D /etc/motd")) + Expect(len(result.OutputToStringArray())).To(Equal(3)) + // Remove exported checkpoint os.Remove(fileName) }) |