summaryrefslogtreecommitdiff
path: root/test/e2e/diff_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/diff_test.go')
-rw-r--r--test/e2e/diff_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/e2e/diff_test.go b/test/e2e/diff_test.go
index eca485c8b..319f086cd 100644
--- a/test/e2e/diff_test.go
+++ b/test/e2e/diff_test.go
@@ -2,6 +2,7 @@ package integration
import (
"os"
+ "sort"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
@@ -47,4 +48,24 @@ var _ = Describe("Podman diff", func() {
Expect(session.ExitCode()).To(Equal(0))
Expect(session.IsJSONOutputValid()).To(BeTrue())
})
+
+ It("podman diff container and committed image", func() {
+ session := podmanTest.Podman([]string{"run", "--name=diff-test", ALPINE, "touch", "/tmp/diff-test"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ session = podmanTest.Podman([]string{"diff", "diff-test"})
+ session.WaitWithDefaultTimeout()
+ containerDiff := session.OutputToStringArray()
+ sort.Strings(containerDiff)
+ Expect(session.LineInOutputContains("C /tmp")).To(BeTrue())
+ Expect(session.LineInOutputContains("A /tmp/diff-test")).To(BeTrue())
+ session = podmanTest.Podman([]string{"commit", "diff-test", "diff-test-img"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ session = podmanTest.Podman([]string{"diff", "diff-test-img"})
+ session.WaitWithDefaultTimeout()
+ imageDiff := session.OutputToStringArray()
+ sort.Strings(imageDiff)
+ Expect(imageDiff).To(Equal(containerDiff))
+ })
})