summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2014-11-06 14:08:37 +0100
committerPavel Raiskup <praiskup@redhat.com>2014-11-06 14:08:37 +0100
commit85be352da4e973bc0a866774fff9052ac5d1b446 (patch)
tree2fd60ae3ffe2e717876ffb619a81a2c0c0bbc799
parenta963a4ab222307bfd692c38fe65bdde263c31c28 (diff)
downloadpostgresql-setup-tests-85be352da4e973bc0a866774fff9052ac5d1b446.tar.gz
postgresql-setup-tests-85be352da4e973bc0a866774fff9052ac5d1b446.tar.xz
postgresql-setup-tests-85be352da4e973bc0a866774fff9052ac5d1b446.zip
postgresql-tests: add test for PGSETUP_INITDB_OPTIONS
* lib_pgsql.sh (dtf_postgresql_phase_cleanup): Remove all logs. (dtf_postgresql_checkphase): Fail if some logs are present. * tasks/upgrade/locale/changed/runtest.sh: New file.
-rw-r--r--postgresql-tests/lib_pgsql.sh4
-rw-r--r--postgresql-tests/tasks/upgrade/locale/changed/runtest.sh29
2 files changed, 33 insertions, 0 deletions
diff --git a/postgresql-tests/lib_pgsql.sh b/postgresql-tests/lib_pgsql.sh
index 99cde85..8d44391 100644
--- a/postgresql-tests/lib_pgsql.sh
+++ b/postgresql-tests/lib_pgsql.sh
@@ -23,6 +23,7 @@ dtf_postgresql_phase_cleanup()
rlServiceStop postgresql
dtf_postgresql_check_stopped
rlRun "rm -rf /var/lib/pgsql/data"
+ rlRun "rm -rf /var/lib/pgsql/*.log"
rlPhaseEnd
}
@@ -34,6 +35,9 @@ dtf_postgresql_checkphase()
dtf_postgresql_check_stopped
rlAssertNotExists "/var/lib/pgsql/data/PG_VERSION"
+ while read line; do
+ rlAssertNotExists "$line"
+ done < <(find /var/lib/pgsql/ -maxdepth 1 -name '*.log')
rlAssert0 "run under root user" "$(id -u)"
diff --git a/postgresql-tests/tasks/upgrade/locale/changed/runtest.sh b/postgresql-tests/tasks/upgrade/locale/changed/runtest.sh
new file mode 100644
index 0000000..cea3368
--- /dev/null
+++ b/postgresql-tests/tasks/upgrade/locale/changed/runtest.sh
@@ -0,0 +1,29 @@
+export DTF_TEST_ID="upgrade-locale-changed"
+export DTF_TEST_DESCRIPTION="Check postgresql-setup --upgrade is able to work
+even if the system locale changed significantly. For example, the initdb was
+run with cs_CZ.utf8 locale and the current system locale is en_US.UTF-8."
+
+
+run()
+{
+ dtf_postgresql_test_init
+
+ dtf_postgresql_cb_upgrade()
+ {
+ rlRun 'PGSETUP_INITDB_OPTIONS="--locale=cs_CZ.utf8" postgresql-setup upgrade'
+ }
+
+ dtf_postgresql_cb_upgrade_select()
+ {
+ if rlIsFedora 20 21 22; then
+ cat
+ else
+ cat >/dev/null
+ fi
+ }
+
+ dtf_postgresql_upgrade_tour "$(dtf_postgresql_data_mirror)" locale-cz.tar.gz
+ rlAssert0 "test wrapper should finish successfully" $?
+
+ dtf_postgresql_test_finish
+}