summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenStack Proposal Bot <openstack-infra@lists.openstack.org>2018-04-30 05:18:11 +0000
committerOpenStack Proposal Bot <openstack-infra@lists.openstack.org>2018-04-30 05:18:11 +0000
commitc37247e83c9a13606f8aba0dcf3e5a10e0e5d6cb (patch)
tree1f3f67c0f27db9c316c2f019ca8510e216c7574d
parente3997863438be50e08011ef7f347cd74beff8458 (diff)
Updated from OpenStack Ansible Tests
Notes
Notes (review): Code-Review+2: Jesse Pretorius (odyssey4me) <jesse.pretorius@rackspace.co.uk> Code-Review+2: Markos Chandras (hwoarang) <mchandras@suse.de> Workflow+1: Markos Chandras (hwoarang) <mchandras@suse.de> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 30 Apr 2018 11:03:49 +0000 Reviewed-on: https://review.openstack.org/565145 Project: openstack/ansible-hardening Branch: refs/heads/master
-rwxr-xr-xrun_tests.sh15
1 files changed, 8 insertions, 7 deletions
diff --git a/run_tests.sh b/run_tests.sh
index a31f946..4280085 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -58,32 +58,33 @@ case ${ID,,} in
58 *suse*) pkg_mgr_cmd="zypper -n in" ;; 58 *suse*) pkg_mgr_cmd="zypper -n in" ;;
59 centos|rhel|fedora) pkg_mgr_cmd="${RHT_PKG_MGR} install -y" ;; 59 centos|rhel|fedora) pkg_mgr_cmd="${RHT_PKG_MGR} install -y" ;;
60 ubuntu|debian) pkg_mgr_cmd="apt-get install -y" ;; 60 ubuntu|debian) pkg_mgr_cmd="apt-get install -y" ;;
61 gentoo) pkg_mgr_cmd="emerge" ;;
61 *) echo "unsupported distribution: ${ID,,}"; exit 1 ;; 62 *) echo "unsupported distribution: ${ID,,}"; exit 1 ;;
62esac 63esac
63 64
64# Install git so that we can clone the tests repo 65# Install git so that we can clone the tests repo if git is not available
65eval sudo $pkg_mgr_cmd git 66which git &>/dev/null || eval sudo "${pkg_mgr_cmd}" git
66 67
67# Clone the tests repo for access to the common test script 68# Clone the tests repo for access to the common test script
68if [[ ! -d ${COMMON_TESTS_PATH} ]]; then 69if [[ ! -d "${COMMON_TESTS_PATH}" ]]; then
69 # The tests repo doesn't need a clone, we can just 70 # The tests repo doesn't need a clone, we can just
70 # symlink it. 71 # symlink it.
71 if [[ "$(basename ${WORKING_DIR})" == "openstack-ansible-tests" ]]; then 72 if [[ "$(basename ${WORKING_DIR})" == "openstack-ansible-tests" ]]; then
72 ln -s ${WORKING_DIR} ${COMMON_TESTS_PATH} 73 ln -s "${WORKING_DIR}" "${COMMON_TESTS_PATH}"
73 74
74 # In zuul v3 any dependent repository is placed into 75 # In zuul v3 any dependent repository is placed into
75 # /home/zuul/src/git.openstack.org, so we check to see 76 # /home/zuul/src/git.openstack.org, so we check to see
76 # if there is a tests checkout there already. If so, we 77 # if there is a tests checkout there already. If so, we
77 # symlink that and use it. 78 # symlink that and use it.
78 elif [[ -d "${ZUUL_TESTS_CLONE_LOCATION}" ]]; then 79 elif [[ -d "${ZUUL_TESTS_CLONE_LOCATION}" ]]; then
79 ln -s "${ZUUL_TESTS_CLONE_LOCATION}" ${COMMON_TESTS_PATH} 80 ln -s "${ZUUL_TESTS_CLONE_LOCATION}" "${COMMON_TESTS_PATH}"
80 81
81 # Otherwise we're clearly not in zuul or using a previously setup 82 # Otherwise we're clearly not in zuul or using a previously setup
82 # repo in some way, so just clone it from upstream. 83 # repo in some way, so just clone it from upstream.
83 else 84 else
84 git clone -b ${TESTING_BRANCH} \ 85 git clone -b "${TESTING_BRANCH}" \
85 https://git.openstack.org/openstack/openstack-ansible-tests \ 86 https://git.openstack.org/openstack/openstack-ansible-tests \
86 ${COMMON_TESTS_PATH} 87 "${COMMON_TESTS_PATH}"
87 fi 88 fi
88fi 89fi
89 90