]> pd.if.org Git - zpackage/commitdiff
add test for pre-install script failure
authorNathan Wagner <nw@hydaspes.if.org>
Mon, 24 Sep 2018 21:06:20 +0000 (21:06 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Mon, 24 Sep 2018 21:06:20 +0000 (21:06 +0000)
t/install.t

index 79308e028c70acace13a92fbd58b5644ad490301..3424361ac7928318f0dfa9ceaff02efe198a4287 100755 (executable)
@@ -6,7 +6,7 @@
 
 . tap.sh
 
-plan 46
+plan 51
 
 newpkg() {
        pkgid=$1
@@ -171,6 +171,22 @@ skiponfail 3 "can't create $pkgid" || {
        }
 }
 
+#
+# package with failing pre-script
+#
+pkgid=fourth-1.0-1
+PF=$pkgid.zpm
+newpkg $pkgid /bin/printf
+skiponfail 3 "can't create $pkgid" || {
+       zpm setscript -f $PF $pkgid pre-install /bin/false
+       okexit "add false pre-install script to $pkgid"
+       skiponfail 1 "can't set $pkgid pre-install script" || {
+               zpm install -R. -d local.db -f $PF $pkgid 2>/dev/null
+               failsok failed to install $pkgid
+       }
+}
+
+
 cd .. || bailout
 require rm -rf tmp