distro/tests: support test-distro.sh exec from any directory

parent dc71999c
......@@ -3,17 +3,21 @@
# ./test-distro.sh {devel|latest} {distro}
# Example usage: ./test-distro.sh devel debian9
pkgtestdir="$(dirname ${0})"
repofile="$pkgtestdir/repos.yaml"
distro=$2
repo=$1
# Select repos
echo -e 'repos:\n - knot-resolver-latest' > repos.yaml # latest is needed for knot
# TODO: enable knot-dns-devel
echo -e 'repos:\n - knot-resolver-latest' > $repofile # latest is needed for knot
case "$repo" in
devel)
echo -e ' - knot-resolver-devel' >> repos.yaml
echo -e ' - knot-resolver-devel' >> $repofile
;;
testing)
echo -e 'repos:\n - knot-resolver-testing' > repos.yaml
echo -e 'repos:\n - knot-resolver-testing' > $repofile
;;
latest)
;;
......@@ -23,9 +27,10 @@ case "$repo" in
;;
esac
cd "$distro"
pushd "$pkgtestdir/$distro"
vagrant destroy -f &>/dev/null
vagrant up
ret=$?
vagrant destroy -f &>/dev/null
popd
exit $ret
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment