File: default-psql

package info (click to toggle)
postgresql-common 282
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,528 kB
  • sloc: perl: 4,170; sh: 1,572; makefile: 327; sql: 13; ansic: 10
file content (19 lines) | stat: -rwxr-xr-x 619 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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; }