test: Drop support for running tests with podman

When testing in the host's namespace, only docker seems to offer the
required capabilities (due to its daemon/client architecture).

Qeneth tests can still be run in podman. Users will have to install
the docker wrappers for podman to make use of this.
This commit is contained in:
Tobias Waldekranz
2024-05-17 23:42:18 +02:00
parent 3ae03c5ded
commit 23469bbe3b
4 changed files with 14 additions and 28 deletions
+7 -4
View File
@@ -103,10 +103,9 @@ executed.
Several technologies are leveraged to accomplish this:
- **Containers**: The entire execution is optionally done inside a
standardized container environment, using either `podman` or
`docker`. This ensures that the software needed to run the test
suite is always available, no matter which distribution the user is
running on their machine.
standardized `docker` container environment. This ensures that the
software needed to run the test suite is always available, no matter
which distribution the user is running on their machine.
- **Python Virtual Environments**: To make sure that the expected
versions of all Python packages are available, the execution is
@@ -119,6 +118,10 @@ Several technologies are leveraged to accomplish this:
optionally be started with a virtual topology of DUTs to run the
tests on.
> `docker` is the only supported container environment when running
> tests in the host's network namespace. When running on a virtual
> Qeneth topology, `podman` may also be used by installing the
> `podman-docker` package from your host system's distro.
Interactive Usage
-----------------
+1 -18
View File
@@ -14,27 +14,10 @@ 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
docker ps -f name='infamy.*' --format '{{.Names}}' |tail -1
}
+5 -5
View File
@@ -85,7 +85,7 @@ name()
nm=infamy
id=0
names=$($(runner) ps -f name='infamy.*' --format '{{.Names}}')
names=$(docker ps -f name='infamy.*' --format '{{.Names}}')
while true; do
name="$nm$id"
unset hit
@@ -114,9 +114,9 @@ files=
while getopts "cCf:hiKp:q:t:" opt; do
case ${opt} in
c)
$(runner) image prune -af
$(runner) volume prune -f
$(runner) container prune -f
docker image prune -af
docker volume prune -f
docker container prune -f
exit 0
;;
C)
@@ -153,7 +153,7 @@ done
if [ "$containerize" ]; then
# shellcheck disable=SC2016
exec $(runner) run \
exec docker run \
--cap-add=NET_RAW \
--cap-add=NET_ADMIN \
--device=/dev/net/tun \
+1 -1
View File
@@ -17,4 +17,4 @@ usage()
sys=$1
[ -n "$sys" ] || sys=$(infamy)
$(runner) exec -it --workdir "$ixdir/test" "$sys" ./env -C sh
docker exec -it --workdir "$ixdir/test" "$sys" ./env -C sh