summaryrefslogtreecommitdiffstats
path: root/debian/tests/utils.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xdebian/tests/utils.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/debian/tests/utils.sh b/debian/tests/utils.sh
new file mode 100755
index 0000000..6ff8480
--- /dev/null
+++ b/debian/tests/utils.sh
@@ -0,0 +1,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