summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/40-pods.at2
-rw-r--r--test/e2e/create_test.go62
-rw-r--r--test/e2e/run_networking_test.go32
-rw-r--r--test/e2e/run_test.go8
-rw-r--r--test/system/005-info.bats4
-rw-r--r--test/system/010-images.bats2
-rw-r--r--test/system/015-help.bats8
-rw-r--r--test/system/030-run.bats4
-rw-r--r--test/system/060-mount.bats2
-rw-r--r--test/system/075-exec.bats4
-rw-r--r--test/system/120-load.bats18
-rw-r--r--test/system/200-pod.bats5
-rw-r--r--test/system/250-systemd.bats2
-rw-r--r--test/system/260-sdnotify.bats2
-rw-r--r--test/system/500-networking.bats4
15 files changed, 133 insertions, 26 deletions
diff --git a/test/apiv2/40-pods.at b/test/apiv2/40-pods.at
index 9b8ff04f0..3df541de5 100644
--- a/test/apiv2/40-pods.at
+++ b/test/apiv2/40-pods.at
@@ -3,7 +3,7 @@
# test pod-related endpoints
#
-t GET "libpod/pods/json (clean slate at start)" 200 null
+t GET "libpod/pods/json (clean slate at start)" 200 '[]'
t POST libpod/pods/create name=foo 201 .Id~[0-9a-f]\\{64\\}
pod_id=$(jq -r .Id <<<"$output")
diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go
index 72a3a7717..9cfed263a 100644
--- a/test/e2e/create_test.go
+++ b/test/e2e/create_test.go
@@ -542,4 +542,66 @@ var _ = Describe("Podman create", func() {
Expect(session.ExitCode()).To(Not(Equal(0)))
Expect(session.ErrorToString()).To(ContainSubstring("Invalid umask"))
})
+
+ It("create container in pod with IP should fail", func() {
+ SkipIfRootless()
+ name := "createwithstaticip"
+ pod := podmanTest.RunTopContainerInPod("", "new:"+name)
+ pod.WaitWithDefaultTimeout()
+ Expect(pod.ExitCode()).To(BeZero())
+
+ session := podmanTest.Podman([]string{"create", "--pod", name, "--ip", "192.168.1.2", ALPINE, "top"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).ToNot(BeZero())
+ })
+
+ It("create container in pod with mac should fail", func() {
+ SkipIfRootless()
+ name := "createwithstaticmac"
+ pod := podmanTest.RunTopContainerInPod("", "new:"+name)
+ pod.WaitWithDefaultTimeout()
+ Expect(pod.ExitCode()).To(BeZero())
+
+ session := podmanTest.Podman([]string{"create", "--pod", name, "--mac-address", "52:54:00:6d:2f:82", ALPINE, "top"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).ToNot(BeZero())
+ })
+
+ It("create container in pod with network should fail", func() {
+ SkipIfRootless()
+ name := "createwithnetwork"
+ pod := podmanTest.RunTopContainerInPod("", "new:"+name)
+ pod.WaitWithDefaultTimeout()
+ Expect(pod.ExitCode()).To(BeZero())
+
+ session := podmanTest.Podman([]string{"create", "--pod", name, "--network", "foobar", ALPINE, "top"})
+ session.WaitWithDefaultTimeout()
+ //Expect(session.ExitCode()).ToNot(BeZero())
+ Expect(session.ExitCode()).To(BeZero())
+ })
+
+ It("create container in pod with ports should fail", func() {
+ SkipIfRootless()
+ name := "createwithports"
+ pod := podmanTest.RunTopContainerInPod("", "new:"+name)
+ pod.WaitWithDefaultTimeout()
+ Expect(pod.ExitCode()).To(BeZero())
+
+ session := podmanTest.Podman([]string{"create", "--pod", name, "-p", "80:80", ALPINE, "top"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).ToNot(BeZero())
+ })
+
+ It("create container in pod ppublish ports should fail", func() {
+ SkipIfRootless()
+ name := "createwithpublishports"
+ pod := podmanTest.RunTopContainerInPod("", "new:"+name)
+ pod.WaitWithDefaultTimeout()
+ Expect(pod.ExitCode()).To(BeZero())
+
+ session := podmanTest.Podman([]string{"create", "--pod", name, "-P", ALPINE, "top"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).ToNot(BeZero())
+ })
+
})
diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go
index 83befe730..a48f7c83e 100644
--- a/test/e2e/run_networking_test.go
+++ b/test/e2e/run_networking_test.go
@@ -531,8 +531,8 @@ var _ = Describe("Podman run networking", func() {
SkipIfRemote()
SkipIfRootless()
netName := "podmantestnetwork"
- ipAddr := "10.20.30.128"
- create := podmanTest.Podman([]string{"network", "create", "--subnet", "10.20.30.0/24", netName})
+ ipAddr := "10.25.30.128"
+ create := podmanTest.Podman([]string{"network", "create", "--subnet", "10.25.30.0/24", netName})
create.WaitWithDefaultTimeout()
Expect(create.ExitCode()).To(BeZero())
@@ -540,5 +540,33 @@ var _ = Describe("Podman run networking", func() {
run.WaitWithDefaultTimeout()
Expect(run.ExitCode()).To(BeZero())
Expect(run.OutputToString()).To(ContainSubstring(ipAddr))
+
+ netrm := podmanTest.Podman([]string{"network", "rm", netName})
+ netrm.WaitWithDefaultTimeout()
+ Expect(netrm.ExitCode()).To(BeZero())
+ })
+
+ It("podman run with new:pod and static-ip", func() {
+ SkipIfRemote()
+ SkipIfRootless()
+ netName := "podmantestnetwork2"
+ ipAddr := "10.25.40.128"
+ podname := "testpod"
+ create := podmanTest.Podman([]string{"network", "create", "--subnet", "10.25.40.0/24", netName})
+ create.WaitWithDefaultTimeout()
+ Expect(create.ExitCode()).To(BeZero())
+
+ run := podmanTest.Podman([]string{"run", "-t", "-i", "--rm", "--pod", "new:" + podname, "--net", netName, "--ip", ipAddr, ALPINE, "ip", "addr"})
+ run.WaitWithDefaultTimeout()
+ Expect(run.ExitCode()).To(BeZero())
+ Expect(run.OutputToString()).To(ContainSubstring(ipAddr))
+
+ podrm := podmanTest.Podman([]string{"pod", "rm", "-f", podname})
+ podrm.WaitWithDefaultTimeout()
+ Expect(podrm.ExitCode()).To(BeZero())
+
+ netrm := podmanTest.Podman([]string{"network", "rm", netName})
+ netrm.WaitWithDefaultTimeout()
+ Expect(netrm.ExitCode()).To(BeZero())
})
})
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 6c65a23e8..157b7d3d7 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -867,6 +867,14 @@ USER mail`
Expect(match).To(BeTrue())
})
+ It("podman run --pod new with hostname", func() {
+ hostname := "abc"
+ session := podmanTest.Podman([]string{"run", "--pod", "new:foobar", "--hostname", hostname, ALPINE, "cat", "/etc/hostname"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(ContainSubstring(hostname))
+ })
+
It("podman run --rm should work", func() {
session := podmanTest.Podman([]string{"run", "--name", "test", "--rm", ALPINE, "ls"})
session.WaitWithDefaultTimeout()
diff --git a/test/system/005-info.bats b/test/system/005-info.bats
index c53ba8125..3f1efd364 100644
--- a/test/system/005-info.bats
+++ b/test/system/005-info.bats
@@ -3,8 +3,6 @@
load helpers
@test "podman info - basic test" {
- skip_if_remote "capitalization inconsistencies"
-
run_podman info
expected_keys="
@@ -28,8 +26,6 @@ runRoot:
}
@test "podman info - json" {
- skip_if_remote "capitalization inconsistencies"
-
run_podman info --format=json
expr_nvr="[a-z0-9-]\\\+-[a-z0-9.]\\\+-[a-z0-9]\\\+\."
diff --git a/test/system/010-images.bats b/test/system/010-images.bats
index 2b1845d72..7fd731ca0 100644
--- a/test/system/010-images.bats
+++ b/test/system/010-images.bats
@@ -75,8 +75,6 @@ Size | [0-9]\\\+
}
@test "podman images - filter" {
- skip_if_remote "podman commit -q is broken in podman-remote"
-
run_podman inspect --format '{{.ID}}' $IMAGE
iid=$output
diff --git a/test/system/015-help.bats b/test/system/015-help.bats
index 76d29d22c..4a3781012 100644
--- a/test/system/015-help.bats
+++ b/test/system/015-help.bats
@@ -178,6 +178,14 @@ function check_help() {
# Called with no args -- start with 'podman --help'. check_help() will
# recurse for any subcommands.
check_help
+
+ # Test for regression of #7273 (spurious "--remote" help on output)
+ for helpopt in help --help; do
+ run_podman $helpopt
+ is "${lines[0]}" "Manage pods, containers and images" \
+ "podman $helpopt: first line of output"
+ done
+
}
# vim: filetype=sh
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index 41863ba04..34afd5bae 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -63,7 +63,7 @@ echo $rand | 0 | $rand
# 'run --preserve-fds' passes a number of additional file descriptors into the container
@test "podman run --preserve-fds" {
- skip_if_remote
+ skip_if_remote "preserve-fds is meaningless over remote"
content=$(random_string 20)
echo "$content" > $PODMAN_TMPDIR/tempfile
@@ -150,8 +150,6 @@ echo $rand | 0 | $rand
# 'run --rmi' deletes the image in the end unless it's used by another container
@test "podman run --rmi" {
- skip_if_remote
-
# Name of a nonlocal image. It should be pulled in by the first 'run'
NONLOCAL_IMAGE=busybox
run_podman 1 image exists $NONLOCAL_IMAGE
diff --git a/test/system/060-mount.bats b/test/system/060-mount.bats
index 7570f3ac4..d98a3eeb1 100644
--- a/test/system/060-mount.bats
+++ b/test/system/060-mount.bats
@@ -6,7 +6,7 @@ load helpers
@test "podman mount - basic test" {
# Only works with root (FIXME: does it work with rootless + vfs?)
skip_if_rootless "mount does not work rootless"
- skip_if_remote
+ skip_if_remote "mounting remote is meaningless"
f_path=/tmp/tmpfile_$(random_string 8)
f_content=$(random_string 30)
diff --git a/test/system/075-exec.bats b/test/system/075-exec.bats
index 38c6c2312..5f71e2acb 100644
--- a/test/system/075-exec.bats
+++ b/test/system/075-exec.bats
@@ -39,7 +39,7 @@ load helpers
}
@test "podman exec - leak check" {
- skip_if_remote
+ skip_if_remote "test is meaningless over remote"
# Start a container in the background then run exec command
# three times and make sure no any exec pid hash file leak
@@ -61,7 +61,7 @@ load helpers
# Issue #4785 - piping to exec statement - fixed in #4818
# Issue #5046 - piping to exec truncates results (actually a conmon issue)
@test "podman exec - cat from stdin" {
- skip_if_remote
+ skip_if_remote "FIXME: pending #7360"
run_podman run -d $IMAGE sh -c 'while [ ! -e /stop ]; do sleep 0.1;done'
cid="$output"
diff --git a/test/system/120-load.bats b/test/system/120-load.bats
index 14dae4c8a..86b396c4a 100644
--- a/test/system/120-load.bats
+++ b/test/system/120-load.bats
@@ -27,13 +27,25 @@ verify_iid_and_name() {
}
@test "podman save to pipe and load" {
+ get_iid_and_name
+
# We can't use run_podman because that uses the BATS 'run' function
# which redirects stdout and stderr. Here we need to guarantee
# that podman's stdout is a pipe, not any other form of redirection
- $PODMAN save --format oci-archive $IMAGE | cat >$PODMAN_TMPDIR/test.tar
- [ $status -eq 0 ]
+ $PODMAN save --format oci-archive $IMAGE | cat >$archive
+ if [ "$status" -ne 0 ]; then
+ die "Command failed: podman save ... | cat"
+ fi
+
+ # Make sure we can reload it
+ # FIXME: when/if 7337 gets fixed, add a random tag instead of rmi'ing
+ # FIXME: when/if 7371 gets fixed, use verify_iid_and_name()
+ run_podman rmi $iid
+ run_podman load -i $archive
- run_podman load -i $PODMAN_TMPDIR/test.tar
+ # FIXME: cannot compare IID, see #7371
+ run_podman images -a --format '{{.Repository}}:{{.Tag}}'
+ is "$output" "$IMAGE" "image preserves name across save/load"
}
diff --git a/test/system/200-pod.bats b/test/system/200-pod.bats
index f3ec8a67c..7189d7e4b 100644
--- a/test/system/200-pod.bats
+++ b/test/system/200-pod.bats
@@ -96,9 +96,8 @@ function teardown() {
run_podman rm $cid1
# ...then, from pause container, find the image ID of the pause image...
- # FIXME: if #6283 gets implemented, use 'inspect --format ...'
- run_podman pod inspect $podname
- pause_cid=$(jq -r '.Containers[0].Id' <<<"$output")
+ run_podman pod inspect --format '{{(index .Containers 0).ID}}' $podname
+ pause_cid="$output"
run_podman container inspect --format '{{.Image}}' $pause_cid
pause_iid="$output"
diff --git a/test/system/250-systemd.bats b/test/system/250-systemd.bats
index b7035cdda..bbb5a10fb 100644
--- a/test/system/250-systemd.bats
+++ b/test/system/250-systemd.bats
@@ -18,7 +18,7 @@ fi
UNIT_FILE="$UNIT_DIR/$SERVICE_NAME.service"
function setup() {
- skip_if_remote
+ skip_if_remote "systemd tests are meaningless over remote"
basic_setup
}
diff --git a/test/system/260-sdnotify.bats b/test/system/260-sdnotify.bats
index 7be4be983..62d3c1497 100644
--- a/test/system/260-sdnotify.bats
+++ b/test/system/260-sdnotify.bats
@@ -10,7 +10,7 @@ _SOCAT_PID=
_SOCAT_LOG=
function setup() {
- skip_if_remote
+ skip_if_remote "systemd tests are meaningless over remote"
skip "FIXME FIXME FIXME, is this what's causing the CI hang???"
diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats
index 234bc1187..0fae3dcd3 100644
--- a/test/system/500-networking.bats
+++ b/test/system/500-networking.bats
@@ -7,7 +7,7 @@ load helpers
# Copied from tsweeney's https://github.com/containers/podman/issues/4827
@test "podman networking: port on localhost" {
- skip_if_remote
+ skip_if_remote "FIXME: reevaluate this one after #7360 is fixed"
random_1=$(random_string 30)
random_2=$(random_string 30)
@@ -62,8 +62,6 @@ load helpers
# Issue #5466 - port-forwarding doesn't work with this option and -d
@test "podman networking: port with --userns=keep-id" {
- skip_if_remote
-
# FIXME: randomize port, and create second random host port
myport=54321