summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-07-08 20:31:59 +0200
committerGitHub <noreply@github.com>2019-07-08 20:31:59 +0200
commitedc7f52c9577a22f7dcd5b98fbd0125fb8d2da79 (patch)
treee11c01edb0d3d1d6471f27a2efc1b030566223b2 /test
parenteae377d6e8875ab19d06189032a7c8f98e5d84dd (diff)
parent95719b6d6b2cf7eae9b60e9a46161a2cbbe588b7 (diff)
downloadpodman-edc7f52c9577a22f7dcd5b98fbd0125fb8d2da79.tar.gz
podman-edc7f52c9577a22f7dcd5b98fbd0125fb8d2da79.tar.bz2
podman-edc7f52c9577a22f7dcd5b98fbd0125fb8d2da79.zip
Merge pull request #3425 from adrianreber/restore-mount-label
Set correct SELinux label on restored containers
Diffstat (limited to 'test')
-rw-r--r--test/e2e/checkpoint_test.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/e2e/checkpoint_test.go b/test/e2e/checkpoint_test.go
index d452a062b..c60a99386 100644
--- a/test/e2e/checkpoint_test.go
+++ b/test/e2e/checkpoint_test.go
@@ -392,4 +392,43 @@ var _ = Describe("Podman checkpoint", func() {
// Remove exported checkpoint
os.Remove("/tmp/checkpoint.tar.gz")
})
+
+ It("podman checkpoint and run exec in restored container", func() {
+ // Start the container
+ session := podmanTest.Podman([]string{"run", "-it", "--rm", "-d", ALPINE, "top"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
+ cid := session.OutputToString()
+
+ // Checkpoint the container
+ result := podmanTest.Podman([]string{"container", "checkpoint", "-l", "-e", "/tmp/checkpoint.tar.gz"})
+ result.WaitWithDefaultTimeout()
+
+ Expect(result.ExitCode()).To(Equal(0))
+ Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
+ Expect(podmanTest.NumberOfContainers()).To(Equal(0))
+
+ // Restore the container
+ result = podmanTest.Podman([]string{"container", "restore", "-i", "/tmp/checkpoint.tar.gz"})
+ result.WaitWithDefaultTimeout()
+
+ Expect(result.ExitCode()).To(Equal(0))
+ Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
+ Expect(podmanTest.NumberOfContainers()).To(Equal(1))
+ Expect(podmanTest.GetContainerStatus()).To(ContainSubstring("Up"))
+
+ // Exec in the container
+ result = podmanTest.Podman([]string{"exec", "-l", "/bin/sh", "-c", "echo " + cid + " > /test.output"})
+ result.WaitWithDefaultTimeout()
+ Expect(result.ExitCode()).To(Equal(0))
+
+ result = podmanTest.Podman([]string{"exec", "-l", "cat", "/test.output"})
+ result.WaitWithDefaultTimeout()
+ Expect(result.ExitCode()).To(Equal(0))
+ Expect(result.OutputToString()).To(ContainSubstring(cid))
+
+ // Remove exported checkpoint
+ os.Remove("/tmp/checkpoint.tar.gz")
+ })
})