You must login to view /lordwelch/podman-static/src/commit/5e5cf8f8555a2a199ad64de012921e13709b6d04/test.
The GitHub option should be usable for most people, it only links via username.

Files
podman-static/test/tar.bats
Max Goltzsche 42d5e903f2 fix: don't publish quadlet with image but with tar
Add a separate stage to the Dockerfile to build the root file system of the tar archive and make the tar targets within the Makefile build that stage.

Relates to #120
2025-03-14 02:58:32 +01:00

27 lines
853 B
Bash

#!/usr/bin/env bats
: ${DOCKER:=docker}
: ${PODMAN_TAR_IMAGE:=mgoltzsche/podman:latest-tar}
@test "tar - quadlet - generate service" {
if [ "${TEST_SKIP_QUADLET:-}" = true ]; then
skip "TEST_SKIP_QUADLET=true"
fi
$DOCKER run --rm -u podman:podman \
-v "$BATS_TEST_DIRNAME/quadlet/hello_world.container:/etc/containers/systemd/hello_world.container" \
--pull=never "${PODMAN_TAR_IMAGE}" \
/usr/local/libexec/podman/quadlet -dryrun > /tmp/test.service # this goes to tmp because we are not root below
expected_values=(
"--name hello_world"
"--publish 8080:8080"
"--env HELLO=WORLD"
"docker.io/hello-world"
)
for value in "${expected_values[@]}"; do
run grep -q -- "$value" "/tmp/test.service"
[ "$status" -eq 0 ] || fail "Expected '$value' not found in /tmp/test.service"
done
}