#!/bin/sh

set -eu

. debian/tests/common

arch=$(dpkg --print-architecture)
vendor=$(dpkg-vendor --query Vendor)
if [ "${arch}" = "armhf" ] && [ "${vendor}" = "Ubuntu" ]; then
    if systemd-detect-virt --container > /dev/null; then
        echo "WARNING: Skipping this test on Ubuntu armhf LXD."
        echo "The way armhf LXD containers are setup prevents the test from completing."
        echo "See LP: #2051118 for details."
        exit 77
    fi
fi

# make sure "python" points to python3 as this is not configurable
# in the regression script
mkdir python3env
ln -s /usr/bin/python3 python3env/python

echo "Running test suite ..."
PATH="$(pwd)/python3env:$PATH" ./regression -T live -m python
