From 2422a081a5be0d5ac5afb122361bc283da67341f Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Wed, 22 Oct 2014 08:54:05 +0200 Subject: big reorg: prepare for generalization Try to split into three separate components -> controller, tester, and 'tasks' (postgresql-tasks in our case). The controller component is the main part which is able to run the task remotely. Tester is more-like library for 'tasks' component (should be reusable on the raw git level). * controller: Almost separated component. * postgresql-tasks: Likewise. * tester: Likewise. --- postgresql-tests/tasks/initdb/config.sh | 4 ++++ postgresql-tests/tasks/initdb/runtest.sh | 11 +++++++++++ postgresql-tests/tasks/initdb_old/config.sh | 4 ++++ postgresql-tests/tasks/initdb_old/runtest.sh | 5 +++++ postgresql-tests/tasks/upgrade-basic/config.sh | 2 ++ postgresql-tests/tasks/upgrade-basic/runtest.sh | 6 ++++++ postgresql-tests/tasks/upgrade-utf8-syntax/config.sh | 3 +++ postgresql-tests/tasks/upgrade-utf8-syntax/runtest.sh | 15 +++++++++++++++ 8 files changed, 50 insertions(+) create mode 100644 postgresql-tests/tasks/initdb/config.sh create mode 100755 postgresql-tests/tasks/initdb/runtest.sh create mode 100644 postgresql-tests/tasks/initdb_old/config.sh create mode 100755 postgresql-tests/tasks/initdb_old/runtest.sh create mode 100644 postgresql-tests/tasks/upgrade-basic/config.sh create mode 100644 postgresql-tests/tasks/upgrade-basic/runtest.sh create mode 100644 postgresql-tests/tasks/upgrade-utf8-syntax/config.sh create mode 100644 postgresql-tests/tasks/upgrade-utf8-syntax/runtest.sh (limited to 'postgresql-tests/tasks') diff --git a/postgresql-tests/tasks/initdb/config.sh b/postgresql-tests/tasks/initdb/config.sh new file mode 100644 index 0000000..c7f6619 --- /dev/null +++ b/postgresql-tests/tasks/initdb/config.sh @@ -0,0 +1,4 @@ +DTF_TEST_ID="initdb-basic" +DTF_TEST_DESCRIPTION="\ +Check that the syntax 'postgresql-setup --initdb' works together with following +'service start postgresql'." diff --git a/postgresql-tests/tasks/initdb/runtest.sh b/postgresql-tests/tasks/initdb/runtest.sh new file mode 100755 index 0000000..ee520d6 --- /dev/null +++ b/postgresql-tests/tasks/initdb/runtest.sh @@ -0,0 +1,11 @@ +dtf_postgresql_test_init +if rlIsFedora 18 19 20 21 || 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 diff --git a/postgresql-tests/tasks/initdb_old/config.sh b/postgresql-tests/tasks/initdb_old/config.sh new file mode 100644 index 0000000..2386677 --- /dev/null +++ b/postgresql-tests/tasks/initdb_old/config.sh @@ -0,0 +1,4 @@ +DTF_TEST_ID="initdb-old-syntax" +DTF_TEST_DESCRIPTION="\ +Check that the old syntax 'postgresql-setup initdb' works together with +following 'service start postgresql'." diff --git a/postgresql-tests/tasks/initdb_old/runtest.sh b/postgresql-tests/tasks/initdb_old/runtest.sh new file mode 100755 index 0000000..6a8d63c --- /dev/null +++ b/postgresql-tests/tasks/initdb_old/runtest.sh @@ -0,0 +1,5 @@ +dtf_postgresql_test_init +rlRun "postgresql-setup initdb" +rlServiceStart postgresql +dtf_postgresql_check_started +dtf_postgresql_test_finish diff --git a/postgresql-tests/tasks/upgrade-basic/config.sh b/postgresql-tests/tasks/upgrade-basic/config.sh new file mode 100644 index 0000000..a1d4a2f --- /dev/null +++ b/postgresql-tests/tasks/upgrade-basic/config.sh @@ -0,0 +1,2 @@ +export DTF_TEST_ID="basic-upgrade" +export DTF_TEST_DESCRIPTION="Check postgresql-setup [--]upgrade" diff --git a/postgresql-tests/tasks/upgrade-basic/runtest.sh b/postgresql-tests/tasks/upgrade-basic/runtest.sh new file mode 100644 index 0000000..5dd85bb --- /dev/null +++ b/postgresql-tests/tasks/upgrade-basic/runtest.sh @@ -0,0 +1,6 @@ +dtf_postgresql_test_init + +dtf_postgresql_upgrade_tour "$dtf_dataurl" basic.tar.gz +rlAssert0 "test wrapper should finish successfully" $? + +dtf_postgresql_test_finish diff --git a/postgresql-tests/tasks/upgrade-utf8-syntax/config.sh b/postgresql-tests/tasks/upgrade-utf8-syntax/config.sh new file mode 100644 index 0000000..bed95ad --- /dev/null +++ b/postgresql-tests/tasks/upgrade-utf8-syntax/config.sh @@ -0,0 +1,3 @@ +export DTF_TEST_ID="basic-locale-utf8-syntax" +export DTF_TEST_DESCRIPTION="Check postgresql-setup --upgrade works even when \ +the system locale changed from xx_XX.utf8 to xx_XX.UTF-8" diff --git a/postgresql-tests/tasks/upgrade-utf8-syntax/runtest.sh b/postgresql-tests/tasks/upgrade-utf8-syntax/runtest.sh new file mode 100644 index 0000000..9e7d9cf --- /dev/null +++ b/postgresql-tests/tasks/upgrade-utf8-syntax/runtest.sh @@ -0,0 +1,15 @@ +dtf_postgresql_test_init + +dtf_postgresql_cb_upgrade_select() +{ + if rlIsFedora 20 21 22; then + cat + else + cat >/dev/null + fi +} + +dtf_postgresql_upgrade_tour "$dtf_dataurl" locale-utf-typo.tar.gz +rlAssert0 "test wrapper should finish successfully" $? + +dtf_postgresql_test_finish -- cgit