mirror of
https://github.com/containers/podman.git
synced 2025-10-18 11:42:55 +08:00
Merge pull request #26947 from Luap99/system-test-fixes
test/system: some small fixes
This commit is contained in:
@ -24,7 +24,7 @@ $0 is a wrapper for invoking podman system tests.
|
|||||||
match that string.
|
match that string.
|
||||||
|
|
||||||
--tag=TAG Passed on to bats as '--filter-tags TAG'
|
--tag=TAG Passed on to bats as '--filter-tags TAG'
|
||||||
As of 2023-07-26 the only tag used is 'distro-integration'
|
As of 2025-09-01 the only tag used is 'ci:parallel'
|
||||||
|
|
||||||
-t, --tap Passed on to bats, which will format output in TAP format
|
-t, --tap Passed on to bats, which will format output in TAP format
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ function setup() {
|
|||||||
|
|
||||||
#### DO NOT ADD ANY TESTS HERE! ADD NEW TESTS AT BOTTOM!
|
#### DO NOT ADD ANY TESTS HERE! ADD NEW TESTS AT BOTTOM!
|
||||||
|
|
||||||
# bats test_tags=distro-integration
|
|
||||||
@test "podman version emits reasonable output" {
|
@test "podman version emits reasonable output" {
|
||||||
run_podman version
|
run_podman version
|
||||||
|
|
||||||
@ -37,7 +36,6 @@ function setup() {
|
|||||||
is "$output" "podman.*version \+" "'Version line' in output"
|
is "$output" "podman.*version \+" "'Version line' in output"
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration
|
|
||||||
@test "podman info" {
|
@test "podman info" {
|
||||||
# These will be displayed on the test output stream, offering an
|
# These will be displayed on the test output stream, offering an
|
||||||
# at-a-glance overview of important system configuration details
|
# at-a-glance overview of important system configuration details
|
||||||
@ -72,7 +70,6 @@ function setup() {
|
|||||||
"--context=swarm should fail"
|
"--context=swarm should fail"
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration
|
|
||||||
@test "podman can pull an image" {
|
@test "podman can pull an image" {
|
||||||
run_podman rmi -a -f
|
run_podman rmi -a -f
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ load helpers
|
|||||||
load helpers.network
|
load helpers.network
|
||||||
load helpers.registry
|
load helpers.registry
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman run - basic tests" {
|
@test "podman run - basic tests" {
|
||||||
rand=$(random_string 30)
|
rand=$(random_string 30)
|
||||||
|
|
||||||
@ -352,7 +352,7 @@ echo $rand | 0 | $rand
|
|||||||
}
|
}
|
||||||
|
|
||||||
# #6829 : add username to /etc/passwd inside container if --userns=keep-id
|
# #6829 : add username to /etc/passwd inside container if --userns=keep-id
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman run : add username to /etc/passwd if --userns=keep-id" {
|
@test "podman run : add username to /etc/passwd if --userns=keep-id" {
|
||||||
skip_if_not_rootless "--userns=keep-id only works in rootless mode"
|
skip_if_not_rootless "--userns=keep-id only works in rootless mode"
|
||||||
# Default: always run as root
|
# Default: always run as root
|
||||||
@ -829,7 +829,6 @@ json-file | f
|
|||||||
# podman exec may truncate stdout/stderr; actually a bug in conmon:
|
# podman exec may truncate stdout/stderr; actually a bug in conmon:
|
||||||
# https://github.com/containers/conmon/issues/236
|
# https://github.com/containers/conmon/issues/236
|
||||||
# CANNOT BE PARALLELIZED due to "-l"
|
# CANNOT BE PARALLELIZED due to "-l"
|
||||||
# bats test_tags=distro-integration
|
|
||||||
@test "podman run - does not truncate or hang with big output" {
|
@test "podman run - does not truncate or hang with big output" {
|
||||||
# Size, in bytes, to dd and to expect in return
|
# Size, in bytes, to dd and to expect in return
|
||||||
char_count=700000
|
char_count=700000
|
||||||
@ -1147,7 +1146,7 @@ EOF
|
|||||||
run_podman rm $output
|
run_podman rm $output
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman run --device-read-bps" {
|
@test "podman run --device-read-bps" {
|
||||||
skip_if_rootless "cannot use this flag in rootless mode"
|
skip_if_rootless "cannot use this flag in rootless mode"
|
||||||
|
|
||||||
|
@ -4,8 +4,6 @@ load helpers
|
|||||||
load helpers.sig-proxy
|
load helpers.sig-proxy
|
||||||
|
|
||||||
# Each of the tests below does some setup, then invokes the helper from helpers.sig-proxy.bash.
|
# Each of the tests below does some setup, then invokes the helper from helpers.sig-proxy.bash.
|
||||||
|
|
||||||
# bats test_tags=distro-integration
|
|
||||||
@test "podman sigproxy test: run" {
|
@test "podman sigproxy test: run" {
|
||||||
# We're forced to use $PODMAN because run_podman cannot be backgrounded
|
# We're forced to use $PODMAN because run_podman cannot be backgrounded
|
||||||
$PODMAN run -i --name c_run $IMAGE sh -c "$SLEEPLOOP" &
|
$PODMAN run -i --name c_run $IMAGE sh -c "$SLEEPLOOP" &
|
||||||
|
@ -354,7 +354,7 @@ timeout: sending signal TERM to command.*" "logs --since -f on running container
|
|||||||
_log_test_follow_since k8s-file
|
_log_test_follow_since k8s-file
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman logs - --since --follow journald" {
|
@test "podman logs - --since --follow journald" {
|
||||||
# We can't use journald on RHEL as rootless: rhbz#1895105
|
# We can't use journald on RHEL as rootless: rhbz#1895105
|
||||||
skip_if_journald_unavailable
|
skip_if_journald_unavailable
|
||||||
@ -398,7 +398,7 @@ $content--2.*" "logs --until -f on running container works"
|
|||||||
_log_test_follow_until k8s-file
|
_log_test_follow_until k8s-file
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman logs - --until --follow journald" {
|
@test "podman logs - --until --follow journald" {
|
||||||
# We can't use journald on RHEL as rootless: rhbz#1895105
|
# We can't use journald on RHEL as rootless: rhbz#1895105
|
||||||
skip_if_journald_unavailable
|
skip_if_journald_unavailable
|
||||||
|
@ -362,7 +362,7 @@ EOF
|
|||||||
is "$output" "bar1.*bar2.*bar3" "Should match multiple source files on single destination directory"
|
is "$output" "bar1.*bar2.*bar3" "Should match multiple source files on single destination directory"
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration,ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman mount noswap memory mounts" {
|
@test "podman mount noswap memory mounts" {
|
||||||
# tmpfs+noswap new in kernel 6.x, mid-2023; likely not in RHEL for a while
|
# tmpfs+noswap new in kernel 6.x, mid-2023; likely not in RHEL for a while
|
||||||
if ! is_rootless; then
|
if ! is_rootless; then
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
load helpers
|
load helpers
|
||||||
|
load helpers.network
|
||||||
|
|
||||||
# bats test_tags=distro-integration
|
|
||||||
@test "podman build - basic test" {
|
@test "podman build - basic test" {
|
||||||
rand_filename=$(random_string 20)
|
rand_filename=$(random_string 20)
|
||||||
rand_content=$(random_string 50)
|
rand_content=$(random_string 50)
|
||||||
@ -279,24 +279,44 @@ EOF
|
|||||||
tmpdir=$PODMAN_TMPDIR/build-test
|
tmpdir=$PODMAN_TMPDIR/build-test
|
||||||
mkdir -p $tmpdir
|
mkdir -p $tmpdir
|
||||||
|
|
||||||
|
# Create a test file with random content
|
||||||
|
INDEX=$PODMAN_TMPDIR/index.txt
|
||||||
|
local content="test-$(random_string)"
|
||||||
|
echo "$content" > $INDEX
|
||||||
|
echo READY > $PODMAN_TMPDIR/ready
|
||||||
|
|
||||||
|
# Setup local webserver
|
||||||
|
local host_port=$(random_free_port)
|
||||||
|
local server=http://127.0.0.1:$host_port
|
||||||
|
serverctr="c1-$(safename)"
|
||||||
|
run_podman run -d --name $serverctr -p "$host_port:80" \
|
||||||
|
-v $INDEX:/var/www/index.txt:Z \
|
||||||
|
-v $PODMAN_TMPDIR/ready:/var/www/ready:Z \
|
||||||
|
-w /var/www \
|
||||||
|
$IMAGE /bin/busybox-extras httpd -f -p 80
|
||||||
|
|
||||||
|
wait_for_command_output "curl -s -S $server/ready" "READY"
|
||||||
|
|
||||||
cat >$tmpdir/Dockerfile <<EOF
|
cat >$tmpdir/Dockerfile <<EOF
|
||||||
FROM $IMAGE
|
FROM $IMAGE
|
||||||
ADD https://github.com/containers/podman/blob/main/README.md /tmp/
|
ADD $server/index.txt /tmp/
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
imgname="b-$(safename)"
|
imgname="b-$(safename)"
|
||||||
run_podman build -t $imgname $tmpdir
|
run_podman build -t $imgname $tmpdir
|
||||||
run_podman run --rm $imgname stat /tmp/README.md
|
run_podman run --rm $imgname cat /tmp/index.txt
|
||||||
|
assert "$output" == "$content" "file has right content"
|
||||||
run_podman rmi -f $imgname
|
run_podman rmi -f $imgname
|
||||||
|
|
||||||
# Now test COPY. That should fail.
|
# Now test COPY. That should fail.
|
||||||
sed -i -e 's/ADD/COPY/' $tmpdir/Dockerfile
|
sed -i -e 's/ADD/COPY/' $tmpdir/Dockerfile
|
||||||
run_podman 125 build -t $imgname $tmpdir
|
run_podman 125 build -t $imgname $tmpdir
|
||||||
is "$output" ".* building at STEP .*: source can't be a URL for COPY"
|
is "$output" ".* building at STEP .*: source can't be a URL for COPY"
|
||||||
|
|
||||||
|
run_podman rm -f -t0 $serverctr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# bats test_tags=distro-integration
|
|
||||||
@test "podman build - workdir, cmd, env, label" {
|
@test "podman build - workdir, cmd, env, label" {
|
||||||
tmpdir=$PODMAN_TMPDIR/build-test
|
tmpdir=$PODMAN_TMPDIR/build-test
|
||||||
mkdir -p $tmpdir
|
mkdir -p $tmpdir
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
load helpers
|
load helpers
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman exec - basic test" {
|
@test "podman exec - basic test" {
|
||||||
rand_filename=$(random_string 20)
|
rand_filename=$(random_string 20)
|
||||||
rand_content=$(random_string 50)
|
rand_content=$(random_string 50)
|
||||||
@ -47,7 +47,6 @@ load helpers
|
|||||||
run_podman rm $cid
|
run_podman rm $cid
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration
|
|
||||||
@test "podman exec - leak check" {
|
@test "podman exec - leak check" {
|
||||||
skip_if_remote "test is meaningless over remote"
|
skip_if_remote "test is meaningless over remote"
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
load helpers
|
load helpers
|
||||||
load helpers.systemd
|
load helpers.systemd
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman pause/unpause" {
|
@test "podman pause/unpause" {
|
||||||
if is_rootless && ! is_cgroupsv2; then
|
if is_rootless && ! is_cgroupsv2; then
|
||||||
skip "'podman pause' (rootless) only works with cgroups v2"
|
skip "'podman pause' (rootless) only works with cgroups v2"
|
||||||
@ -65,7 +65,6 @@ load helpers.systemd
|
|||||||
}
|
}
|
||||||
|
|
||||||
# CANNOT BE PARALLELIZED! (because of unpause --all)
|
# CANNOT BE PARALLELIZED! (because of unpause --all)
|
||||||
# bats test_tags=distro-integration
|
|
||||||
@test "podman unpause --all" {
|
@test "podman unpause --all" {
|
||||||
if is_rootless && ! is_cgroupsv2; then
|
if is_rootless && ! is_cgroupsv2; then
|
||||||
skip "'podman pause' (rootless) only works with cgroups v2"
|
skip "'podman pause' (rootless) only works with cgroups v2"
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
load helpers
|
load helpers
|
||||||
load helpers.network
|
load helpers.network
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "events with a filter by label and --no-trunc option" {
|
@test "events with a filter by label and --no-trunc option" {
|
||||||
cname=test-$(safename)
|
cname=test-$(safename)
|
||||||
labelname=labelname-$(safename)
|
labelname=labelname-$(safename)
|
||||||
@ -161,7 +161,7 @@ function _events_disjunctive_filters() {
|
|||||||
_events_disjunctive_filters ""
|
_events_disjunctive_filters ""
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "events with events_logfile_path in containers.conf" {
|
@test "events with events_logfile_path in containers.conf" {
|
||||||
skip_if_remote "remote does not support --events-backend"
|
skip_if_remote "remote does not support --events-backend"
|
||||||
events_file=$PODMAN_TMPDIR/events.log
|
events_file=$PODMAN_TMPDIR/events.log
|
||||||
@ -183,7 +183,7 @@ function _populate_events_file() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "events log-file rotation" {
|
@test "events log-file rotation" {
|
||||||
skip_if_remote "setting CONTAINERS_CONF_OVERRIDE logger options does not affect remote client"
|
skip_if_remote "setting CONTAINERS_CONF_OVERRIDE logger options does not affect remote client"
|
||||||
|
|
||||||
|
@ -220,23 +220,33 @@ verify_iid_and_name() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "podman load - from URL" {
|
@test "podman load - from URL" {
|
||||||
get_iid_and_name
|
# Use a different image, not $IMAGE, as we need that for the webserver container.
|
||||||
run_podman save $img_name -o $archive
|
img1=${PODMAN_NONLOCAL_IMAGE_FQN}
|
||||||
run_podman rmi $iid
|
_prefetch $img1
|
||||||
|
|
||||||
|
run_podman images -a --format '{{.ID}} {{.Repository}}:{{.Tag}}' $img1
|
||||||
|
images_output="$output"
|
||||||
|
|
||||||
|
archive=$PODMAN_TMPDIR/myimage-$(safename).tar
|
||||||
|
run_podman save $img1 -o $archive
|
||||||
|
run_podman rmi $img1
|
||||||
|
|
||||||
HOST_PORT=$(random_free_port)
|
HOST_PORT=$(random_free_port)
|
||||||
SERVER=http://127.0.0.1:$HOST_PORT
|
SERVER=http://127.0.0.1:$HOST_PORT
|
||||||
|
|
||||||
# Bind-mount the archive to a container running httpd
|
# Bind-mount the archive to a container running httpd
|
||||||
|
local cname="cweb=$(safename)"
|
||||||
run_podman run -d --name myweb -p "$HOST_PORT:80" \
|
run_podman run -d --name myweb -p "$HOST_PORT:80" \
|
||||||
-v $archive:/var/www/image.tar:Z \
|
-v $archive:/var/www/image.tar:Z \
|
||||||
-w /var/www \
|
-w /var/www \
|
||||||
$IMAGE /bin/busybox-extras httpd -f -p 80
|
$IMAGE /bin/busybox-extras httpd -f -p 80
|
||||||
|
|
||||||
run_podman load -i $SERVER/image.tar
|
run_podman load -i $SERVER/image.tar
|
||||||
verify_iid_and_name $img_name
|
|
||||||
|
|
||||||
run_podman rm -f -t0 myweb
|
run_podman images -a --format '{{.ID}} {{.Repository}}:{{.Tag}}' $img1
|
||||||
|
assert "$output" == "$images_output"
|
||||||
|
|
||||||
|
run_podman rm -f -t0 $cname
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "podman load - redirect corrupt payload" {
|
@test "podman load - redirect corrupt payload" {
|
||||||
|
@ -47,7 +47,7 @@ load helpers
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Integration tag to catch future breakage in tar, e.g. #19407
|
# Integration tag to catch future breakage in tar, e.g. #19407
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman export, alter tarball, re-import" {
|
@test "podman export, alter tarball, re-import" {
|
||||||
# Create a test file following test
|
# Create a test file following test
|
||||||
mkdir $PODMAN_TMPDIR/tmp
|
mkdir $PODMAN_TMPDIR/tmp
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
load helpers
|
load helpers
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman kill - test signal handling in containers" {
|
@test "podman kill - test signal handling in containers" {
|
||||||
local cname=c-$(safename)
|
local cname=c-$(safename)
|
||||||
local fifo=${PODMAN_TMPDIR}/podman-kill-fifo.$(random_string 10)
|
local fifo=${PODMAN_TMPDIR}/podman-kill-fifo.$(random_string 10)
|
||||||
|
@ -408,7 +408,6 @@ EOF
|
|||||||
is "$output" "" "no more volumes to prune"
|
is "$output" "" "no more volumes to prune"
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration
|
|
||||||
@test "podman volume type=bind" {
|
@test "podman volume type=bind" {
|
||||||
myvoldir=${PODMAN_TMPDIR}/volume_$(random_string)
|
myvoldir=${PODMAN_TMPDIR}/volume_$(random_string)
|
||||||
mkdir $myvoldir
|
mkdir $myvoldir
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
#
|
#
|
||||||
# podman volume XFS quota tests
|
# podman volume XFS quota tests
|
||||||
#
|
#
|
||||||
# bats file_tags=distro-integration
|
|
||||||
#
|
|
||||||
|
|
||||||
load helpers
|
load helpers
|
||||||
|
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
#
|
#
|
||||||
# Tests for podman build
|
# Tests for podman build
|
||||||
#
|
#
|
||||||
# bats file_tags=distro-integration
|
|
||||||
#
|
|
||||||
|
|
||||||
load helpers
|
load helpers
|
||||||
|
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
#
|
#
|
||||||
# podman blkio-related tests
|
# podman blkio-related tests
|
||||||
#
|
#
|
||||||
# bats file_tags=distro-integration
|
|
||||||
#
|
|
||||||
|
|
||||||
load helpers
|
load helpers
|
||||||
|
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
#
|
#
|
||||||
# Tests for podman build
|
# Tests for podman build
|
||||||
#
|
#
|
||||||
# bats file_tags=distro-integration
|
|
||||||
#
|
|
||||||
|
|
||||||
load helpers
|
load helpers
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
load helpers
|
load helpers
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman test all namespaces" {
|
@test "podman test all namespaces" {
|
||||||
# format is nsname | option name
|
# format is nsname | option name
|
||||||
tests="
|
tests="
|
||||||
|
@ -185,7 +185,6 @@ function wait_for_journal() {
|
|||||||
die "Timed out waiting for '$expect_str' in journalctl output"
|
die "Timed out waiting for '$expect_str' in journalctl output"
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration
|
|
||||||
@test "quadlet - basic" {
|
@test "quadlet - basic" {
|
||||||
# Network=none is to work around a Pasta bug, can be removed once a patched Pasta is available.
|
# Network=none is to work around a Pasta bug, can be removed once a patched Pasta is available.
|
||||||
# Ref https://github.com/containers/podman/pull/21563#issuecomment-1965145324
|
# Ref https://github.com/containers/podman/pull/21563#issuecomment-1965145324
|
||||||
|
@ -116,7 +116,7 @@ function _assert_mainpid_is_conmon() {
|
|||||||
_stop_socat
|
_stop_socat
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "sdnotify : conmon" {
|
@test "sdnotify : conmon" {
|
||||||
export NOTIFY_SOCKET=$PODMAN_TMPDIR/conmon.sock
|
export NOTIFY_SOCKET=$PODMAN_TMPDIR/conmon.sock
|
||||||
_start_socat
|
_start_socat
|
||||||
@ -155,7 +155,7 @@ READY=1" "sdnotify sent MAINPID and READY"
|
|||||||
|
|
||||||
# These tests can fail in dev. environment because of SELinux.
|
# These tests can fail in dev. environment because of SELinux.
|
||||||
# quick fix: chcon -t container_runtime_exec_t ./bin/podman
|
# quick fix: chcon -t container_runtime_exec_t ./bin/podman
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "sdnotify : container" {
|
@test "sdnotify : container" {
|
||||||
_prefetch $SYSTEMD_IMAGE
|
_prefetch $SYSTEMD_IMAGE
|
||||||
|
|
||||||
@ -479,7 +479,7 @@ spec:
|
|||||||
" > $fname
|
" > $fname
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman kube play - exit-code propagation" {
|
@test "podman kube play - exit-code propagation" {
|
||||||
fname=$PODMAN_TMPDIR/$(random_string).yaml
|
fname=$PODMAN_TMPDIR/$(random_string).yaml
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@ function teardown() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# bats test_tags=distro-integration
|
|
||||||
@test "podman update - test all options" {
|
@test "podman update - test all options" {
|
||||||
local cgv=1
|
local cgv=1
|
||||||
if is_cgroupsv2; then
|
if is_cgroupsv2; then
|
||||||
|
@ -47,42 +47,42 @@ function check_label() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman selinux: confined container" {
|
@test "podman selinux: confined container" {
|
||||||
check_label "" "container_t"
|
check_label "" "container_t"
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman selinux: container with label=disable" {
|
@test "podman selinux: container with label=disable" {
|
||||||
check_label "--security-opt label=disable" "spc_t"
|
check_label "--security-opt label=disable" "spc_t"
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman selinux: privileged container" {
|
@test "podman selinux: privileged container" {
|
||||||
check_label "--privileged" "spc_t"
|
check_label "--privileged" "spc_t"
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman selinux: privileged --userns=host container" {
|
@test "podman selinux: privileged --userns=host container" {
|
||||||
check_label "--privileged --userns=host" "spc_t"
|
check_label "--privileged --userns=host" "spc_t"
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman selinux: --ipc=host container" {
|
@test "podman selinux: --ipc=host container" {
|
||||||
check_label "--ipc=host" "spc_t"
|
check_label "--ipc=host" "spc_t"
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman selinux: init container" {
|
@test "podman selinux: init container" {
|
||||||
check_label "--systemd=always" "container_init_t"
|
check_label "--systemd=always" "container_init_t"
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman selinux: init container with --security-opt type" {
|
@test "podman selinux: init container with --security-opt type" {
|
||||||
check_label "--systemd=always --security-opt=label=type:spc_t" "spc_t"
|
check_label "--systemd=always --security-opt=label=type:spc_t" "spc_t"
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman selinux: init container with --security-opt level&type" {
|
@test "podman selinux: init container with --security-opt level&type" {
|
||||||
check_label "--systemd=always --security-opt=label=level:s0:c1,c2 --security-opt=label=type:spc_t" "spc_t" "s0:c1,c2"
|
check_label "--systemd=always --security-opt=label=level:s0:c1,c2 --security-opt=label=type:spc_t" "spc_t" "s0:c1,c2"
|
||||||
}
|
}
|
||||||
@ -92,7 +92,7 @@ function check_label() {
|
|||||||
check_label "--systemd=always --security-opt=label=level:s0:c1,c2" "container_init_t" "s0:c1,c2"
|
check_label "--systemd=always --security-opt=label=level:s0:c1,c2" "container_init_t" "s0:c1,c2"
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman selinux: pid=host" {
|
@test "podman selinux: pid=host" {
|
||||||
# FIXME this test fails when run rootless with runc:
|
# FIXME this test fails when run rootless with runc:
|
||||||
# Error: container_linux.go:367: starting container process caused: process_linux.go:495: container init caused: readonly path /proc/asound: operation not permitted: OCI permission denied
|
# Error: container_linux.go:367: starting container process caused: process_linux.go:495: container init caused: readonly path /proc/asound: operation not permitted: OCI permission denied
|
||||||
@ -193,7 +193,7 @@ function check_label() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# pr #7902 - containers in pods should all run under same context
|
# pr #7902 - containers in pods should all run under same context
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman selinux: containers in pods share full context" {
|
@test "podman selinux: containers in pods share full context" {
|
||||||
skip_if_no_selinux
|
skip_if_no_selinux
|
||||||
|
|
||||||
@ -269,7 +269,6 @@ function check_label() {
|
|||||||
is "$output" "Error.*: $expect" "podman emits useful diagnostic on failure"
|
is "$output" "Error.*: $expect" "podman emits useful diagnostic on failure"
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration
|
|
||||||
@test "podman selinux: check relabel" {
|
@test "podman selinux: check relabel" {
|
||||||
skip_if_no_selinux
|
skip_if_no_selinux
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ load helpers
|
|||||||
run_podman rm myc
|
run_podman rm myc
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman run --cgroups=disabled keeps the current cgroup" {
|
@test "podman run --cgroups=disabled keeps the current cgroup" {
|
||||||
skip_if_remote "podman-remote does not support --cgroups=disabled"
|
skip_if_remote "podman-remote does not support --cgroups=disabled"
|
||||||
skip_if_rootless_cgroupsv1
|
skip_if_rootless_cgroupsv1
|
||||||
|
@ -322,7 +322,6 @@ load helpers.network
|
|||||||
}
|
}
|
||||||
|
|
||||||
# CANNOT BE PARALLELIZED due to iptables/nft commands
|
# CANNOT BE PARALLELIZED due to iptables/nft commands
|
||||||
# bats test_tags=distro-integration
|
|
||||||
@test "podman network reload" {
|
@test "podman network reload" {
|
||||||
skip_if_remote "podman network reload does not have remote support"
|
skip_if_remote "podman network reload does not have remote support"
|
||||||
|
|
||||||
@ -504,7 +503,7 @@ load helpers.network
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Test for https://github.com/containers/podman/issues/10052
|
# Test for https://github.com/containers/podman/issues/10052
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman network connect/disconnect with port forwarding" {
|
@test "podman network connect/disconnect with port forwarding" {
|
||||||
random_1=$(random_string 30)
|
random_1=$(random_string 30)
|
||||||
HOST_PORT=$(random_free_port)
|
HOST_PORT=$(random_free_port)
|
||||||
@ -778,7 +777,7 @@ nameserver 8.8.8.8" "nameserver order is correct"
|
|||||||
run_podman network rm -f $netname
|
run_podman network rm -f $netname
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=distro-integration, ci:parallel
|
# bats test_tags=ci:parallel
|
||||||
@test "podman run port forward range" {
|
@test "podman run port forward range" {
|
||||||
# we run a long loop of tests lets run all combinations before bailing out
|
# we run a long loop of tests lets run all combinations before bailing out
|
||||||
defer-assertion-failures
|
defer-assertion-failures
|
||||||
|
Reference in New Issue
Block a user