From: Yaroslav Halchenko Date: Wed, 6 Aug 2014 03:05:12 +0000 (-0400) Subject: ENH: sketch for a test to check installation of the package X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;ds=sidebyside;h=734d64b61106674592ae6763d61be92c515acb00;p=neurodebian.git ENH: sketch for a test to check installation of the package --- diff --git a/tools/tests/run_in_debian_dockers b/tools/tests/run_in_debian_dockers new file mode 100755 index 0000000..b12098c --- /dev/null +++ b/tools/tests/run_in_debian_dockers @@ -0,0 +1,10 @@ +#!/bin/bash + +set -u +test=$1 + +docker.io images 2>&1 | grep -e "\(debian\|ubuntu\)[ ]*[0-9]" | sort | awk '{print $1,$2;}' \ +| while read d v; do + echo "== $d $v" + chronic docker.io run --rm=true -v $PWD:$PWD $d:$v /bin/bash $PWD/$test +done diff --git a/tools/tests/test_neurodebian-repository-deployment b/tools/tests/test_neurodebian-repository-deployment new file mode 100755 index 0000000..19e9a17 --- /dev/null +++ b/tools/tests/test_neurodebian-repository-deployment @@ -0,0 +1,38 @@ +#/bin/bash +set -ex + +# minimal installation with few of those packages +apt_file=/etc/apt/sources.list.d/local.list + +# clean up from a previous test +dpkg --purge neurodebian-repository neurodebian-keyring || : +echo PURGE | debconf-communicate neurodebian-repository || : +rm -rf /tmp/apt $apt_file; + +mkdir -p /tmp/apt; cd /tmp/apt; +rm -f neurodebian-*deb; apt-get update -y; apt-get install -y wget; +wget http://www.onerussian.com/tmp/neurodebian-repository_0.33~a1_all.deb; +wget http://www.onerussian.com/tmp/neurodebian-keyring_0.33~a1_all.deb; + +# generate APT repo +apt-get install -y dpkg-dev ; dpkg-scanpackages . /dev/null > Packages +# Add it to the list of available +echo "deb file:///tmp/apt ./" >| $apt_file; apt-get update +# Install the beast +apt-get install -y --allow-unauthenticated neurodebian-repository +# Verify that it has correct entries +# Very cruel way to figure out the default release. Would fail if +# options, such as multiarch, are specified after deb +release=$(grep -e '^\s*deb\s' /etc/apt/sources.list | head -1 | awk '{print $3;}') +grep -E "^deb\s+http.* $release main\s*\$" /etc/apt/sources.list.d/neurodebian.sources.list +grep -E '^deb\s+http.* data main\s*$' /etc/apt/sources.list.d/neurodebian.sources.list +# May be even retrospect stored debconf configuration +apt-get install debconf-utils +debconf-get-selections | grep neurodebian-repository/release.*select.*auto +# And apt-get must be working +apt-get update +# Make sure it is active +apt-cache policy | grep o=NeuroDebian,.*,n=data +apt-cache policy | grep o=NeuroDebian,.*,n=$release + +echo "I: success"