aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/python/rest_api/test_v2_0_0_image.py5
-rw-r--r--test/e2e/mount_test.go17
-rw-r--r--test/e2e/network_create_test.go9
-rw-r--r--test/e2e/run_cleanup_test.go4
-rw-r--r--test/e2e/run_networking_test.go12
-rw-r--r--test/system/001-basic.bats3
-rw-r--r--test/system/070-build.bats30
-rw-r--r--test/system/090-events.bats17
-rw-r--r--test/system/160-volumes.bats9
9 files changed, 77 insertions, 29 deletions
diff --git a/test/apiv2/python/rest_api/test_v2_0_0_image.py b/test/apiv2/python/rest_api/test_v2_0_0_image.py
index bcacaa935..58d03b149 100644
--- a/test/apiv2/python/rest_api/test_v2_0_0_image.py
+++ b/test/apiv2/python/rest_api/test_v2_0_0_image.py
@@ -32,6 +32,9 @@ class ImageTestCase(APITestCase):
for k in required_keys:
self.assertIn(k, item)
+ # Id should be prefixed with sha256: (#11645)
+ self.assertIn("sha256:",item['Id'])
+
def test_inspect(self):
r = requests.get(self.podman_url + "/v1.40/images/alpine/json")
self.assertEqual(r.status_code, 200, r.text)
@@ -59,6 +62,8 @@ class ImageTestCase(APITestCase):
for item in required_keys:
self.assertIn(item, image)
_ = parse(image["Created"])
+ # Id should be prefixed with sha256: (#11645)
+ self.assertIn("sha256:",image['Id'])
def test_delete(self):
r = requests.delete(self.podman_url + "/v1.40/images/alpine?force=true")
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/network_create_test.go b/test/e2e/network_create_test.go
index d419a701d..ae9f112b5 100644
--- a/test/e2e/network_create_test.go
+++ b/test/e2e/network_create_test.go
@@ -343,4 +343,13 @@ var _ = Describe("Podman network create", func() {
Expect(nc.OutputToString()).ToNot(ContainSubstring("dnsname"))
})
+ It("podman network create with invalid name", func() {
+ for _, name := range []string{"none", "host", "bridge", "private", "slirp4netns", "container", "ns"} {
+ nc := podmanTest.Podman([]string{"network", "create", name})
+ nc.WaitWithDefaultTimeout()
+ Expect(nc).To(Exit(125))
+ Expect(nc.ErrorToString()).To(ContainSubstring("cannot create network with name %q because it conflicts with a valid network mode", name))
+ }
+ })
+
})
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/e2e/run_networking_test.go b/test/e2e/run_networking_test.go
index 8eabeba97..c7ffdaf4c 100644
--- a/test/e2e/run_networking_test.go
+++ b/test/e2e/run_networking_test.go
@@ -709,6 +709,18 @@ var _ = Describe("Podman run networking", func() {
Expect(strings.Contains(run.OutputToString(), hostname)).To(BeTrue())
})
+ It("podman run with pod does not add extra 127 entry to /etc/hosts", func() {
+ pod := "testpod"
+ hostname := "test-hostname"
+ run := podmanTest.Podman([]string{"pod", "create", "--hostname", hostname, "--name", pod})
+ run.WaitWithDefaultTimeout()
+ Expect(run).Should(Exit(0))
+ run = podmanTest.Podman([]string{"run", "--pod", pod, ALPINE, "cat", "/etc/hosts"})
+ run.WaitWithDefaultTimeout()
+ Expect(run).Should(Exit(0))
+ Expect(run.OutputToString()).ToNot(ContainSubstring("127.0.0.1 %s", hostname))
+ })
+
ping_test := func(netns string) {
hostname := "testctr"
run := podmanTest.Podman([]string{"run", netns, "--hostname", hostname, ALPINE, "ping", "-c", "1", hostname})
diff --git a/test/system/001-basic.bats b/test/system/001-basic.bats
index 963c89281..888c075b8 100644
--- a/test/system/001-basic.bats
+++ b/test/system/001-basic.bats
@@ -57,6 +57,9 @@ function setup() {
# Now untag the digest reference again.
run_podman untag $IMAGE $IMAGE@$digest
+
+ # Make sure the original image is still present (#11557).
+ run_podman image exists $IMAGE
}
# PR #7212: allow --remote anywhere before subcommand, not just as 1st flag
diff --git a/test/system/070-build.bats b/test/system/070-build.bats
index 03c7984e2..0e1396fc6 100644
--- a/test/system/070-build.bats
+++ b/test/system/070-build.bats
@@ -285,21 +285,11 @@ EOF
build_arg_implicit+="=$arg_implicit_value"
fi
- # FIXME FIXME FIXME: 2021-03-15: workaround for #9567 (slow ubuntu 2004):
- # we're seeing lots of timeouts in CI. Until/unless #9567 gets fixed,
- # let's get CI passing by extending the timeout when remote on ubuntu
- local localtimeout=${PODMAN_TIMEOUT}
- if is_remote; then
- if grep -qi ubuntu /etc/os-release; then
- localtimeout=$(( 2 * $localtimeout ))
- fi
- fi
-
# cd to the dir, so we test relative paths (important for podman-remote)
cd $PODMAN_TMPDIR
export arg_explicit="THIS SHOULD BE OVERRIDDEN BY COMMAND LINE!"
export arg_implicit=${arg_implicit_value}
- PODMAN_TIMEOUT=$localtimeout run_podman ${MOUNTS_CONF} build \
+ run_podman ${MOUNTS_CONF} build \
--build-arg arg_explicit=${arg_explicit_value} \
$build_arg_implicit \
--dns-search $nosuchdomain \
@@ -456,16 +446,24 @@ Labels.$label_name | $label_value
@test "podman build - COPY with ignore" {
local tmpdir=$PODMAN_TMPDIR/build-test-$(random_string 10)
- mkdir -p $tmpdir/subdir
+ mkdir -p $tmpdir/subdir{1,2}
# Create a bunch of files. Declare this as an array to avoid duplication
# because we iterate over that list below, checking for each file.
# A leading "-" indicates that the file SHOULD NOT exist in the built image
+ #
+ # Weird side effect of Buildah 3486, relating to subdirectories and
+ # wildcard patterns. See that PR for details, it's way too confusing
+ # to explain in a comment.
local -a files=(
-test1 -test1.txt
test2 test2.txt
- -subdir/sub1 -subdir/sub1.txt
- -subdir/sub2 -subdir/sub2.txt
+ subdir1/sub1 subdir1/sub1.txt
+ -subdir1/sub2 -subdir1/sub2.txt
+ subdir1/sub3 subdir1/sub3.txt
+ -subdir2/sub1 -subdir2/sub1.txt
+ -subdir2/sub2 -subdir2/sub2.txt
+ -subdir2/sub3 -subdir2/sub3.txt
this-file-does-not-match-anything-in-ignore-file
comment
)
@@ -492,8 +490,10 @@ EOF
# comment
test*
!test2*
-subdir
+subdir1
+subdir2
!*/sub1*
+!subdir1/sub3*
EOF
# Build an image. For .dockerignore
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
diff --git a/test/system/160-volumes.bats b/test/system/160-volumes.bats
index f6dc3f0af..e21be9ea4 100644
--- a/test/system/160-volumes.bats
+++ b/test/system/160-volumes.bats
@@ -21,8 +21,6 @@ function teardown() {
# Simple volume tests: share files between host and container
@test "podman run --volumes : basic" {
- skip_if_remote "volumes cannot be shared across hosts"
-
run_podman volume list --noheading
is "$output" "" "baseline: empty results from list --noheading"
@@ -192,9 +190,12 @@ EOF
run_podman volume create my_vol
run_podman run --rm -v my_vol:/data $IMAGE sh -c "echo hello >> /data/test"
run_podman volume create my_vol2
- run_podman volume export my_vol --output=hello.tar
+
+ tarfile=hello$(random_string | tr A-Z a-z).tar
+ run_podman volume export my_vol --output=$tarfile
# we want to use `run_podman volume export my_vol` but run_podman is wrapping EOF
- cat hello.tar | run_podman volume import my_vol2 -
+ run_podman volume import my_vol2 - < $tarfile
+ rm -f $tarfile
run_podman run --rm -v my_vol2:/data $IMAGE sh -c "cat /data/test"
is "$output" "hello" "output from second container"
run_podman volume rm my_vol