CSIT-1597 API cleanup: classify
[csit.git] / resources / libraries / bash / function / common.sh
index 1ef7c93..8665913 100644 (file)
@@ -113,16 +113,16 @@ function activate_virtualenv () {
     env_dir="${root_path}/env"
     req_path=${2-$CSIT_DIR/requirements.txt}
     rm -rf "${env_dir}" || die "Failed to clean previous virtualenv."
-    pip install --upgrade virtualenv || {
+    pip3 install --upgrade virtualenv || {
         die "Virtualenv package install failed."
     }
-    virtualenv "${env_dir}" || {
-        die "Virtualenv creation failed."
+    virtualenv -p $(which python3) "${env_dir}" || {
+        die "Virtualenv creation for $(which python3) failed."
     }
     set +u
     source "${env_dir}/bin/activate" || die "Virtualenv activation failed."
     set -u
-    pip install --upgrade -r "${req_path}" || {
+    pip3 install --upgrade -r "${req_path}" || {
         die "Requirements installation failed."
     }
     # Most CSIT Python scripts assume PYTHONPATH is set and exported.
@@ -565,7 +565,7 @@ function reserve_and_cleanup_testbed () {
             set +e
             scrpt="${PYTHON_SCRIPTS_DIR}/topo_reservation.py"
             opts=("-t" "${topo}" "-r" "${BUILD_TAG:-Unknown}")
-            python "${scrpt}" "${opts[@]}"
+            python3 "${scrpt}" "${opts[@]}"
             result="$?"
             set -e
             if [[ "${result}" == "0" ]]; then
@@ -637,7 +637,7 @@ function run_pybot () {
 
     pushd "${CSIT_DIR}" || die "Change directory operation failed."
     set +e
-    pybot "${all_options[@]}" "${GENERATED_DIR}/tests/"
+    robot "${all_options[@]}" "${GENERATED_DIR}/tests/"
     PYBOT_EXIT_STATUS="$?"
     set -e
 
@@ -1028,7 +1028,7 @@ function untrap_and_unreserve_testbed () {
         warn "Testbed looks unreserved already. Trap removal failed before?"
     else
         ansible_hosts "cleanup" || true
-        python "${PYTHON_SCRIPTS_DIR}/topo_reservation.py" -c -t "${wt}" || {
+        python3 "${PYTHON_SCRIPTS_DIR}/topo_reservation.py" -c -t "${wt}" || {
             die "${1:-FAILED TO UNRESERVE, FIX MANUALLY.}" 2
         }
         WORKING_TOPOLOGY=""