summaryrefslogtreecommitdiffstats
path: root/debian/tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xdebian/tests/configcheck11
-rw-r--r--debian/tests/control3
-rwxr-xr-xdebian/tests/install20
-rwxr-xr-xdebian/tests/rspamd-stats7
-rwxr-xr-xdebian/tests/webui-dependencies44
5 files changed, 85 insertions, 0 deletions
diff --git a/debian/tests/configcheck b/debian/tests/configcheck
new file mode 100755
index 0000000..43151f2
--- /dev/null
+++ b/debian/tests/configcheck
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -eu
+
+# rspamadm configtest is flaky on arm64/ppc64el
+# see https://github.com/rspamd/rspamd/issues/3376
+# only run on amd64
+if [ "x$(dpkg --print-architecture)" = "xamd64" ]; then
+ echo "+ rspamadm configtest --strict --config /etc/rspamd/rspamd.conf"
+ rspamadm configtest --strict --config /etc/rspamd/rspamd.conf
+fi
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..b94ec87
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,3 @@
+Tests: install configcheck rspamd-stats webui-dependencies
+Depends: curl, @
+Restrictions: needs-root
diff --git a/debian/tests/install b/debian/tests/install
new file mode 100755
index 0000000..b9888d7
--- /dev/null
+++ b/debian/tests/install
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -eu
+
+# refs: #914477
+sleep 15
+
+echo "+ systemctl status rspamd"
+systemctl status rspamd
+echo "+ systemctl is-enabled rspamd"
+systemctl is-enabled rspamd
+echo "+ systemctl is-active rspamd"
+systemctl is-active rspamd
+
+# refs: #914477
+sleep 5
+
+# TODO: more complicated tests ?
+echo "+ curl --stderr - --no-progress-meter --retry 3 --retry-connrefused --retry-delay 2 http://127.0.0.1:11334"
+curl --stderr - --no-progress-meter --retry 3 --retry-connrefused --retry-delay 2 http://127.0.0.1:11334
diff --git a/debian/tests/rspamd-stats b/debian/tests/rspamd-stats
new file mode 100755
index 0000000..951f532
--- /dev/null
+++ b/debian/tests/rspamd-stats
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -eu
+
+# test for perl dependencies
+echo "+ rspamd_stats --log /dev/null"
+rspamd_stats --log /dev/null
diff --git a/debian/tests/webui-dependencies b/debian/tests/webui-dependencies
new file mode 100755
index 0000000..d44e394
--- /dev/null
+++ b/debian/tests/webui-dependencies
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# NOTE: should be synced with debian/rspamd.triggers
+
+set -eu
+
+test_file()
+{
+ FILE=$1
+ if [ ! -f "$FILE" ]; then
+ echo "File '$FILE' not found!"
+ exit 1
+ fi
+ echo "File '$FILE' found."
+
+ REALPATH=$(realpath -e "$FILE") || true
+ if [ "$REALPATH" != "$FILE" ]; then
+ if [ $# -eq 1 ]; then
+ echo "Path '$FILE' does not equal its resolved path: '$REALPATH!"
+ exit 1;
+ fi
+
+ ALTERNATIVE_FILE=$2
+ if [ "$REALPATH" != "$ALTERNATIVE_FILE" ]; then
+ echo "Path '$FILE' does neither equal its resolved path nor its alternative path '$ALTERNATIVE_FILE': '$REALPATH!"
+ exit 1
+ fi
+ echo "Path '$FILE' equals its alternative path '$ALTERNATIVE_FILE'."
+ else
+ echo "Path '$FILE' equals its resolved path."
+ fi
+}
+
+echo "Start checking files..."
+
+test_file /usr/share/javascript/bootstrap4/js/bootstrap.bundle.min.js /usr/share/nodejs/bootstrap/dist/js/bootstrap.bundle.min.js
+test_file /usr/share/javascript/bootstrap4/css/bootstrap.min.css /usr/share/nodejs/bootstrap/dist/css/bootstrap.min.css
+test_file /usr/share/javascript/jquery/jquery.min.js /usr/share/nodejs/jquery/dist/jquery.min.js
+test_file /usr/share/javascript/requirejs/require.js
+test_file /usr/share/fonts-glyphicons/glyphicons-halflings-regular.ttf /usr/share/fonts/truetype/glyphicons/glyphicons-halflings-regular.ttf
+test_file /usr/share/fonts-glyphicons/glyphicons-halflings-regular.woff
+test_file /usr/share/fonts-glyphicons/glyphicons-halflings-regular.woff2
+
+echo "Finished checking files."