Files
infix/test/.env
T
Tobias Waldekranz e65625e32f test: Add support for attaching to devices via SSH
Support the familiar subprocess.run API, and runsh from netns.py.

This should only be used for debugging, or in the rare instances when
we want to test functionality that is not available via NETCONF.
2024-05-20 16:21:06 +02:00

41 lines
791 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"
build_ps1()
{
echo "\e[1m\$(date \"+%H:%M:%S\") \h$1\e[0m:\W # "
}
#
# Figure out available container runner
#
runner()
{
if which podman >/dev/null; then
runner=podman
elif which docker >/dev/null; then
runner=docker
else
echo "Error: Neither podman or docker is installed, we recommend podman."
exit 1
fi
echo "$runner"
}
#
# Returns the latest started infamy container
#
infamy()
{
$(runner) ps -f name='infamy.*' --format '{{.Names}}' |tail -1
}