]> git.donarmstrong.com Git - neurodebian.git/blobdiff - tools/tests/test_neurodebian-repository-deployment
Merge branch 'master' of git://git.debian.org/pkg-exppsy/neurodebian
[neurodebian.git] / tools / tests / test_neurodebian-repository-deployment
diff --git a/tools/tests/test_neurodebian-repository-deployment b/tools/tests/test_neurodebian-repository-deployment
new file mode 100755 (executable)
index 0000000..6900417
--- /dev/null
@@ -0,0 +1,44 @@
+#/bin/bash
+set -ex
+
+# minimal installation with few of those packages
+apt_file=/etc/apt/sources.list.d/local.list
+apt_nd_file=/etc/apt/sources.list.d/neurodebian.sources.list
+
+# clean up from a previous test
+dpkg --purge neurodebian neurodebian-keyring || :
+echo PURGE | debconf-communicate neurodebian || :
+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_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
+# 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*\$" $apt_nd_file
+grep -E '^deb\s+http.* data main\s*$'      $apt_nd_file
+# May be even retrospect stored debconf configuration
+apt-get install debconf-utils
+debconf-get-selections | grep neurodebian/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
+
+# Now lets remove
+dpkg --purge neurodebian
+[ ! -e $apt_nd_file ]
+apt-cache policy | grep o=NeuroDebian && exit 1 || :
+
+echo "I: success"