#!/bin/sh

set -e -u

cp -va tests "$AUTOPKGTEST_TMP"/
cd "$AUTOPKGTEST_TMP"

# create cache dir; upstream code assumes this directory exists,
# without it there are several failures in test_cert_gen
mkdir -vp tests/cache

echo "Running testsuite with default python3 version:"
# disable some tests:
# test_publicipv4: requires a configured interface and network access
# test_extract_pot: only relevant for internal upstream use
# test_functional_config: *** cannot test locally, tbd if these run on salsa-ci ***
# test_functional_downloads: needs network access and usenet server credentials
CI=TRUE PYTHONPATH=/usr/share/sabnzbdplus python3 -m pytest -k "tests and \
	not (test_publicipv4 or test_extract_pot or test_functional_config or test_functional_downloads)"
