X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=jjb%2Fvpp%2Finclude-raw-vpp-csit-functional.sh;h=988b14a0a77493f08aed38bed7494ee9117e9537;hb=41c5cb8991087acef9b9405d1743d80f71fd8338;hp=38ef7e08ecfb240d934ea87cccfede0f06726eaa;hpb=bc2f8a43066b8e6af18ec98b4752249d97ca20aa;p=ci-management.git diff --git a/jjb/vpp/include-raw-vpp-csit-functional.sh b/jjb/vpp/include-raw-vpp-csit-functional.sh index 38ef7e08e..988b14a0a 100644 --- a/jjb/vpp/include-raw-vpp-csit-functional.sh +++ b/jjb/vpp/include-raw-vpp-csit-functional.sh @@ -7,14 +7,19 @@ 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_BRANCH:-csit-verified} +# check CSIT_BRANCH value +if [ "$CSIT_BRANCH" == "" ]; then + echo "CSIT_BRANCH not provided => 'latest' will be used" + CSIT_BRANCH="latest" +fi + +# clone csit +git clone --depth 1 --no-single-branch https://gerrit.fd.io/r/csit -# If the git clone fails, complain clearly and exit +# 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 + echo "Failed to run: git clone --depth 1 --no-single-branch https://gerrit.fd.io/r/csit" + exit 1 fi cp build-root/*.deb csit/ @@ -25,7 +30,52 @@ else cp /var/cache/apt/archives/vpp-dpdk-dkms*.deb csit/ fi -cd csit +# Check for CSIT_REF test file +if [ -e CSIT_REF ]; then + source CSIT_REF +fi + +# If also testing a specific csit refpoint look for CSIT_REF +if [[ -v CSIT_REF ]]; then + (cd csit ; git fetch ssh://rotterdam-jobbuilder@gerrit.fd.io:29418/csit $CSIT_REF && git checkout FETCH_HEAD) +else + cd csit + if [ "$CSIT_BRANCH" == "latest" ]; then + # set required CSIT branch_id based on VPP master branch; by default use 'oper' + case "$VPP_BRANCH" in + master ) + BRANCH_ID="oper" + ;; + stable/1710 ) + BRANCH_ID="oper-rls1710" + ;; + stable/1801 ) + BRANCH_ID="oper-rls1801" + ;; + * ) + BRANCH_ID="oper" + esac + + # get the latest verified version of the required branch + CSIT_BRANCH=$(echo $(git branch -r | grep -E "${BRANCH_ID}-[0-9]+" | tail -n 1)) + + if [ "${CSIT_BRANCH}" == "" ]; then + echo "No verified CSIT branch found - exiting" + exit 1 + fi + + # remove 'origin/' from the branch name + CSIT_BRANCH=$(echo ${CSIT_BRANCH#origin/}) + fi + # checkout the required csit branch + git checkout ${CSIT_BRANCH} + + if [ $? != 0 ]; then + echo "Failed to checkout the required CSIT branch: ${CSIT_BRANCH}" + exit 1 + fi +fi + # execute csit bootstrap script if it exists if [ -e bootstrap.sh ] then