#!/bin/bash
set -f
mirror="http://archive.ubuntu.com/ubuntu/"
# --test=tests/cloud_tests/testcases/modules/write_files.py
tests=(
--test=tests/cloud_tests/testcases/modules/apt_configure_conf.py
--test=tests/cloud_tests/testcases/modules/final_message.py
--test=tests/cloud_tests/testcases/modules/user_groups.py
)
release=${1}
commitish=${2:-master}
(
set -x
git checkout "${commitish}" || { echo "failed checkout $commitish"; exit 1; }
echo "running on $commitish"
set -o pipefail
rm -Rf "../results-$release"
tox -e citest -- run \
--platform=nocloud-kvm \
--os-name="$release" \
--repo="deb $mirror $release-proposed main" \
--preserve-data \
--data-dir="../results-$release" \
--verbose \
"${tests[@]}"
) 2>&1 | tee ../results-$release.log
ret=$?
echo "exit_value=$ret" >> ../results-$release.log
tar -C ../results-$release \
-cJSf ../results-$release-artifacts.tar.xz "--exclude=*.qcow2" .
exit $ret