We are mounting the topotests from the host into the container
and mark them as read-only to avoid any modifications to the host.
Pytest tries to create a .pytest_chache directory in that location
which fails because of the read-only mount.
Configure a different cache dir which is writable to resolve this.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
if [ $# -eq 0 ] || ([[ "$1" != /* ]] && [[ "$1" != ./* ]]); then
export TOPOTESTS_CHECK_MEMLEAK=/tmp/memleak_
export TOPOTESTS_CHECK_STDERR=Yes
- set -- pytest --junitxml /tmp/topotests.xml "$@"
+ set -- pytest \
+ --junitxml /tmp/topotests.xml \
+ -o cache_dir=/tmp \
+ "$@"
fi
exec "$@"