Browse Source

Updated from OpenStack Ansible Tests

Change-Id: If1e9266f11fbb5d8284d77ff4176329e04e75035
stable/rocky
OpenStack Proposal Bot 1 year ago
parent
commit
10dff0600f
1 changed files with 8 additions and 7 deletions
  1. 8
    7
      run_tests.sh

+ 8
- 7
run_tests.sh View File

@@ -58,32 +58,33 @@ case ${ID,,} in
58 58
     *suse*) pkg_mgr_cmd="zypper -n in" ;;
59 59
     centos|rhel|fedora) pkg_mgr_cmd="${RHT_PKG_MGR} install -y" ;;
60 60
     ubuntu|debian) pkg_mgr_cmd="apt-get install -y" ;;
61
+    gentoo) pkg_mgr_cmd="emerge" ;;
61 62
     *) echo "unsupported distribution: ${ID,,}"; exit 1 ;;
62 63
 esac
63 64
 
64
-# Install git so that we can clone the tests repo
65
-eval sudo $pkg_mgr_cmd git
65
+# Install git so that we can clone the tests repo if git is not available
66
+which git &>/dev/null || eval sudo "${pkg_mgr_cmd}" git
66 67
 
67 68
 # Clone the tests repo for access to the common test script
68
-if [[ ! -d ${COMMON_TESTS_PATH} ]]; then
69
+if [[ ! -d "${COMMON_TESTS_PATH}" ]]; then
69 70
     # The tests repo doesn't need a clone, we can just
70 71
     # symlink it.
71 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 75
     # In zuul v3 any dependent repository is placed into
75 76
     # /home/zuul/src/git.openstack.org, so we check to see
76 77
     # if there is a tests checkout there already. If so, we
77 78
     # symlink that and use it.
78 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 82
     # Otherwise we're clearly not in zuul or using a previously setup
82 83
     # repo in some way, so just clone it from upstream.
83 84
     else
84
-        git clone -b ${TESTING_BRANCH} \
85
+        git clone -b "${TESTING_BRANCH}" \
85 86
             https://git.openstack.org/openstack/openstack-ansible-tests \
86
-            ${COMMON_TESTS_PATH}
87
+            "${COMMON_TESTS_PATH}"
87 88
     fi
88 89
 fi
89 90
 

Loading…
Cancel
Save