summaryrefslogtreecommitdiffstats
path: root/debian/tests/utils.sh
blob: 6ff8480fb4183090468b91f28eb51efe5d4f13d9 (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
27
28
29
30
31
32
33
#!/bin/sh

set -ex

export LC_ALL=C
PKG=fence-virt

dpkg --purge $PKG

# package not installed
/usr/share/crmsh/utils/crm_rpmcheck.py $PKG | grep error

# install
/usr/share/crmsh/utils/crm_pkg.py -n $PKG -s present | grep Unpacking
/usr/share/crmsh/utils/crm_rpmcheck.py $PKG | grep status
dpkg --status $PKG

# upgrade
/usr/share/crmsh/utils/crm_pkg.py -n $PKG -s latest | grep False

# purge
/usr/share/crmsh/utils/crm_pkg.py -n $PKG -s removed | egrep 'Removing|Purging'
/usr/share/crmsh/utils/crm_rpmcheck.py $PKG | grep error

# clean
cd $AUTOPKGTEST_TMP
mkdir dir
touch dir/file
cp /usr/share/crmsh/utils/crm_clean.py .
$PWD/crm_clean.py $PWD/crm_clean.py $PWD/dir
if ls | grep .; then
    exit 1
fi