Merge pull request #23851 from edsantiago/parallelize-low-hanging-fruit

CI: system tests: parallelize low-hanging fruit
This commit is contained in:
openshift-merge-bot[bot]
2024-09-04 09:47:23 +00:00
committed by GitHub
7 changed files with 30 additions and 7 deletions

View File

@@ -196,6 +196,7 @@ function check_help() {
} }
# bats test_tags=ci:parallel
@test "podman help - basic tests" { @test "podman help - basic tests" {
skip_if_remote skip_if_remote

View File

@@ -7,6 +7,9 @@
load helpers load helpers
# All tests here can be run in parallel
# bats file_tags=ci:parallel
@test "podman cp file from host to container" { @test "podman cp file from host to container" {
srcdir=$PODMAN_TMPDIR/cp-test-file-host-to-ctr srcdir=$PODMAN_TMPDIR/cp-test-file-host-to-ctr
mkdir -p $srcdir mkdir -p $srcdir

View File

@@ -5,7 +5,7 @@
load helpers load helpers
# bats test_tags=distro-integration # bats test_tags=distro-integration, 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,7 @@ load helpers
run_podman rm $cid run_podman rm $cid
} }
# bats test_tags=distro-integration # bats test_tags=distro-integration, ci:parallel
@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"
@@ -69,6 +69,7 @@ load helpers
# Issue #4785 - piping to exec statement - fixed in #4818 # Issue #4785 - piping to exec statement - fixed in #4818
# Issue #5046 - piping to exec truncates results (actually a conmon issue) # Issue #5046 - piping to exec truncates results (actually a conmon issue)
# bats test_tags=ci:parallel
@test "podman exec - cat from stdin" { @test "podman exec - cat from stdin" {
run_podman run -d $IMAGE top run_podman run -d $IMAGE top
cid="$output" cid="$output"
@@ -95,6 +96,7 @@ load helpers
} }
# #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=ci:parallel
@test "podman exec - with keep-id" { @test "podman exec - with 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"
# Multiple --userns options confirm command-line override (last one wins) # Multiple --userns options confirm command-line override (last one wins)
@@ -109,6 +111,7 @@ load helpers
} }
# #11496: podman-remote loses output # #11496: podman-remote loses output
# bats test_tags=ci:parallel
@test "podman exec/run - missing output" { @test "podman exec/run - missing output" {
local bigfile=${PODMAN_TMPDIR}/bigfile local bigfile=${PODMAN_TMPDIR}/bigfile
local newfile=${PODMAN_TMPDIR}/newfile local newfile=${PODMAN_TMPDIR}/newfile
@@ -136,6 +139,7 @@ load helpers
run_podman rm -t 0 -f $cid run_podman rm -t 0 -f $cid
} }
# bats test_tags=ci:parallel
@test "podman run umask" { @test "podman run umask" {
umask="0724" umask="0724"
run_podman run --rm -q $IMAGE grep Umask /proc/self/status run_podman run --rm -q $IMAGE grep Umask /proc/self/status
@@ -162,6 +166,7 @@ load helpers
run_podman rm -f -t0 $cid run_podman rm -f -t0 $cid
} }
# bats test_tags=ci:parallel
@test "podman exec --tty" { @test "podman exec --tty" {
# Run all tests, report failures at end # Run all tests, report failures at end
defer-assertion-failures defer-assertion-failures
@@ -173,7 +178,8 @@ load helpers
if [[ -n "$run_term_env" ]]; then if [[ -n "$run_term_env" ]]; then
run_opt_env="--env=TERM=$run_term_env" run_opt_env="--env=TERM=$run_term_env"
fi fi
run_podman run -d $run_opt_t $run_opt_env --name test $IMAGE top cname="c-${run_opt_t}-${run_term_env}-$(safename)"
run_podman run -d $run_opt_t $run_opt_env --name $cname $IMAGE top
# Inner loops: different variations on EXEC # Inner loops: different variations on EXEC
for exec_opt_t in "" "-t"; do for exec_opt_t in "" "-t"; do
@@ -196,16 +202,17 @@ load helpers
fi fi
local desc="run $run_opt_t $run_opt_env, exec $exec_opt_t $exec_opt_env" local desc="run $run_opt_t $run_opt_env, exec $exec_opt_t $exec_opt_env"
TERM=exec-term run_podman exec $exec_opt_t $exec_opt_env test sh -c 'echo -n $TERM' TERM=exec-term run_podman exec $exec_opt_t $exec_opt_env $cname sh -c 'echo -n $TERM'
assert "$output" = "$expected" "$desc" assert "$output" = "$expected" "$desc"
done done
done done
run_podman rm -f -t0 test run_podman rm -f -t0 $cname
done done
done done
} }
# bats test_tags=ci:parallel
@test "podman exec - does not leak session IDs on invalid command" { @test "podman exec - does not leak session IDs on invalid command" {
run_podman run -d $IMAGE top run_podman run -d $IMAGE top
cid="$output" cid="$output"
@@ -222,6 +229,7 @@ load helpers
} }
# 'exec --preserve-fd' passes a list of additional file descriptors into the container # 'exec --preserve-fd' passes a list of additional file descriptors into the container
# bats test_tags=ci:parallel
@test "podman exec --preserve-fd" { @test "podman exec --preserve-fd" {
skip_if_remote "preserve-fd is meaningless over remote" skip_if_remote "preserve-fd is meaningless over remote"

View File

@@ -13,6 +13,7 @@ SERVICE_TCP_HOST="localhost"
SERVICE_FILE="$UNIT_DIR/$SERVICE_NAME.service" SERVICE_FILE="$UNIT_DIR/$SERVICE_NAME.service"
SOCKET_FILE="$UNIT_DIR/$SERVICE_NAME.socket" SOCKET_FILE="$UNIT_DIR/$SERVICE_NAME.socket"
# bats test_tags=ci:parallel
@test "podman system service - tcp CORS" { @test "podman system service - tcp CORS" {
skip_if_remote "system service tests are meaningless over remote" skip_if_remote "system service tests are meaningless over remote"
PORT=$(random_free_port 63000-64999) PORT=$(random_free_port 63000-64999)
@@ -30,6 +31,7 @@ SOCKET_FILE="$UNIT_DIR/$SERVICE_NAME.socket"
"podman warns about server on TCP" "podman warns about server on TCP"
} }
# bats test_tags=ci:parallel
@test "podman system service - tcp without CORS" { @test "podman system service - tcp without CORS" {
skip_if_remote "system service tests are meaningless over remote" skip_if_remote "system service tests are meaningless over remote"
PORT=$(random_free_port 63000-64999) PORT=$(random_free_port 63000-64999)
@@ -41,10 +43,15 @@ SOCKET_FILE="$UNIT_DIR/$SERVICE_NAME.socket"
wait $podman_pid || true wait $podman_pid || true
} }
# bats test_tags=ci:parallel
@test "podman system service - CORS enabled in logs" { @test "podman system service - CORS enabled in logs" {
skip_if_remote "system service tests are meaningless over remote" skip_if_remote "system service tests are meaningless over remote"
run_podman system service --log-level="debug" --cors="*" -t 1
PORT=$(random_free_port 63000-64999)
run_podman 0+w system service --log-level="debug" --cors="*" -t 1 tcp:$SERVICE_TCP_HOST:$PORT
is "$output" ".*CORS Headers were set to ..\*...*" "debug log confirms CORS headers set" is "$output" ".*CORS Headers were set to ..\*...*" "debug log confirms CORS headers set"
assert "$output" =~ "level=warning msg=\"Using the Podman API service with TCP sockets is not recommended" \
"TCP socket warning"
} }
# vim: filetype=sh # vim: filetype=sh

View File

@@ -5,6 +5,7 @@
load helpers load helpers
# bats test_tags=ci:parallel
@test "podman run, preserves initial --cgroup-manager" { @test "podman run, preserves initial --cgroup-manager" {
skip_if_remote "podman-remote does not support --cgroup-manager" skip_if_remote "podman-remote does not support --cgroup-manager"
@@ -37,7 +38,7 @@ load helpers
run_podman rm myc run_podman rm myc
} }
# bats test_tags=distro-integration # bats test_tags=distro-integration, 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

View File

@@ -262,6 +262,7 @@ function _check_no_suggestions() {
} }
# bats test_tags=ci:parallel
@test "podman shell completion test" { @test "podman shell completion test" {
random_container_name="c-$(safename)" random_container_name="c-$(safename)"
@@ -351,6 +352,7 @@ function _check_no_suggestions() {
done done
} }
# bats test_tags=ci:parallel
@test "podman shell completion for paths in container/image" { @test "podman shell completion for paths in container/image" {
skip_if_remote "mounting via remote does not work" skip_if_remote "mounting via remote does not work"
for cmd in create run; do for cmd in create run; do

View File

@@ -6,6 +6,7 @@
load helpers load helpers
# bats test_tags=ci:parallel
@test "options that cannot be set together" { @test "options that cannot be set together" {
skip_if_remote "not much point testing remote, and container-cleanup fails anyway" skip_if_remote "not much point testing remote, and container-cleanup fails anyway"