summaryrefslogtreecommitdiffstats
path: root/debian/tests/default-psql
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:02:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:02:19 +0000
commit670c19c1ec189d5831be4a4c09099036da4635ad (patch)
tree9e929200d3abb9b52d685695db2a72e02718b243 /debian/tests/default-psql
parentAdding upstream version 248. (diff)
downloadpostgresql-common-670c19c1ec189d5831be4a4c09099036da4635ad.tar.xz
postgresql-common-670c19c1ec189d5831be4a4c09099036da4635ad.zip
Adding debian version 248.debian/248debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xdebian/tests/default-psql19
1 files changed, 19 insertions, 0 deletions
diff --git a/debian/tests/default-psql b/debian/tests/default-psql
new file mode 100755
index 0000000..3392ea4
--- /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 -q '\bcreate_main_cluster\b.*\bfalse\b' /etc/postgresql-common/createcluster.conf; then
+ echo "SKIP: default cluster creation disabled in createcluster.conf"
+ exit 0
+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; }