From 4d5a62e62e64554af003f3395639ba912ed0c6c6 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Mon, 20 Oct 2014 07:25:13 +0200 Subject: 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. --- tasks/upgrade-basic/runtest.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tasks/upgrade-basic/runtest.sh (limited to 'tasks/upgrade-basic/runtest.sh') diff --git a/tasks/upgrade-basic/runtest.sh b/tasks/upgrade-basic/runtest.sh new file mode 100644 index 0000000..3863479 --- /dev/null +++ b/tasks/upgrade-basic/runtest.sh @@ -0,0 +1,38 @@ +arch=$(uname -i) + +dtf_postgresql_test_init + +test_wrapper() +{ + dtf_postgresql_upgrade_matrix | \ + while read distro version action; do + echo "performing upgrade: $distro-$version - $action" + + url="$dtf_dataurl/$distro/$version/$arch/basic.tar.gz" + + dtf_postgresql_unpack_remote_data "$url" || return 1 + + case "$action" in + upgrade) + if rlIsFedora 22; then + dashdash="--" + fi + rlRun "postgresql-setup $dashdash""upgrade" + ;; + *) + ;; + esac + + rlServiceStart postgresql + dtf_postgresql_check_started + rlServiceStop postgresql + dtf_postgresql_check_stopped + + rm -rf /var/lib/pgsql/data + done +} + +test_wrapper +rlAssert0 "test_wrapper() should finish successfully" $? + +dtf_postgresql_test_finish -- cgit