aboutsummaryrefslogtreecommitdiff
path: root/t/fail.t
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2015-12-31 13:22:30 +0100
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2015-12-31 22:52:46 +0100
commit15742f5186e42f40c0a04402c9f15f880ce79196 (patch)
treec036cd07fa579330737bad94118772885bb4c0bc /t/fail.t
parenta45734855de8a67cd67afea31c7f28be2a0b0ac4 (diff)
downloadsbotools2-15742f5186e42f40c0a04402c9f15f880ce79196.tar.xz
Add testing for download fail. See #23
Diffstat (limited to 't/fail.t')
-rwxr-xr-xt/fail.t11
1 files changed, 10 insertions, 1 deletions
diff --git a/t/fail.t b/t/fail.t
index e741350..c8f4b58 100755
--- a/t/fail.t
+++ b/t/fail.t
@@ -11,7 +11,7 @@ use lib "$RealBin/../SBO-Lib/lib";
use Test::Execute;
if ($ENV{TEST_INSTALL}) {
- plan tests => 1;
+ plan tests => 2;
} else {
plan skip_all => 'Only run these tests if TEST_INSTALL=1';
}
@@ -22,8 +22,14 @@ $path = "$RealBin/../";
sub cleanup {
capture_merged {
unlink "$RealBin/LO-fail/failingslackbuild/perf.dummy";
+ unlink "$RealBin/LO-fail/failingdownload/perf.dummy.fail";
+ unlink "$RealBin/LO-fail/failingmd5sum/perf.dummy";
system(qw!rm -rf /tmp/SBo/failingslackbuild-1.0!);
+ system(qw!rm -rf /tmp/SBo/failingdownload-1.0!);
+ system(qw!rm -rf /tmp/SBo/failingmd5sum-1.0!);
system(qw!rm -rf /tmp/package-failingslackbuild!);
+ system(qw!rm -rf /tmp/package-failingdownload!);
+ system(qw!rm -rf /tmp/package-failingmd5sum!);
};
}
@@ -58,6 +64,9 @@ set_lo();
# 1: Failing slackbuild script
script (qw/ sboinstall failingslackbuild /, { input => "y\ny", expected => qr/Failures:\n failingslackbuild: failingslackbuild.SlackBuild return non-zero\n\z/, exit => 3 });
+# 2: Failing download
+script (qw/ sboinstall failingdownload /, { input => "y\ny\nn", expected => qr!Failures:\n failingdownload: Unable to wget http://www[.]pastemobile[.]org/perf[.]dummy[.]fail[.]\n\z!, exit => 5 });
+
# Cleanup
END {
set_lo('delete');