aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2015-12-16 21:50:27 +0100
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2015-12-16 21:50:27 +0100
commite0272499c0432e5cdadcd2bcae6349c970225908 (patch)
tree4c5470717eb8fb4f6526c39cd2bd15c4a475c858
parent54bfe5228f6add029696b471e1279c58a4b40cd2 (diff)
downloadsbotools2-e0272499c0432e5cdadcd2bcae6349c970225908.tar.xz
Add preliminary new sboupgrade tests
-rwxr-xr-xt/travis.t22
1 files changed, 19 insertions, 3 deletions
diff --git a/t/travis.t b/t/travis.t
index f632fcb..e2a1dbe 100755
--- a/t/travis.t
+++ b/t/travis.t
@@ -8,7 +8,7 @@ use Capture::Tiny qw/ capture_merged /;
use FindBin '$RealBin';
if (defined $ENV{TRAVIS} and $ENV{TRAVIS} eq 'true') {
- plan tests => 24;
+ plan tests => 26;
} else {
plan skip_all => 'Only run these tests under Travis CI (TRAVIS=true)';
}
@@ -112,8 +112,24 @@ SKIP: {
ok (! -e "/var/log/packages/nonexistentslackbuild-0.9-noarch-1_SBo", 'old package is removed');
}
-# 24: Test sboupgrade -f
if (not glob("/var/log/packages/nonexistentslackbuild-*")) {
run(cmd => [qw/ sboinstall -r nonexistentslackbuild /]);
}
-like( run(cmd => [qw/ sboupgrade -f nonexistentslackbuild /], input => "y\ny"), qr/Proceed with nonexistentslackbuild\?.*Upgrade queue: nonexistentslackbuild$/s, 'sboupgrade -f works');
+if (not glob("/var/log/packages/nonexistentslackbuild4-*")) {
+ run(cmd => [qw/ sboinstall nonexistentslackbuild4 /], input => "y\ny\ny");
+}
+# 24-25: Test sboupgrade -f
+like (run(cmd => [qw/ sboupgrade -f nonexistentslackbuild /], input => "y\ny"), qr/Proceed with nonexistentslackbuild\?.*Upgrade queue: nonexistentslackbuild$/s, 'sboupgrade -f works');
+like (run(cmd => [qw/ sboupgrade -f nonexistentslackbuild4 /], input => "y\ny"), qr/Proceed with nonexistentslackbuild4\?.*Upgrade queue: nonexistentslackbuild4$/s, 'sboupgrade -f with requirements works');
+
+# 26: Test sboupgrade -f -z
+like (run(cmd => [qw/ sboupgrade -f -z nonexistentslackbuild4 /], input => "y\ny\ny"),
+ qr/nonexistentslackbuild5 added to upgrade queue.*nonexistentslackbuild4 added to upgrade queue.*Upgrade queue: nonexistentslackbuild5 nonexistentslackbuild4$/s,
+ 'sboupgrade -f -z works with requirements');
+
+# Cleanup
+capture_merged {
+ system(qw!/sbin/removepkg nonexistentslackbuild!);
+ system(qw!/sbin/removepkg nonexistentslackbuild4!);
+ system(qw!/sbin/removepkg nonexistentslackbuild5!);
+};