summaryrefslogtreecommitdiffstats
path: root/debian/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:35:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:35:12 +0000
commitf06340a3d93a12d610416030f0b8c766bfee63ca (patch)
tree8d9c4eeec6afd2dc01aa6a17435a4f63c3e769d5 /debian/tests
parentAdding upstream version 258. (diff)
downloadpostgresql-common-f06340a3d93a12d610416030f0b8c766bfee63ca.tar.xz
postgresql-common-f06340a3d93a12d610416030f0b8c766bfee63ca.zip
Adding debian version 258.debian/258
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/tests')
-rw-r--r--debian/tests/control20
-rwxr-xr-xdebian/tests/default-psql19
-rwxr-xr-xdebian/tests/run-testsuite4
3 files changed, 43 insertions, 0 deletions
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..cb70655
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,20 @@
+Tests: default-psql
+Depends:
+ postgresql,
+Restrictions: needs-root, skippable
+
+Tests: run-testsuite
+Depends:
+ build-essential,
+ debhelper,
+ fakeroot,
+ hunspell-en-us,
+ iproute2,
+ locales-all,
+ logrotate,
+ netcat-openbsd,
+ perl,
+ postgresql-all,
+ postgresql-doc,
+ procps,
+Restrictions: needs-root
diff --git a/debian/tests/default-psql b/debian/tests/default-psql
new file mode 100755
index 0000000..1890ae6
--- /dev/null
+++ b/debian/tests/default-psql
@@ -0,0 +1,19 @@
+#!/bin/sh
+# autopkgtest to check that installing the "postgresql" metapackage results in
+# a working cluster
+set -e
+
+# disabled default cluster creation?
+if grep -rq '^create_main_cluster\b.*\bfalse\b' /etc/postgresql-common/createcluster.*; then
+ echo "SKIP: default cluster creation disabled in createcluster.conf"
+ exit 77
+fi
+
+if ! pg_lsclusters | grep -q 'main .* online'; then
+ echo "No running cluster!" >&2
+ pg_lsclusters >&2
+fi
+
+# check that we can connect to template1 on the default cluster
+OUT=$(su - -c 'psql -Atc "select 21*2" template1' postgres)
+[ "$OUT" = "42" ] || { echo "$OUT"; exit 1; }
diff --git a/debian/tests/run-testsuite b/debian/tests/run-testsuite
new file mode 100755
index 0000000..aaa9f8d
--- /dev/null
+++ b/debian/tests/run-testsuite
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+
+./testsuite