1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #! /bin/bash
- #
- # © 2017 Ansgar Burchardt <ansgar@debian.org>
- # License: GPL-2+
- #
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or
- # (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program. If not, see <https://www.gnu.org/licenses/>.
- set -e
- set -u
- # find-postgresql-version: () -> str
- # locate postgresql version for which both server and debversion
- # extension are installed. exits with error if no version is found.
- # returns: version, e.g. "9.6"
- find-postgresql-version() {
- local status
- for v in 11 10 9.6 9.4; do
- status=$(dpkg-query \
- -f'${db:Status-Status} ' \
- -W postgresql-${v} postgresql-${v}-debversion 2>/dev/null || :)
- if [ "${status}" = "installed installed " ]; then
- echo ${v}
- exit 0
- fi
- done
- echo "No PostgreSQL version with server and debversion extension found." >&2
- exit 1
- }
- pgversion=$(find-postgresql-version)
- export DAK_INTEGRATION_TEST=1
- export DAK_ROOT="$(cd $(dirname "$0")/..; pwd)"
- for t in "${DAK_ROOT}/integration-tests/tests/"[0-9]*[^~] \
- "${DAK_ROOT}/tests/run-dbtests"; do
- echo "=== Running ${t##*/}"
- pg_virtualenv -v "${pgversion}" "${t}"
- done
|