Merge "Get CSIT branch from build-root/scripts/csit-test-branch"
authorC.J. Collier <cjcollier@linuxfoundation.org>
Thu, 9 Jun 2016 06:21:01 +0000 (06:21 +0000)
committerGerrit Code Review <gerrit@fd.io>
Thu, 9 Jun 2016 06:21:01 +0000 (06:21 +0000)
jjb/vpp/include-raw-vpp-csit-functional.sh
jjb/vpp/include-raw-vpp-csit-verify-perf.sh

index 93be0ad..33eef0f 100644 (file)
@@ -1,8 +1,21 @@
 #!/bin/bash
 set -xeu -o pipefail
 
+# Get CSIT branch from which to test from
+# running build-root/scripts/csit-test-branch
+if [ -x build-root/scripts/csit-test-branch ]; then
+    CSIT_BRANCH=`build-root/scripts/csit-test-branch`;
+fi
+
 # Clone csit and start tests
-git clone https://gerrit.fd.io/r/csit --branch csit-verified
+git clone https://gerrit.fd.io/r/csit --branch ${CSIT_BRANCH:-csit-verified}
+
+# If the git clone fails, complain clearly and exit
+if [ $? != 0 ]; then
+    echo "Failed to run: git clone https://gerrit.fd.io/r/csit --branch ${CSIT_BRANCH:-csit-verified}"
+    echo "No such branch ${CSIT_BRANCH:-csit-verified} in https://gerrit.fd.io/r/csit"
+    exit
+fi
 
 cp build-root/*.deb csit/
 cd csit
index f24692d..a314260 100644 (file)
@@ -3,9 +3,22 @@ set -xeu -o pipefail
 
 export TEST_TAG="PERFTEST_${TYPE^^}"
 
+# Get CSIT branch from which to test from
+# running build-root/scripts/csit-test-branch
+if [ -x build-root/scripts/csit-test-branch ]; then
+    CSIT_BRANCH=`build-root/scripts/csit-test-branch`;
+fi
+
 # Clone csit and start tests
 git clone --depth 1 https://gerrit.fd.io/r/csit --branch csit-verified
 
+# If the git clone fails, complain clearly and exit
+if [ $? != 0 ]; then
+    echo "Failed to run: git clone https://gerrit.fd.io/r/csit --branch ${CSIT_BRANCH:-csit-verified}"
+    echo "No such branch ${CSIT_BRANCH:-csit-verified} in https://gerrit.fd.io/r/csit"
+    exit
+fi
+
 cp build-root/*.deb csit/
 cd csit
 # execute csit bootstrap script if it exists