diff --git a/doc/testing.md b/doc/testing.md index 57e67e55..ecd56a65 100644 --- a/doc/testing.md +++ b/doc/testing.md @@ -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 ----------------- diff --git a/test/.env b/test/.env index 59be7453..2621a34c 100644 --- a/test/.env +++ b/test/.env @@ -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 } diff --git a/test/env b/test/env index 86bf8e3c..6871bb7e 100755 --- a/test/env +++ b/test/env @@ -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 \ diff --git a/test/shell b/test/shell index 8ae6dfdc..e1307b9f 100755 --- a/test/shell +++ b/test/shell @@ -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