Skip to content

Commit

Permalink
Merge pull request #23851 from edsantiago/parallelize-low-hanging-fruit
Browse files Browse the repository at this point in the history
CI: system tests: parallelize low-hanging fruit
  • Loading branch information
openshift-merge-bot[bot] authored Sep 4, 2024
2 parents a9532c2 + bca7c20 commit 958ee48
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 7 deletions.
1 change: 1 addition & 0 deletions test/system/015-help.bats
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ function check_help() {
}


# bats test_tags=ci:parallel
@test "podman help - basic tests" {
skip_if_remote

Expand Down
3 changes: 3 additions & 0 deletions test/system/065-cp.bats
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

load helpers

# All tests here can be run in parallel
# bats file_tags=ci:parallel

@test "podman cp file from host to container" {
srcdir=$PODMAN_TMPDIR/cp-test-file-host-to-ctr
mkdir -p $srcdir
Expand Down
18 changes: 13 additions & 5 deletions test/system/075-exec.bats
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

load helpers

# bats test_tags=distro-integration
# bats test_tags=distro-integration, ci:parallel
@test "podman exec - basic test" {
rand_filename=$(random_string 20)
rand_content=$(random_string 50)
Expand Down Expand Up @@ -47,7 +47,7 @@ load helpers
run_podman rm $cid
}

# bats test_tags=distro-integration
# bats test_tags=distro-integration, ci:parallel
@test "podman exec - leak check" {
skip_if_remote "test is meaningless over remote"

Expand All @@ -69,6 +69,7 @@ load helpers

# Issue #4785 - piping to exec statement - fixed in #4818
# Issue #5046 - piping to exec truncates results (actually a conmon issue)
# bats test_tags=ci:parallel
@test "podman exec - cat from stdin" {
run_podman run -d $IMAGE top
cid="$output"
Expand All @@ -95,6 +96,7 @@ load helpers
}

# #6829 : add username to /etc/passwd inside container if --userns=keep-id
# bats test_tags=ci:parallel
@test "podman exec - with keep-id" {
skip_if_not_rootless "--userns=keep-id only works in rootless mode"
# Multiple --userns options confirm command-line override (last one wins)
Expand All @@ -109,6 +111,7 @@ load helpers
}

# #11496: podman-remote loses output
# bats test_tags=ci:parallel
@test "podman exec/run - missing output" {
local bigfile=${PODMAN_TMPDIR}/bigfile
local newfile=${PODMAN_TMPDIR}/newfile
Expand Down Expand Up @@ -136,6 +139,7 @@ load helpers
run_podman rm -t 0 -f $cid
}

# bats test_tags=ci:parallel
@test "podman run umask" {
umask="0724"
run_podman run --rm -q $IMAGE grep Umask /proc/self/status
Expand All @@ -162,6 +166,7 @@ load helpers
run_podman rm -f -t0 $cid
}

# bats test_tags=ci:parallel
@test "podman exec --tty" {
# Run all tests, report failures at end
defer-assertion-failures
Expand All @@ -173,7 +178,8 @@ load helpers
if [[ -n "$run_term_env" ]]; then
run_opt_env="--env=TERM=$run_term_env"
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
for exec_opt_t in "" "-t"; do
Expand All @@ -196,16 +202,17 @@ load helpers
fi

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"
done
done

run_podman rm -f -t0 test
run_podman rm -f -t0 $cname
done
done
}

# bats test_tags=ci:parallel
@test "podman exec - does not leak session IDs on invalid command" {
run_podman run -d $IMAGE top
cid="$output"
Expand All @@ -222,6 +229,7 @@ load helpers
}

# 'exec --preserve-fd' passes a list of additional file descriptors into the container
# bats test_tags=ci:parallel
@test "podman exec --preserve-fd" {
skip_if_remote "preserve-fd is meaningless over remote"

Expand Down
9 changes: 8 additions & 1 deletion test/system/271-tcp-cors-server.bats
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ SERVICE_TCP_HOST="localhost"
SERVICE_FILE="$UNIT_DIR/$SERVICE_NAME.service"
SOCKET_FILE="$UNIT_DIR/$SERVICE_NAME.socket"

# bats test_tags=ci:parallel
@test "podman system service - tcp CORS" {
skip_if_remote "system service tests are meaningless over remote"
PORT=$(random_free_port 63000-64999)
Expand All @@ -30,6 +31,7 @@ SOCKET_FILE="$UNIT_DIR/$SERVICE_NAME.socket"
"podman warns about server on TCP"
}

# bats test_tags=ci:parallel
@test "podman system service - tcp without CORS" {
skip_if_remote "system service tests are meaningless over remote"
PORT=$(random_free_port 63000-64999)
Expand All @@ -41,10 +43,15 @@ SOCKET_FILE="$UNIT_DIR/$SERVICE_NAME.socket"
wait $podman_pid || true
}

# bats test_tags=ci:parallel
@test "podman system service - CORS enabled in logs" {
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"
assert "$output" =~ "level=warning msg=\"Using the Podman API service with TCP sockets is not recommended" \
"TCP socket warning"
}

# vim: filetype=sh
3 changes: 2 additions & 1 deletion test/system/420-cgroups.bats
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

load helpers

# bats test_tags=ci:parallel
@test "podman run, preserves initial --cgroup-manager" {
skip_if_remote "podman-remote does not support --cgroup-manager"

Expand Down Expand Up @@ -37,7 +38,7 @@ load helpers
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" {
skip_if_remote "podman-remote does not support --cgroups=disabled"
skip_if_rootless_cgroupsv1
Expand Down
2 changes: 2 additions & 0 deletions test/system/600-completion.bats
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ function _check_no_suggestions() {
}


# bats test_tags=ci:parallel
@test "podman shell completion test" {

random_container_name="c-$(safename)"
Expand Down Expand Up @@ -351,6 +352,7 @@ function _check_no_suggestions() {
done
}

# bats test_tags=ci:parallel
@test "podman shell completion for paths in container/image" {
skip_if_remote "mounting via remote does not work"
for cmd in create run; do
Expand Down
1 change: 1 addition & 0 deletions test/system/620-option-conflicts.bats
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
load helpers


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

Expand Down

1 comment on commit 958ee48

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

podman-next COPR build failed. @containers/packit-build please check.

Please sign in to comment.