summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-09-17 07:02:52 -0400
committerGitHub <noreply@github.com>2021-09-17 07:02:52 -0400
commit9a5987cf6a7729f9d03a663dd361a37ca473da59 (patch)
tree447677216c3a88bef777cd6a452252a0314f17a7 /test
parentc6ae5c7961e2663ba91de7877aafe9791a80b245 (diff)
parent4216f7b7f492fee80cfc9a7f1deb608096edd890 (diff)
downloadpodman-9a5987cf6a7729f9d03a663dd361a37ca473da59.tar.gz
podman-9a5987cf6a7729f9d03a663dd361a37ca473da59.tar.bz2
podman-9a5987cf6a7729f9d03a663dd361a37ca473da59.zip
Merge pull request #11603 from rhatdan/truncate
Add no-trunc support to podman-events
Diffstat (limited to 'test')
-rw-r--r--test/e2e/mount_test.go17
-rw-r--r--test/e2e/run_cleanup_test.go4
-rw-r--r--test/system/090-events.bats17
3 files changed, 28 insertions, 10 deletions
diff --git a/test/e2e/mount_test.go b/test/e2e/mount_test.go
index 141d1a386..5ecd61097 100644
--- a/test/e2e/mount_test.go
+++ b/test/e2e/mount_test.go
@@ -169,7 +169,7 @@ var _ = Describe("Podman mount", func() {
Expect(setup).Should(Exit(0))
cid := setup.OutputToString()
- lmount := podmanTest.Podman([]string{"mount", "--notruncate"})
+ lmount := podmanTest.Podman([]string{"mount", "--no-trunc"})
lmount.WaitWithDefaultTimeout()
Expect(lmount).Should(Exit(0))
Expect(lmount.OutputToString()).To(Equal(""))
@@ -178,7 +178,7 @@ var _ = Describe("Podman mount", func() {
mount.WaitWithDefaultTimeout()
Expect(mount).Should(Exit(0))
- lmount = podmanTest.Podman([]string{"mount", "--notruncate"})
+ lmount = podmanTest.Podman([]string{"mount", "--no-trunc"})
lmount.WaitWithDefaultTimeout()
Expect(lmount).Should(Exit(0))
Expect(lmount.OutputToString()).To(ContainSubstring(cid))
@@ -195,7 +195,7 @@ var _ = Describe("Podman mount", func() {
Expect(setup).Should(Exit(0))
cid := setup.OutputToString()
- lmount := podmanTest.Podman([]string{"mount", "--notruncate"})
+ lmount := podmanTest.Podman([]string{"mount", "--no-trunc"})
lmount.WaitWithDefaultTimeout()
Expect(lmount).Should(Exit(0))
Expect(lmount.OutputToString()).To(ContainSubstring(cid))
@@ -204,7 +204,7 @@ var _ = Describe("Podman mount", func() {
stop.WaitWithDefaultTimeout()
Expect(stop).Should(Exit(0))
- lmount = podmanTest.Podman([]string{"mount", "--notruncate"})
+ lmount = podmanTest.Podman([]string{"mount", "--no-trunc"})
lmount.WaitWithDefaultTimeout()
Expect(lmount).Should(Exit(0))
Expect(lmount.OutputToString()).To(Equal(""))
@@ -227,7 +227,7 @@ var _ = Describe("Podman mount", func() {
Expect(setup).Should(Exit(0))
cid3 := setup.OutputToString()
- lmount := podmanTest.Podman([]string{"mount", "--notruncate"})
+ lmount := podmanTest.Podman([]string{"mount", "--no-trunc"})
lmount.WaitWithDefaultTimeout()
Expect(lmount).Should(Exit(0))
Expect(lmount.OutputToString()).To(Equal(""))
@@ -236,7 +236,7 @@ var _ = Describe("Podman mount", func() {
mount.WaitWithDefaultTimeout()
Expect(mount).Should(Exit(0))
- lmount = podmanTest.Podman([]string{"mount", "--notruncate"})
+ lmount = podmanTest.Podman([]string{"mount", "--no-trunc"})
lmount.WaitWithDefaultTimeout()
Expect(lmount).Should(Exit(0))
Expect(lmount.OutputToString()).To(ContainSubstring(cid1))
@@ -247,7 +247,7 @@ var _ = Describe("Podman mount", func() {
umount.WaitWithDefaultTimeout()
Expect(umount).Should(Exit(0))
- lmount = podmanTest.Podman([]string{"mount", "--notruncate"})
+ lmount = podmanTest.Podman([]string{"mount", "--no-trunc"})
lmount.WaitWithDefaultTimeout()
Expect(lmount).Should(Exit(0))
Expect(lmount.OutputToString()).To(Equal(""))
@@ -261,7 +261,7 @@ var _ = Describe("Podman mount", func() {
Expect(setup).Should(Exit(0))
cid := setup.OutputToString()
- lmount := podmanTest.Podman([]string{"mount", "--notruncate"})
+ lmount := podmanTest.Podman([]string{"mount", "--no-trunc"})
lmount.WaitWithDefaultTimeout()
Expect(lmount).Should(Exit(0))
Expect(lmount.OutputToString()).To(Equal(""))
@@ -270,6 +270,7 @@ var _ = Describe("Podman mount", func() {
mount.WaitWithDefaultTimeout()
Expect(mount).Should(Exit(0))
+ // test --notruncate alias
lmount = podmanTest.Podman([]string{"mount", "--notruncate"})
lmount.WaitWithDefaultTimeout()
Expect(lmount).Should(Exit(0))
diff --git a/test/e2e/run_cleanup_test.go b/test/e2e/run_cleanup_test.go
index cfe11079d..6753fcf12 100644
--- a/test/e2e/run_cleanup_test.go
+++ b/test/e2e/run_cleanup_test.go
@@ -46,7 +46,7 @@ var _ = Describe("Podman run exit", func() {
Expect(mount).Should(Exit(0))
Expect(mount.OutputToString()).To(ContainSubstring(cid))
- pmount := podmanTest.Podman([]string{"mount", "--notruncate"})
+ pmount := podmanTest.Podman([]string{"mount", "--no-trunc"})
pmount.WaitWithDefaultTimeout()
Expect(pmount).Should(Exit(0))
Expect(pmount.OutputToString()).To(ContainSubstring(cid))
@@ -64,7 +64,7 @@ var _ = Describe("Podman run exit", func() {
Expect(mount).Should(Exit(0))
Expect(mount.OutputToString()).NotTo(ContainSubstring(cid))
- pmount = podmanTest.Podman([]string{"mount", "--notruncate"})
+ pmount = podmanTest.Podman([]string{"mount", "--no-trunc"})
pmount.WaitWithDefaultTimeout()
Expect(pmount).Should(Exit(0))
Expect(pmount.OutputToString()).NotTo(ContainSubstring(cid))
diff --git a/test/system/090-events.bats b/test/system/090-events.bats
index 22edaeee9..1fb542ccd 100644
--- a/test/system/090-events.bats
+++ b/test/system/090-events.bats
@@ -25,6 +25,23 @@ load helpers
is "$output" "$expect" "filtering just by label"
}
+@test "truncate events" {
+ cname=test-$(random_string 30 | tr A-Z a-z)
+ labelname=$(random_string 10)
+ labelvalue=$(random_string 15)
+
+ run_podman run -d --name=$cname --rm $IMAGE echo hi
+ id="$output"
+
+ expect="$id"
+ run_podman events --filter container=$cname --filter event=start --stream=false
+ is "$output" ".* $id " "filtering by container name full id"
+
+ truncID=$(expr substr "$id" 1 12)
+ run_podman events --filter container=$cname --filter event=start --stream=false --no-trunc=false
+ is "$output" ".* $truncID " "filtering by container name trunc id"
+}
+
@test "image events" {
skip_if_remote "remote does not support --events-backend"
pushedDir=$PODMAN_TMPDIR/dir