From 98df0c8b79a964c94df0c7b731fe790073214eba Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Fri, 3 Oct 2014 14:44:34 +0200 Subject: tasks/initdb: fixes for f20 Older versions of postgresql-setup do not support --initdb option. * lib_pgsql.sh (dtf_postgresql_phase_cleanup): Do not fail when the data directory is not created by test. * tasks/initdb/runtest.sh: Avoid running this test on older RHEL/Fedora systems. --- lib_pgsql.sh | 2 +- tasks/initdb/runtest.sh | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib_pgsql.sh b/lib_pgsql.sh index 9db69d1..3e8e047 100644 --- a/lib_pgsql.sh +++ b/lib_pgsql.sh @@ -22,7 +22,7 @@ dtf_postgresql_phase_cleanup() rlPhaseStartCleanup rlServiceStop postgresql dtf_postgresql_check_stopped - rlRun "rm -r /var/lib/pgsql/data" + rlRun "rm -rf /var/lib/pgsql/data" rlPhaseEnd } diff --git a/tasks/initdb/runtest.sh b/tasks/initdb/runtest.sh index 5a942ef..d5323bd 100755 --- a/tasks/initdb/runtest.sh +++ b/tasks/initdb/runtest.sh @@ -1,5 +1,11 @@ dtf_postgresql_test_init -rlRun "postgresql-setup --initdb" -rlServiceStart postgresql -dtf_postgresql_check_started +if rlIsFedora 18 19 20 || rlIsRHEL 5 6 7; then + # This syntaxe is not supported on oler systems. + : +else + rlRun "postgresql-setup --initdb" + rlServiceStart postgresql + dtf_postgresql_check_started +fi + dtf_postgresql_test_finish -- cgit