summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes 'josch' Schauer <josch@debian.org>2018-07-20 17:48:25 +0200
committerJohannes 'josch' Schauer <josch@debian.org>2018-07-20 18:41:21 +0200
commit9bf2196c2930eb9db052ac7b4214360999698dae (patch)
tree2584708daeeb9a27aff171cc37f6dc5ef6acdc21
parentf832c88031eef428f54bc583adc7909795e27326 (diff)
add autopkgtest to check if the whitelist is still up to date
-rw-r--r--debian/tests/control4
-rwxr-xr-xdebian/tests/whitelist15
2 files changed, 19 insertions, 0 deletions
diff --git a/debian/tests/control b/debian/tests/control
index 3c2fbae..48f8f11 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,3 +1,7 @@
Tests: general
Restrictions: allow-stderr, isolation-container, needs-root
Depends: @, curl, nginx, php-fpm
+
+Tests: whitelist
+Restrictions: allow-stderr
+Depends: @, php-cli
diff --git a/debian/tests/whitelist b/debian/tests/whitelist
new file mode 100755
index 0000000..e5b8e99
--- /dev/null
+++ b/debian/tests/whitelist
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -exu
+
+# check whether the whitelist.txt supplied by the Debian package is the same
+# that would be generated by upstream's index.php
+#
+# we have to copy the code to a new location because otherwise we cannot remove
+# whitelist.txt and have no write access to the cache directory
+cp -a /usr/share/rss-bridge "$ADTTMP"
+rm "$ADTTMP/rss-bridge/whitelist.txt"
+rm "$ADTTMP/rss-bridge/cache"
+mkdir "$ADTTMP/rss-bridge/cache"
+php "$ADTTMP/rss-bridge/index.php"
+diff -u "$ADTTMP/rss-bridge/whitelist.txt" /usr/share/rss-bridge/whitelist.txt