Fix of error handling in contrail backup

In cassandra-backup-client-runner-call.sh rsync command redirect to
log file only stdout and all error messages aren't caught by error
handling code

Closes-Bug: PROD-35981
Change-Id: Idd8a069d81c7e110c1cd988e42d7148c0dd5842a
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 9761585..b4ce276 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -37,9 +37,13 @@
 
 setup_virtualenv() {
     log_info "Setting up Python virtualenv"
+    dependency_check virtualenv
     virtualenv $VENV_DIR
     source ${VENV_DIR}/bin/activate
     python -m pip install salt${PIP_SALT_VERSION}
+    if [[ -f ${CURDIR}/test-requirements.txt ]]; then
+       python -m pip install -r ${CURDIR}/test-requirements.txt
+    fi
 }
 
 setup_mock_bin() {
@@ -165,6 +169,13 @@
     done
 }
 
+dependency_check() {
+  local DEPENDENCY_COMMANDS=$*
+  for DEPENDENCY_COMMAND in $DEPENDENCY_COMMANDS; do
+    which $DEPENDENCY_COMMAND > /dev/null || ( log_err "Command \"$DEPENDENCY_COMMAND\" can not be found in default path."; exit 1; )
+  done
+}
+
 _atexit() {
     RETVAL=$?
     trap true INT TERM EXIT