Files
infix/test/.env
T
Ahmed KaricandAhmed Karic 86c562d3b3 test: introduce image test-mode within the test environment
- The test mode, introduced at the config/build phase (commit 241f3f2),
causes the device to start in test-mode when used in GNS3 (or other
environments). This has unintentionally become the default
configuration for the image, which is not desirable and is only
acceptable for the Infix test system. With this update, the original
configuration is preserved, and the test mode is applied only within
the test environment.

- Align the 'dual' topology to use the same template as 'quad'

Fixes #603
2024-09-23 15:35:21 +02:00

49 lines
1.0 KiB
Bash

# Set $testdir before sourcing these envs -*-shell-script-*-
# shellcheck disable=SC2034,SC2154
# Current container image
INFIX_TEST=ghcr.io/kernelkit/infix-test:1.9
ixdir=$(readlink -f "$testdir/..")
logdir=$(readlink -f "$testdir/.log")
envdir="$HOME/.infix/venv"
qeneth="$testdir/qeneth/qeneth"
runners="podman docker"
#
# Interactive prompt in 'make test-sh'
#
build_ps1()
{
local time="\[\e[1;32m\]" # Bold green for time
local host="\[\e[1;34m\]" # Bold blue for hostname
local dir="\[\e[1;33m\]" # Bold yellow for working directory
local reset="\[\e[0m\]" # Reset color
printf "${time}\$(date "+%%H:%%M:%%S") ${host}\h$1${reset}:${dir}\W${reset} # "
}
#
# 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
}