aboutsummaryrefslogtreecommitdiff
path: root/t/03-travis.t
diff options
context:
space:
mode:
authorSlack Coder <slackcoder@server.ky>2024-12-10 14:06:06 -0500
committerSlack Coder <slackcoder@server.ky>2025-01-21 15:36:10 -0500
commitba81bf24d8df5153830f06deb7c2b780fe5c292f (patch)
treed8c0aefac933b7ed41e4b8faae75b9feaf0b9f1d /t/03-travis.t
parent82b061208df57c0d1d46b06ffa15ad6846db883b (diff)
downloadsbotools2-ba81bf24d8df5153830f06deb7c2b780fe5c292f.tar.xz
GPG verification
Diffstat (limited to 't/03-travis.t')
-rwxr-xr-xt/03-travis.t45
1 files changed, 43 insertions, 2 deletions
diff --git a/t/03-travis.t b/t/03-travis.t
index 7b6c97f..cfe517e 100755
--- a/t/03-travis.t
+++ b/t/03-travis.t
@@ -11,7 +11,7 @@ use lib "$RealBin/../SBO-Lib/lib";
use Test::Sbotools qw/ sboconfig sbosnap sbofind sboinstall sboremove sbocheck sboupgrade /;
if (defined $ENV{TRAVIS} and $ENV{TRAVIS} eq 'true') {
- plan tests => 26;
+ plan tests => 41;
} else {
plan skip_all => 'Only run these tests under Travis CI (TRAVIS=true)';
}
@@ -20,8 +20,11 @@ $ENV{TEST_ONLINE} //= 0;
# Since this is only run under Travis CI, we can blow away the repo without consequence
system(qw! rm -rf /usr/sbo !);
+# Disable GPG verification
+sboconfig qw/ --gpg-key FALSE /;
+
# 1-3: Test SLACKWARE_VERSION
-sboconfig qw/ -V 14.1 /, { expected => "Setting SLACKWARE_VERSION to 14.1...\n" };
+sboconfig qw/ -V 15.0 /, { expected => "Setting SLACKWARE_VERSION to 15.0...\n" };
SKIP: {
skip 'Not doing online tests without TEST_ONLINE=1', 2 if $ENV{TEST_ONLINE} ne '1';
@@ -118,6 +121,44 @@ sboupgrade qw/ -f -z nonexistentslackbuild4 /, {
expected => qr/nonexistentslackbuild5 added to upgrade queue.*nonexistentslackbuild4 added to upgrade queue.*Upgrade queue: nonexistentslackbuild5 nonexistentslackbuild4\n/s
};
+# 27-34: Test GPG verification
+SKIP: {
+ skip 'Not doing online tests without TEST_ONLINE=1', 4 if $ENV{TEST_ONLINE} ne '1';
+
+ # Since this is only run under Travis CI, we can blow away the repo without consequence
+ system(qw! rm -rf /usr/sbo !);
+ system(qw! gpg --batch --yes --delete-key D3076BC3E783EE747F09B8B70368EF579C7BA3B6 2>&1 >/dev/null !);
+
+ sboconfig qw/ --gpg-key D3076BC3E783EE747F09B8B70368EF579C7BA3B6 /;
+ sbosnap(("import-key", "https://slackbuilds.org/GPG-KEY"), { expected => qr!.*key imported.*! });
+
+ sboconfig qw! -r https://git.slackbuilds.org/slackbuilds !, { expected => "Setting REPO to https://git.slackbuilds.org/slackbuilds...\n", name => 'Official Git' };
+
+ sbosnap 'fetch', { expected => qr!Pulling SlackBuilds tree.*Cloning into '/usr/sbo/repo'.*Verifying.*!s };
+ ok (-e "/usr/sbo/repo/SLACKBUILDS.TXT", "SLACKBUILDS.TXT exists (REPO)");
+ ok (! -e "/usr/sbo/repo/SLACKBUILDS.TXT.gz", "SLACKBUILDS.TXT.gz doesn't exist (REPO)");
+ sbofind 'sbotools', { expected => qr"SBo: sbotools .*\nPath: /usr/sbo/repo/system/sbotools\n\n" };
+}
+
+# 35-41 Test GPG verification
+SKIP: {
+ skip 'Not doing online tests without TEST_ONLINE=1', 4 if $ENV{TEST_ONLINE} ne '1';
+
+ # Since this is only run under Travis CI, we can blow away the repo without consequence
+ system(qw! rm -rf /usr/sbo !);
+ system(qw! gpg --batch --yes --delete-key D3076BC3E783EE747F09B8B70368EF579C7BA3B6 2>&1 >/dev/null !);
+
+ sboconfig qw/ --gpg-key D3076BC3E783EE747F09B8B70368EF579C7BA3B6 /;
+ sbosnap(("import-key", "https://slackbuilds.org/GPG-KEY"), { expected => qr!.*key imported.*! });
+
+ sboconfig qw! -r rsync://slackbuilds.org/slackbuilds/15.0/ !, { expected => "Setting REPO to rsync://slackbuilds.org/slackbuilds/15.0/...\n", name => 'Official Rsync' };
+
+ sbosnap 'fetch', { expected => qr!Pulling SlackBuilds tree.*Verifying CHECKSUMS.md5.*Verifying file integrity using CHECKSUMS.md5.*!s };
+ ok (-e "/usr/sbo/repo/SLACKBUILDS.TXT", "SLACKBUILDS.TXT exists (REPO)");
+ ok (-e "/usr/sbo/repo/SLACKBUILDS.TXT.gz", "SLACKBUILDS.TXT.gz exists (REPO)");
+ sbofind 'sbotools', { expected => qr"SBo: sbotools .*\nPath: /usr/sbo/repo/system/sbotools\n\n" };
+}
+
# Cleanup
capture_merged {
system(qw!/sbin/removepkg nonexistentslackbuild!);