diff options
author | Pavel Raiskup <praiskup@redhat.com> | 2014-10-20 08:58:55 +0200 |
---|---|---|
committer | Pavel Raiskup <praiskup@redhat.com> | 2014-10-20 08:58:55 +0200 |
commit | b0f7b339307050ce5a52c3dfda97aa50a901e5b8 (patch) | |
tree | cd3a944eee9910faa66ad5ce1ce8152e0795b764 /lib_pgsql.sh | |
parent | 4d5a62e62e64554af003f3395639ba912ed0c6c6 (diff) | |
download | postgresql-setup-tests-b0f7b339307050ce5a52c3dfda97aa50a901e5b8.tar.gz postgresql-setup-tests-b0f7b339307050ce5a52c3dfda97aa50a901e5b8.tar.xz postgresql-setup-tests-b0f7b339307050ce5a52c3dfda97aa50a901e5b8.zip |
tasks/upgrade-locale-utf8-syntax: new testcase
When system's locale changed e.g. from en_US.utf8 to en_US.UTF-8,
older PostgreSQL versions were unable to upgrade the data
directory. From Fedora 20 we should be able to upgrade without
issues.
Related: #1007802
* lib_pgsql.sh (dtf_postgresql_cb_upgrade)
(dtf_postgresql_cb_upgrade_select): New callbacks for
dtf_postgresql_upgrade_tour function.
(dtf_postgresql_upgrade_tour): Function determining against which
data the installation is able to upgrade and performs all the
possible upgrade scenarios.
* tasks/upgrade-basic/runtest.sh: Switch to
dtf_postgresql_upgrade_tour usage.
* tasks/upgrade-utf8-syntax/config.sh: New testcase config.
* tasks/upgrade-utf8-syntax/runtest.sh: New testcase.
Diffstat (limited to 'lib_pgsql.sh')
-rw-r--r-- | lib_pgsql.sh | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/lib_pgsql.sh b/lib_pgsql.sh index 6805cdb..f1ebe5f 100644 --- a/lib_pgsql.sh +++ b/lib_pgsql.sh @@ -99,3 +99,59 @@ dtf_postgresql_upgrade_matrix() # echo fedora 22 run fi } + +dtf_postgresql_cb_upgrade() +{ + local dashdash="" + if rlIsFedora 22; then + dashdash="--" + fi + rlRun "postgresql-setup $dashdash""upgrade" +} + +dtf_postgresql_cb_upgrade_select() +{ + cat +} + +dtf_postgresql_upgrade_tour() +{ + local arch=$(uname -i) + local rv=0 + + items="$(dtf_postgresql_upgrade_matrix | dtf_postgresql_cb_upgrade_select)" + test "$items" = "$(:)" && return 0 + + while read distro version action; do + echo "--> Performing upgrade: $distro-$version - $action" + + url="$1/$distro/$version/$arch/$2" + + dtf_postgresql_unpack_remote_data "$url" || return 1 + + case "$action" in + upgrade) + dtf_postgresql_cb_upgrade + if test $? -ne 0; then + rv=1 + find /var/lib/pgsql -maxdepth 1 -name '*.log' | \ + while read line; do + echo "====== reading log $line ======" + cat "$line" + done + fi + ;; + *) + ;; + esac + + rlServiceStart postgresql + dtf_postgresql_check_started + rlServiceStop postgresql + dtf_postgresql_check_stopped + + rm -rf /var/lib/pgsql/data + done <<<"$items" + + return $rv +} |