]> git.donarmstrong.com Git - neurodebian.git/blob - tools/tests/test_neurodebian-repository-deployment
Improve error msg and adjust test for now "high" priority for enable question --...
[neurodebian.git] / tools / tests / test_neurodebian-repository-deployment
1 #/bin/bash
2 set -ex
3
4 # minimal installation with few of those packages
5 apt_file=/etc/apt/sources.list.d/local.list
6 apt_nd_file=/etc/apt/sources.list.d/neurodebian.sources.list
7
8 # clean up from a previous test
9 dpkg --purge neurodebian neurodebian-archive-keyring || :
10 echo PURGE | debconf-communicate neurodebian || :
11 rm -rf /tmp/apt $apt_file;
12
13 mkdir -p /tmp/apt; cd /tmp/apt;
14 rm -f neurodebian-*deb; apt-get update -y; apt-get install -y wget;
15 wget http://www.onerussian.com/tmp/neurodebian_0.34_all.deb;
16 wget http://www.onerussian.com/tmp/neurodebian-archive-keyring_0.34_all.deb;
17
18 # generate APT repo
19 apt-get install -y dpkg-dev ;  dpkg-scanpackages  . /dev/null > Packages
20 # Add it to the list of available
21 echo "deb file:///tmp/apt ./" >| $apt_file; apt-get update
22 # Install the beast
23 DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated neurodebian
24 # By default should not get enabled
25 [ ! -e "$apt_nd_file" ]
26
27 DEBIAN_FRONTEND=noninteractive NEURODEBIAN_ENABLE=yes apt-get install -y --allow-unauthenticated --reinstall neurodebian
28
29 # Verify that it has correct entries
30 # Very cruel way to figure out the default release. Would fail if
31 # options, such as multiarch, are specified after deb
32 release=$(grep -e '^\s*deb\s' /etc/apt/sources.list | head -1 | awk '{print $3;}')
33 grep -E "^deb\s+http.* $release main\s*\$" $apt_nd_file
34 grep -E '^deb\s+http.* data main\s*$'      $apt_nd_file
35 # May be even retrospect stored debconf configuration
36 apt-get install debconf-utils
37 debconf-get-selections | grep neurodebian/release.*select.*auto
38 # And apt-get must be working
39 apt-get update
40 # Make sure it is active
41 apt-cache policy | grep o=NeuroDebian,.*,n=data
42 apt-cache policy | grep o=NeuroDebian,.*,n=$release
43
44 # Now lets remove
45 dpkg --purge neurodebian
46 [ ! -e $apt_nd_file ]
47 apt-cache policy | grep o=NeuroDebian && exit 1 || :
48
49 echo "I: success"