diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 12:08:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 12:08:39 +0000 |
commit | 039175d5d6adfc3f96e3ffdd5ee946576e22233a (patch) | |
tree | f1ba3073275e4441e417ed8b149729d0f5122884 /debian/tests | |
parent | Adding upstream version 225+deb11u1. (diff) | |
download | postgresql-common-debian.tar.xz postgresql-common-debian.zip |
Adding debian version 225+deb11u1.debian/225+deb11u1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/tests')
-rw-r--r-- | debian/tests/control | 7 | ||||
-rwxr-xr-x | debian/tests/default-psql | 19 | ||||
-rwxr-xr-x | debian/tests/run-testsuite | 4 |
3 files changed, 30 insertions, 0 deletions
diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..f4d915e --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,7 @@ +Tests: default-psql +Depends: postgresql +Restrictions: needs-root + +Tests: run-testsuite +Depends: postgresql-all, build-essential, debhelper, fakeroot, perl, hunspell-en-us, locales, netcat-openbsd, net-tools, procps, logrotate +Restrictions: needs-root 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; } 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 |