From 3ab8821ad9ff11860bcf6d27301840978ce494c5 Mon Sep 17 00:00:00 2001 From: OpenStack Proposal Bot Date: Mon, 30 Apr 2018 05:14:52 +0000 Subject: [PATCH] Updated from OpenStack Ansible Tests Change-Id: I73849541073f89d54cd7fb18973ea3ecbc25682d --- run_tests.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index a31f9464..4280085e 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -58,32 +58,33 @@ case ${ID,,} in *suse*) pkg_mgr_cmd="zypper -n in" ;; centos|rhel|fedora) pkg_mgr_cmd="${RHT_PKG_MGR} install -y" ;; ubuntu|debian) pkg_mgr_cmd="apt-get install -y" ;; + gentoo) pkg_mgr_cmd="emerge" ;; *) echo "unsupported distribution: ${ID,,}"; exit 1 ;; esac -# Install git so that we can clone the tests repo -eval sudo $pkg_mgr_cmd git +# Install git so that we can clone the tests repo if git is not available +which git &>/dev/null || eval sudo "${pkg_mgr_cmd}" git # Clone the tests repo for access to the common test script -if [[ ! -d ${COMMON_TESTS_PATH} ]]; then +if [[ ! -d "${COMMON_TESTS_PATH}" ]]; then # The tests repo doesn't need a clone, we can just # symlink it. if [[ "$(basename ${WORKING_DIR})" == "openstack-ansible-tests" ]]; then - ln -s ${WORKING_DIR} ${COMMON_TESTS_PATH} + ln -s "${WORKING_DIR}" "${COMMON_TESTS_PATH}" # In zuul v3 any dependent repository is placed into # /home/zuul/src/git.openstack.org, so we check to see # if there is a tests checkout there already. If so, we # symlink that and use it. elif [[ -d "${ZUUL_TESTS_CLONE_LOCATION}" ]]; then - ln -s "${ZUUL_TESTS_CLONE_LOCATION}" ${COMMON_TESTS_PATH} + ln -s "${ZUUL_TESTS_CLONE_LOCATION}" "${COMMON_TESTS_PATH}" # Otherwise we're clearly not in zuul or using a previously setup # repo in some way, so just clone it from upstream. else - git clone -b ${TESTING_BRANCH} \ + git clone -b "${TESTING_BRANCH}" \ https://git.openstack.org/openstack/openstack-ansible-tests \ - ${COMMON_TESTS_PATH} + "${COMMON_TESTS_PATH}" fi fi