Skip to content

Commit ca19491

Browse files
Merge pull request #26947 from Luap99/system-test-fixes
test/system: some small fixes
2 parents 9d7a24e + 247a80d commit ca19491

25 files changed

+70
-61
lines changed

hack/bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $0 is a wrapper for invoking podman system tests.
2424
match that string.
2525
2626
--tag=TAG Passed on to bats as '--filter-tags TAG'
27-
As of 2023-07-26 the only tag used is 'distro-integration'
27+
As of 2025-09-01 the only tag used is 'ci:parallel'
2828
2929
-t, --tap Passed on to bats, which will format output in TAP format
3030

test/system/001-basic.bats

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ function setup() {
1414

1515
#### DO NOT ADD ANY TESTS HERE! ADD NEW TESTS AT BOTTOM!
1616

17-
# bats test_tags=distro-integration
1817
@test "podman version emits reasonable output" {
1918
run_podman version
2019

@@ -37,7 +36,6 @@ function setup() {
3736
is "$output" "podman.*version \+" "'Version line' in output"
3837
}
3938

40-
# bats test_tags=distro-integration
4139
@test "podman info" {
4240
# These will be displayed on the test output stream, offering an
4341
# at-a-glance overview of important system configuration details
@@ -72,7 +70,6 @@ function setup() {
7270
"--context=swarm should fail"
7371
}
7472

75-
# bats test_tags=distro-integration
7673
@test "podman can pull an image" {
7774
run_podman rmi -a -f
7875

test/system/030-run.bats

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ load helpers
44
load helpers.network
55
load helpers.registry
66

7-
# bats test_tags=distro-integration, ci:parallel
7+
# bats test_tags=ci:parallel
88
@test "podman run - basic tests" {
99
rand=$(random_string 30)
1010

@@ -352,7 +352,7 @@ echo $rand | 0 | $rand
352352
}
353353

354354
# #6829 : add username to /etc/passwd inside container if --userns=keep-id
355-
# bats test_tags=distro-integration, ci:parallel
355+
# bats test_tags=ci:parallel
356356
@test "podman run : add username to /etc/passwd if --userns=keep-id" {
357357
skip_if_not_rootless "--userns=keep-id only works in rootless mode"
358358
# Default: always run as root
@@ -829,7 +829,6 @@ json-file | f
829829
# podman exec may truncate stdout/stderr; actually a bug in conmon:
830830
# https://github.com/containers/conmon/issues/236
831831
# CANNOT BE PARALLELIZED due to "-l"
832-
# bats test_tags=distro-integration
833832
@test "podman run - does not truncate or hang with big output" {
834833
# Size, in bytes, to dd and to expect in return
835834
char_count=700000
@@ -1147,7 +1146,7 @@ EOF
11471146
run_podman rm $output
11481147
}
11491148

1150-
# bats test_tags=distro-integration, ci:parallel
1149+
# bats test_tags=ci:parallel
11511150
@test "podman run --device-read-bps" {
11521151
skip_if_rootless "cannot use this flag in rootless mode"
11531152

test/system/032-sig-proxy.bats

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ load helpers
44
load helpers.sig-proxy
55

66
# Each of the tests below does some setup, then invokes the helper from helpers.sig-proxy.bash.
7-
8-
# bats test_tags=distro-integration
97
@test "podman sigproxy test: run" {
108
# We're forced to use $PODMAN because run_podman cannot be backgrounded
119
$PODMAN run -i --name c_run $IMAGE sh -c "$SLEEPLOOP" &

test/system/035-logs.bats

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ timeout: sending signal TERM to command.*" "logs --since -f on running container
354354
_log_test_follow_since k8s-file
355355
}
356356

357-
# bats test_tags=distro-integration, ci:parallel
357+
# bats test_tags=ci:parallel
358358
@test "podman logs - --since --follow journald" {
359359
# We can't use journald on RHEL as rootless: rhbz#1895105
360360
skip_if_journald_unavailable
@@ -398,7 +398,7 @@ $content--2.*" "logs --until -f on running container works"
398398
_log_test_follow_until k8s-file
399399
}
400400

401-
# bats test_tags=distro-integration, ci:parallel
401+
# bats test_tags=ci:parallel
402402
@test "podman logs - --until --follow journald" {
403403
# We can't use journald on RHEL as rootless: rhbz#1895105
404404
skip_if_journald_unavailable

test/system/060-mount.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ EOF
362362
is "$output" "bar1.*bar2.*bar3" "Should match multiple source files on single destination directory"
363363
}
364364

365-
# bats test_tags=distro-integration,ci:parallel
365+
# bats test_tags=ci:parallel
366366
@test "podman mount noswap memory mounts" {
367367
# tmpfs+noswap new in kernel 6.x, mid-2023; likely not in RHEL for a while
368368
if ! is_rootless; then

test/system/070-build.bats

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#
66

77
load helpers
8+
load helpers.network
89

9-
# bats test_tags=distro-integration
1010
@test "podman build - basic test" {
1111
rand_filename=$(random_string 20)
1212
rand_content=$(random_string 50)
@@ -279,24 +279,44 @@ EOF
279279
tmpdir=$PODMAN_TMPDIR/build-test
280280
mkdir -p $tmpdir
281281

282+
# Create a test file with random content
283+
INDEX=$PODMAN_TMPDIR/index.txt
284+
local content="test-$(random_string)"
285+
echo "$content" > $INDEX
286+
echo READY > $PODMAN_TMPDIR/ready
287+
288+
# Setup local webserver
289+
local host_port=$(random_free_port)
290+
local server=http://127.0.0.1:$host_port
291+
serverctr="c1-$(safename)"
292+
run_podman run -d --name $serverctr -p "$host_port:80" \
293+
-v $INDEX:/var/www/index.txt:Z \
294+
-v $PODMAN_TMPDIR/ready:/var/www/ready:Z \
295+
-w /var/www \
296+
$IMAGE /bin/busybox-extras httpd -f -p 80
297+
298+
wait_for_command_output "curl -s -S $server/ready" "READY"
299+
282300
cat >$tmpdir/Dockerfile <<EOF
283301
FROM $IMAGE
284-
ADD https://github.com/containers/podman/blob/main/README.md /tmp/
302+
ADD $server/index.txt /tmp/
285303
EOF
286304

287305
imgname="b-$(safename)"
288306
run_podman build -t $imgname $tmpdir
289-
run_podman run --rm $imgname stat /tmp/README.md
307+
run_podman run --rm $imgname cat /tmp/index.txt
308+
assert "$output" == "$content" "file has right content"
290309
run_podman rmi -f $imgname
291310

292311
# Now test COPY. That should fail.
293312
sed -i -e 's/ADD/COPY/' $tmpdir/Dockerfile
294313
run_podman 125 build -t $imgname $tmpdir
295314
is "$output" ".* building at STEP .*: source can't be a URL for COPY"
315+
316+
run_podman rm -f -t0 $serverctr
296317
}
297318

298319

299-
# bats test_tags=distro-integration
300320
@test "podman build - workdir, cmd, env, label" {
301321
tmpdir=$PODMAN_TMPDIR/build-test
302322
mkdir -p $tmpdir

test/system/075-exec.bats

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
load helpers
77

8-
# bats test_tags=distro-integration, ci:parallel
8+
# bats test_tags=ci:parallel
99
@test "podman exec - basic test" {
1010
rand_filename=$(random_string 20)
1111
rand_content=$(random_string 50)
@@ -47,7 +47,6 @@ load helpers
4747
run_podman rm $cid
4848
}
4949

50-
# bats test_tags=distro-integration
5150
@test "podman exec - leak check" {
5251
skip_if_remote "test is meaningless over remote"
5352

test/system/080-pause.bats

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
load helpers
77
load helpers.systemd
88

9-
# bats test_tags=distro-integration, ci:parallel
9+
# bats test_tags=ci:parallel
1010
@test "podman pause/unpause" {
1111
if is_rootless && ! is_cgroupsv2; then
1212
skip "'podman pause' (rootless) only works with cgroups v2"
@@ -65,7 +65,6 @@ load helpers.systemd
6565
}
6666

6767
# CANNOT BE PARALLELIZED! (because of unpause --all)
68-
# bats test_tags=distro-integration
6968
@test "podman unpause --all" {
7069
if is_rootless && ! is_cgroupsv2; then
7170
skip "'podman pause' (rootless) only works with cgroups v2"

test/system/090-events.bats

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
load helpers
77
load helpers.network
88

9-
# bats test_tags=distro-integration, ci:parallel
9+
# bats test_tags=ci:parallel
1010
@test "events with a filter by label and --no-trunc option" {
1111
cname=test-$(safename)
1212
labelname=labelname-$(safename)
@@ -161,7 +161,7 @@ function _events_disjunctive_filters() {
161161
_events_disjunctive_filters ""
162162
}
163163

164-
# bats test_tags=distro-integration, ci:parallel
164+
# bats test_tags=ci:parallel
165165
@test "events with events_logfile_path in containers.conf" {
166166
skip_if_remote "remote does not support --events-backend"
167167
events_file=$PODMAN_TMPDIR/events.log
@@ -183,7 +183,7 @@ function _populate_events_file() {
183183
done
184184
}
185185

186-
# bats test_tags=distro-integration, ci:parallel
186+
# bats test_tags=ci:parallel
187187
@test "events log-file rotation" {
188188
skip_if_remote "setting CONTAINERS_CONF_OVERRIDE logger options does not affect remote client"
189189

0 commit comments

Comments
 (0)