summaryrefslogtreecommitdiffstats
path: root/lib_pgsql.sh
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2014-10-20 07:25:13 +0200
committerPavel Raiskup <praiskup@redhat.com>2014-10-20 07:25:13 +0200
commit4d5a62e62e64554af003f3395639ba912ed0c6c6 (patch)
tree05d0063912c867ef02d5196fb46557aedae64cf1 /lib_pgsql.sh
parent29e5adaec875c1b5ae3bd375de743f46f4a95883 (diff)
downloadpostgresql-setup-tests-4d5a62e62e64554af003f3395639ba912ed0c6c6.tar.gz
postgresql-setup-tests-4d5a62e62e64554af003f3395639ba912ed0c6c6.tar.xz
postgresql-setup-tests-4d5a62e62e64554af003f3395639ba912ed0c6c6.zip
tasks/upgrade: add basic upgrade testcase
Based on pre-generated tarball with PostgreSQL data - download the tarball, unpack and perform 'postgresql-setup upgrade'. * lib_pgsql.sh (dtf_postgresql_unpack_remote_data): New function. (dtf_postgresql_upgrade_matrix): New function. Detect which data should we test against. * run: Define new global $dtf_dataurl. * tasks/upgrade-basic/config.sh: New testcase config. * tasks/upgrade-basic/runtest.sh: New testcase.
Diffstat (limited to 'lib_pgsql.sh')
-rw-r--r--lib_pgsql.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib_pgsql.sh b/lib_pgsql.sh
index 3e8e047..6805cdb 100644
--- a/lib_pgsql.sh
+++ b/lib_pgsql.sh
@@ -58,3 +58,44 @@ dtf_postgresql_test_finish()
rlJournalEnd
rlGetTestState || return 1
}
+
+dtf_postgresql_unpack_remote_data()
+(
+ local tarball="$1"
+ cd /var/lib/pgsql || return 1
+ set -o pipefail
+ echo "downloading '$tarball'"
+ curl "$tarball" | tar -xzf -
+)
+
+# Detect current distribution and print set of "distro version action" lines
+# where DISTRO may be rhel/fedora, VERSION may be e.g. 6.6 for rhel or 20 for
+# Fedora. ACTION is either run or upgrade and it means whether currently
+# installed PostgreSQL server is able to RUN the older data from DISTRO-VERSION
+# or it should be first UPGRADEd.
+#
+# What versions are currently in Fedoras:
+# f17(9.1.9); f18(9.2.5); f19(9.2.9); f20(9.3.5); f21(9.3.5);
+# rawhide(9.3.5)
+
+dtf_postgresql_upgrade_matrix()
+{
+ if rlIsFedora 19; then
+ # echo fedora 17 upgrade
+ # echo fedora 18 run
+ echo fedora 19 run
+ elif rlIsFedora 20; then
+ # echo fedora 18 upgrade
+ echo fedora 19 upgrade
+ echo fedora 20 run
+ elif rlIsFedora 21; then
+ echo fedora 19 upgrade
+ echo fedora 20 run
+ # echo fedora 21 run
+ elif rlIsFedora 22; then
+ echo fedora 19 upgrade
+ echo fedora 20 run
+ # echo fedora 21 run
+ # echo fedora 22 run
+ fi
+}