summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-05-31 13:28:57 -0600
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-05-31 13:37:23 -0600
commitb9769d5af5e4be7a1c285ccf06df8a608d9d5825 (patch)
tree73a6263346a19bea766c4271acc8adb85ec336f6 /test
parent2a48b40b82770bbc54a79227a52306537bc615d7 (diff)
librefetch: Don't try to use makepkg to create .sig files.
Diffstat (limited to 'test')
-rw-r--r--test/librefetch-test.sh28
-rw-r--r--test/librefetch.d/PKGBUILD2
-rw-r--r--test/librefetch.d/PKGBUILD-recurse18
3 files changed, 47 insertions, 1 deletions
diff --git a/test/librefetch-test.sh b/test/librefetch-test.sh
index 8dd957a..f10ee7f 100644
--- a/test/librefetch-test.sh
+++ b/test/librefetch-test.sh
@@ -4,6 +4,9 @@ describe librefetch
. ./test-common.sh
+KEYSERVER=hkp://pool.sks-keyservers.net
+GPG="gpg --quiet --batch --no-tty --no-permission-warning --keyserver ${KEYSERVER}"
+
before() {
_before
@@ -28,6 +31,17 @@ EOF
'MIRRORS=("phony://example.com/dir/")' \
'DOWNLOADER=/usr/bin/false' \
> "$XDG_CONFIG_HOME/libretools/librefetch.conf"
+
+ printf '%s\n' \
+ 'Key-Type: RSA' \
+ 'Key-Length: 1024' \
+ 'Key-Usage: sign' \
+ 'Name-Real: Temporary LibreTools testsuite key' \
+ 'Name-Email: libretools-test@localhost' \
+ 'Expire-Date: 0' \
+ '%no-protection' \
+ '%commit' \
+ | $GPG --gen-key 2>/dev/null
}
after() {
@@ -68,4 +82,18 @@ it_runs() {
# unfortunately).
bsdtar tf "$tmpdir/srcdest/$srcball" > list-pkg.txt
diff -u list.txt list-pkg.txt
+ # Verify that the signature was created and matches
+ gpg --quiet --verify "$tmpdir/srcdest/$srcball"{.sig,} 2>/dev/null
+}
+
+it_recurses() {
+ local srcball=testpkg-1.0.tar.gz
+ cp librefetch.d/* "$tmpdir/"
+ cd "$tmpdir"
+ mv PKGBUILD{-recurse,}
+
+ makepkg -g
+ bsdtar tf "$tmpdir/srcdest/$srcball" > list-pkg.txt
+ diff -u list.txt list-pkg.txt
+ gpg --quiet --verify "$tmpdir/srcdest/$srcball"{.sig,} 2>/dev/null
}
diff --git a/test/librefetch.d/PKGBUILD b/test/librefetch.d/PKGBUILD
index db80db3..6547e25 100644
--- a/test/librefetch.d/PKGBUILD
+++ b/test/librefetch.d/PKGBUILD
@@ -3,7 +3,7 @@ pkgver=1.0
pkgrel=1
pkgdesc=foo
arch=(any)
-source=("libre://$pkgname-$pkgver.tar.gz")
+source=("libre://$pkgname-$pkgver.tar.gz"{,.sig})
mksource() {
mkdir "$srcdir/bar"
diff --git a/test/librefetch.d/PKGBUILD-recurse b/test/librefetch.d/PKGBUILD-recurse
new file mode 100644
index 0000000..fad5976
--- /dev/null
+++ b/test/librefetch.d/PKGBUILD-recurse
@@ -0,0 +1,18 @@
+pkgname=testpkg
+pkgver=1.0
+pkgrel=1
+pkgdesc=foo
+arch=(any)
+source=("libre://$pkgname-$pkgver.tar.gz.sig")
+
+mksource() {
+ mkdir "$srcdir/bar"
+ local file
+ for file in '~foo' '~a' a A; do
+ touch "$srcdir/bar/$file"
+ done
+}
+
+package() {
+ :;
+}