diff options
author | rubo77 <github@r.z11.de> | 2017-07-22 12:27:58 +0200 |
---|---|---|
committer | rubo77 <github@r.z11.de> | 2017-07-22 19:15:24 +0200 |
commit | 8b2576583335361a61e304f54daaa6536b9d71bc (patch) | |
tree | ae79a3fcb78eefcf20c32634702039071592a26e /tests | |
parent | 281f55ec382d34b2047152b2567d33227f7df974 (diff) |
travis: validate script validiert jetzt die site.mk packages und modules
Diffstat (limited to 'tests')
-rwxr-xr-x[-rw-r--r--] | tests/validate_site.sh | 61 |
1 files changed, 60 insertions, 1 deletions
diff --git a/tests/validate_site.sh b/tests/validate_site.sh index 71352c8..566132c 100644..100755 --- a/tests/validate_site.sh +++ b/tests/validate_site.sh @@ -3,4 +3,63 @@ # validate_site.sh checks if the site.conf is valid json GLUON_SITEDIR="." lua5.1 tests/site_config.lua -bash -n make-release.sh + +P=$(pwd) + +echo "validating $P/make-release.sh ..." +bash -n $P/make-release.sh + +echo "validating $P/modules ..." +source $P/modules +testpath=/tmp/site-validate +rm -Rf $testpath +mkdir -p $testpath/packages +cd $testpath/packages +for feed in $GLUON_SITE_FEEDS; do + echo "checking PACKAGES_${feed^^}_REPO ..." + repo_var=$(echo PACKAGES_${feed^^}_REPO) + commit_var=$(echo PACKAGES_${feed^^}_COMMIT) + branch_var=$(echo PACKAGES_${feed^^}_BRANCH) + repo=${!repo_var} + commit=${!commit_var} + branch=${!branch_var} + if [ "$repo" == "" ]; then + echo "repo $repo_var missing" + exit 1 + fi + if [ "$commit" == "" ]; then + echo "commit $commit_var missing" + exit 1 + fi + if [ "$branch" == "" ]; then + echo "branch $branch_var missing" + exit 1 + fi + git clone $(echo $repo) $feed + cd $feed + git checkout $(echo $branch) + git checkout $(echo $commit) + cd - +done +cd $testpath +git clone https://github.com/freifunk-gluon/gluon +cd gluon +git checkout v2017.1.1 +cp -a package/ $testpath/packages +cd $testpath/packages/package + +echo "validating GLUON_SITE_PACKAGES from $P/site.mk ..." +# ignore standard packages: +sed '/GLUON_RELEASE/,$d' $P/site.mk | egrep -v '(#|G|iwinfo|iptables|haveged)'> $testpath/site.mk.sh +sed -i 's/\s\\$//g;/^$/d' $testpath/site.mk.sh +sed -i 's/gluon-mesh-batman-adv-1[45]/gluon-mesh-batman-adv/g' $testpath/site.mk.sh +cat $testpath/site.mk.sh | +while read packet; do + echo "check $packet ..." + if [ "$(find $testpath/packages/ -type d -name "$packet")" '!=' '' ]; then + : find found something + else + echo "ERROR: $packet missing" + exit 1 + fi +done |