summaryrefslogtreecommitdiffstats
path: root/distro/tests/test-distro.sh
blob: 55b75d0614920c0fd403a17eb1f37ea2d7f9758c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash -x
# SPDX-License-Identifier: GPL-3.0-or-later

# ./test-distro.sh {obs_repo} {distro}
# Example usage: ./test-distro.sh knot-resolver-devel debian9

pkgtestdir="$(dirname ${0})"
repofile="$pkgtestdir/repos.yaml"

distro=$2
repo=$1

# Select repos
echo -e "repos:\n  - $repo" > $repofile
if [ "$repo" == "knot-resolver-devel" ]; then
    # get Knot DNS from knot-resolver-latest
	echo -e '  - knot-resolver-latest' >> $repofile
fi

pushd "$pkgtestdir/$distro"
vagrant destroy -f &>/dev/null
vagrant up
ret=$?
vagrant destroy -f &>/dev/null
popd
exit $ret