summaryrefslogtreecommitdiffstats
path: root/jjb/vpp
diff options
context:
space:
mode:
authorJan Gelety <jgelety@cisco.com>2018-02-13 12:26:16 +0100
committerJan Gelety <jgelety@cisco.com>2018-02-13 13:05:52 +0000
commitddb19fedc71e1978753f577cebc267072c6876ce (patch)
tree32effb7c548959edf458105868a21e046d1872ad /jjb/vpp
parent33685940c9e963333163b09876f3f257478bdadc (diff)
vpp-csit-verify: use latest verified CSIT branch by default
Jira: CSIT-875 To avoid updating verified CSIT branch name in VPP code base the latest verified CSIT branch will be used by default. VPP developer will have the possibility to define CSIT branch used to verify his patch set by putting CSIT branch name, e.g. oper-180122, to file build-root/scripts/csit-test-branch where the default value 'latest' will be stored. Change-Id: I5657bd833efe4ac98568a0c9ac3cd858af5e23e8 Signed-off-by: Jan Gelety <jgelety@cisco.com>
Diffstat (limited to 'jjb/vpp')
-rw-r--r--jjb/vpp/include-raw-vpp-csit-functional.sh54
-rw-r--r--jjb/vpp/include-raw-vpp-csit-verify-perf.sh54
-rw-r--r--jjb/vpp/vpp.yaml2
3 files changed, 98 insertions, 12 deletions
diff --git a/jjb/vpp/include-raw-vpp-csit-functional.sh b/jjb/vpp/include-raw-vpp-csit-functional.sh
index 38ef7e08e..38863fdac 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/
@@ -26,6 +31,43 @@ else
fi
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
+
# execute csit bootstrap script if it exists
if [ -e bootstrap.sh ]
then
diff --git a/jjb/vpp/include-raw-vpp-csit-verify-perf.sh b/jjb/vpp/include-raw-vpp-csit-verify-perf.sh
index aa59792ed..e2e88d8e4 100644
--- a/jjb/vpp/include-raw-vpp-csit-verify-perf.sh
+++ b/jjb/vpp/include-raw-vpp-csit-verify-perf.sh
@@ -12,14 +12,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 --depth 1 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/
@@ -31,6 +36,43 @@ else
fi
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
+
# execute csit bootstrap script if it exists
if [ ! -e bootstrap-verify-perf.sh ]
then
diff --git a/jjb/vpp/vpp.yaml b/jjb/vpp/vpp.yaml
index 28a688b6a..ef261e4d9 100644
--- a/jjb/vpp/vpp.yaml
+++ b/jjb/vpp/vpp.yaml
@@ -309,6 +309,7 @@
branch: '{branch}'
builders:
+ - shell: 'echo "VPP_BRANCH={branch}" > $WORKSPACE/variables.prop'
- shell:
!include-raw-escape:
- include-raw-vpp-checkstyle.sh
@@ -401,6 +402,7 @@
notbuilt: false
builders:
+ - shell: 'echo "VPP_BRANCH={branch}" > $WORKSPACE/variables.prop'
- shell:
!include-raw-escape:
- ../scripts/setup_vpp_dpdk_dev_env.sh