| 1 |
#!/bin/bash -ex |
| 2 |
|
| 3 |
# KRB5_PROVIDER and DEBIAN_VERSION can be set to run tests against different |
| 4 |
# versions. A full test suite before release should be run with |
| 5 |
# DEBIAN_VERSION=10 KRB5_PROVIDER=mit build_helpers/run-container.sh |
| 6 |
# DEBIAN_VERSION=10 KRB5_PROVIDER=heimdal build_helpers/run-container.sh |
| 7 |
# DEBIAN_VERSION=11 KRB5_PROVIDER=mit build_helpers/run-container.sh |
| 8 |
# DEBIAN_VERSION=12 KRB5_PROVIDER=mit build_helpers/run-container.sh |
| 9 |
|
| 10 |
export DEBIAN_VERSION="${DEBIAN_VERSION:-10}" |
| 11 |
|
| 12 |
docker run \ |
| 13 |
--rm \ |
| 14 |
--interactive \ |
| 15 |
--hostname test.krbtest.com \ |
| 16 |
--volume "$( pwd )":/tmp/build:z \ |
| 17 |
--workdir /tmp/build \ |
| 18 |
--env KRB5_PROVIDER=${KRB5_PROVIDER:-mit} \ |
| 19 |
--env DEBIAN_VERSION=${DEBIAN_VERSION} \ |
| 20 |
debian:${DEBIAN_VERSION} /bin/bash -ex -c 'source /dev/stdin' << 'EOF' |
| 21 |
|
| 22 |
source ./build_helpers/lib.sh |
| 23 |
lib::setup::system_requirements |
| 24 |
|
| 25 |
apt-get -y install \ |
| 26 |
python3 \ |
| 27 |
python3-{dev,pip,venv} |
| 28 |
|
| 29 |
. /etc/os-release |
| 30 |
if [ "$VERSION_ID" = "10" ]; then |
| 31 |
ln -s /usr/bin/python3 /usr/bin/python |
| 32 |
else |
| 33 |
python3 -m venv .venv |
| 34 |
source .venv/bin/activate |
| 35 |
fi |
| 36 |
|
| 37 |
python -m pip install build |
| 38 |
python -m build |
| 39 |
lib::setup::python_requirements |
| 40 |
|
| 41 |
# Ensure we don't pollute the local dir + mypy doesn't like this |
| 42 |
rm -rf dist |
| 43 |
rm -rf build |
| 44 |
|
| 45 |
lib::sanity::run |
| 46 |
|
| 47 |
export PYTEST_ADDOPTS="--color=yes" |
| 48 |
lib::tests::run |
| 49 |
EOF |