diff --git a/integration-tests/common.bash b/integration-tests/common.bash index baa20935ceefc2744d19ccf99a5a5be8bf8079f6..c6a9e99a0a410213fa5aba46f1be60ef47c487e6 100755 --- a/integration-tests/common.bash +++ b/integration-tests/common.bash @@ -632,3 +632,73 @@ function clean_after_tests { echo "Cleaning $WORK..." rm -fr $WORK } + +# +# ------ CLI utility/HELP functions ---------------- +# +function print_help { + echo "Usage: $0 [ (--dss | --openbis)* | --all [ --local-source ]]" + echo " --dss, --openbis, build chosen components only" + echo " --all build all components" + echo " --local-source use local source code during building process instead of downloading it from svn" + echo " --reinstall-all reinstalls all packeges new from the zip file which is in the installation direcory (also reinstall the packages which are not build)" + echo " --clean clean and exit" + echo " --help displays this help" + echo "If no option is given, integration tests will be restarted without building anything." + echo "Examples:" + echo "- Rebuild everything, fetch sources from svn:" + echo " $0 --all" + echo "- Use openbis server and client installation from previous tests, rebuild data store server using local source:" + echo " $0 --dss --local-source" + echo "- Rebuild data store server only fetching sources from svn:" + echo " $0 --dss" +} + +function parse_cli_args { + + install_dss=false + install_dmv=false + install_openbis=false + use_local_source=false + reinstall_all=false + while [ ! "$1" = "" ]; do + case "$1" in + '-e'|'--dss') + install_dss=true + ;; + '-d'|'--dmv') + install_dmv=true + ;; + '-o'|'--openbis') + install_openbis=true + ;; + '-a'|'--all') + install_dss=true + install_dmv=true + install_openbis=true + ;; + '--local-source') + use_local_source=true + ;; + '--reinstall-all') + reinstall_all=true + ;; + '--help') + print_help + exit 0 + ;; + '--assert-content') + assert_correct_content + exit 0 + ;; + *) + echo "Illegal option $1." + print_help + exit 1 + ;; + esac + shift + done + +} + diff --git a/integration-tests/test-3v.sh b/integration-tests/test-3v.sh index 7cf26a55258795e238303411cd7af01bb8e6c38a..c41a6d3e209f09718c40d5831b8e1a29acb8554b 100755 --- a/integration-tests/test-3v.sh +++ b/integration-tests/test-3v.sh @@ -298,52 +298,9 @@ function integration_tests { } # -- MAIN ------------ - if [ "$1" = "--clean" ]; then clean_after_tests else - install_dss=false - install_dmv=false - install_openbis=false - use_local_source=false - reinstall_all=false - while [ ! "$1" = "" ]; do - case "$1" in - '-e'|'--dss') - install_dss=true - ;; - '-d'|'--dmv') - install_dmv=true - ;; - '-o'|'--openbis') - install_openbis=true - ;; - '-a'|'--all') - install_dss=true - install_dmv=true - install_openbis=true - ;; - '--local-source') - use_local_source=true - ;; - '--reinstall-all') - reinstall_all=true - ;; - '--help') - print_help - exit 0 - ;; - '--assert-content') - assert_correct_content - exit 0 - ;; - *) - echo "Illegal option $1." - print_help - exit 1 - ;; - esac - shift - done + parse_cli_args $@ integration_tests $install_dss $install_dmv $install_openbis $use_local_source $reinstall_all fi diff --git a/integration-tests/test-archiving.sh b/integration-tests/test-archiving.sh index c9410fdc2092236048a20f75900eb7c8aa411080..4eff6bfa51358171213cc9c514c1fd600756d1da 100755 --- a/integration-tests/test-archiving.sh +++ b/integration-tests/test-archiving.sh @@ -26,7 +26,7 @@ source common.bash # ----- local constants -------------------- -TIME_TO_COMPLETE=60 # time (in seconds) needed by the whole pipeline to process everything +TIME_TO_COMPLETE=90 # time (in seconds) needed by the whole pipeline to process everything TEST_DATA_DIR=templates/data-archiving ARCHIVE_DIR=/tmp/integration-tests/archiving/rsync-archive ARCHIVE_DATASET=ARCHIVE_DATASET @@ -213,32 +213,6 @@ function integration_test { exit_if_assertion_failed } - - - -# -# ------ CLI utility/HELP functions ---------------- -# -function print_help { - echo "Usage: $0 [ (--dss | --openbis)* | --all [ --local-source ]]" - echo " --dss, --openbis, build chosen components only" - echo " --all build all components" - echo " --local-source use local source code during building process instead of downloading it from svn" - echo " --reinstall-all reinstalls all packeges new from the zip file which is in the installation direcory (also reinstall the packages which are not build)" - echo " --clean clean and exit" - echo " --help displays this help" - echo "If no option is given, integration tests will be restarted without building anything." - echo "Examples:" - echo "- Rebuild everything, fetch sources from svn:" - echo " $0 --all" - echo "- Use openbis server and client installation from previous tests, rebuild data store server using local source:" - echo " $0 --dss --local-source" - echo "- Rebuild data store server only fetching sources from svn:" - echo " $0 --dss" -} - - - # # -- MAIN (copied from)------------ # @@ -246,45 +220,6 @@ function print_help { if [ "$1" = "--clean" ]; then clean_after_tests else - install_dss=false - install_dmv=false - install_openbis=false - use_local_source=false - reinstall_all=false - while [ ! "$1" = "" ]; do - case "$1" in - '-e'|'--dss') - install_dss=true - ;; - '-d'|'--dmv') - install_dmv=true - ;; - - '-o'|'--openbis') - install_openbis=true - ;; - '-a'|'--all') - install_dss=true - install_dmv=true - install_openbis=true - ;; - '--local-source') - use_local_source=true - ;; - '--reinstall-all') - reinstall_all=true - ;; - '--help') - print_help - exit 0 - ;; - *) - echo "Illegal option $1." - print_help - exit 1 - ;; - esac - shift - done + parse_cli_args $@ integration_test $install_dss $install_dmv $install_openbis $use_local_source $reinstall_all fi diff --git a/integration-tests/test-yeastx.sh b/integration-tests/test-yeastx.sh index 332bbce499229f0df3defacd52995c8c9d0b94b9..98539e45f86efbad4b18abc79f67e40834cc64ce 100755 --- a/integration-tests/test-yeastx.sh +++ b/integration-tests/test-yeastx.sh @@ -27,28 +27,8 @@ function prepare_data { chmod -R 700 $MY_DATA/incoming* } -function build_and_install_components { - local use_local_source=$1 - - local install_dss=true - local install_dmv=false - local install_openbis=true - local reinstall_all=false - build_and_install $install_dss $install_dmv $install_openbis $use_local_source $reinstall_all -} - -function refresh_components_and_start_openbis { - local use_local_source=false - local install_dss=false - local install_dmv=false - local install_openbis=false - local reinstall_all=false - - build_and_install $install_dss $install_dmv $install_openbis $use_local_source $reinstall_all -} - function build_and_install_yeastx { - unzip $INSTALL/datastore_server_plugin-yeastx-*.zip -d $WORK/datastore_server_yeastx + unzip -u $INSTALL/datastore_server_plugin-yeastx-*.zip -d $WORK/datastore_server_yeastx chmod_exec $WORK/datastore_server_yeastx/takeCifsOwnershipRecursive.sh prepare_data @@ -203,7 +183,9 @@ function assert_correct_incoming_contents { } function integration_tests_yeastx { - build_and_install_yeastx + build_and_install $@ + build_and_install_yeastx + switch_dss "on" datastore_server_yeastx sleep 90 @@ -214,21 +196,11 @@ function integration_tests_yeastx { exit_if_assertion_failed } -function build_from_local_source_and_test { - build_and_install_components true - integration_tests_yeastx -} - -function build_from_svn_source_and_test { - build_and_install_components false - integration_tests_yeastx -} - -# can be called only if the build has been already done -function test_without_build { - refresh_components_and_start_openbis - integration_tests_yeastx -} -test_without_build -#build_from_local_source_and_test \ No newline at end of file +# -- MAIN ------------ +if [ "$1" = "--clean" ]; then + clean_after_tests +else + parse_cli_args $@ + integration_tests_yeastx $install_dss $install_dmv $install_openbis $use_local_source $reinstall_all +fi