summaryrefslogtreecommitdiff
path: root/test/libremakepkg-test.sh
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2018-05-30 11:38:15 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2018-05-30 14:11:18 -0400
commitd28376fb2af27cb65fd8c4253079ec65d646275a (patch)
tree0660335a851080d617c1c9a770c60d5a778b8926 /test/libremakepkg-test.sh
parente82b5cfd25ea3164e33ac584b48e51f48f0c95c0 (diff)
test/libremakepkg: Verify that it correctly handles source signatures [ci-skip]
Diffstat (limited to 'test/libremakepkg-test.sh')
-rw-r--r--test/libremakepkg-test.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/libremakepkg-test.sh b/test/libremakepkg-test.sh
index 363e4f7..6fa7962 100644
--- a/test/libremakepkg-test.sh
+++ b/test/libremakepkg-test.sh
@@ -177,3 +177,29 @@ it_doesnt_symlink_outputs() {
[[ -f $(echo "$tmpdir/workdir/pkgdest"/libretools-hello-1.0-1-any.pkg.tar.?z) ]]
[[ -f $(echo "$tmpdir/workdir/srcpkgdest"/libretools-hello-1.0-1-any.src.tar.?z) ]]
}
+
+it_succeeds_with_good_signatures() {
+ require network sudo || return 0
+
+ cp libremakepkg.d/PKGBUILD-signed "$tmpdir/PKGBUILD"
+ cp libremakepkg.d/hello.sh "$tmpdir/hello.sh"
+ cd "$tmpdir"
+ gpg --detach-sign --use-agent --no-armor hello.sh
+
+ libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty
+ testsudo libremakepkg -l "$roundup_test_name"
+}
+
+it_fails_with_bad_signatures() {
+ require network sudo || return 0
+
+ cp libremakepkg.d/PKGBUILD-signed "$tmpdir/PKGBUILD"
+ cp libremakepkg.d/hello.sh "$tmpdir/hello.sh"
+ cd "$tmpdir"
+ gpg --detach-sign --use-agent --no-armor hello.sh
+ echo 'echo pwned' >> hello.sh
+ makepkg -g >> PKGBUILD
+
+ libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty
+ not testsudo libremakepkg -l "$roundup_test_name"
+}