mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
Partial revert of 23469bbe3b. When running tests in a GitHub action,
we do not want to run as host root user. Therefore, restore podman as
the default runner, but make sure to prefer docker when attaching to
the host network namespace.
41 lines
761 B
Bash
41 lines
761 B
Bash
# Set $testdir before sourcing these envs -*-shell-script-*-
|
|
# shellcheck disable=SC2034,SC2154
|
|
|
|
# Current container image
|
|
INFIX_TEST=ghcr.io/kernelkit/infix-test:1.4
|
|
|
|
ixdir=$(readlink -f "$testdir/..")
|
|
logdir=$(readlink -f "$testdir/.log")
|
|
envdir="$HOME/.infix-test-venv"
|
|
qeneth="$testdir/qeneth/qeneth"
|
|
runners="podman docker"
|
|
|
|
build_ps1()
|
|
{
|
|
echo "\e[1m\$(date \"+%H:%M:%S\") \h$1\e[0m:\W # "
|
|
}
|
|
|
|
#
|
|
# Figure out available container runner
|
|
#
|
|
runner()
|
|
{
|
|
for r in $runners; do
|
|
which $r >/dev/null && {
|
|
echo $r
|
|
return
|
|
}
|
|
done
|
|
|
|
echo "ERROR: No container manager found (tried \"$runners\")" >&2
|
|
exit 1
|
|
}
|
|
|
|
#
|
|
# Returns the latest started infamy container
|
|
#
|
|
infamy()
|
|
{
|
|
$(runner) ps -f name='infamy.*' --format '{{.Names}}' |tail -1
|
|
}
|