CSIT-1419 Convert vpp-virl job to vpp-device 70/17270/8
authorPeter Mikus <pmikus@cisco.com>
Sun, 3 Feb 2019 16:35:49 +0000 (16:35 +0000)
committerPeter Mikus <pmikus@cisco.com>
Tue, 19 Feb 2019 17:45:26 +0000 (17:45 +0000)
Change-Id: Iaac6a6182904a7ab1595f7534f0afd64caab6256
Signed-off-by: Peter Mikus <pmikus@cisco.com>
jjb/vpp/include-raw-vpp-csit-device.sh [new file with mode: 0644]
jjb/vpp/include-raw-vpp-csit-functional.sh [deleted file]
jjb/vpp/include-raw-vpp-csit-perf.sh [moved from jjb/vpp/clone-csit-run-main.sh with 100% similarity]
jjb/vpp/vpp-macros.yaml
jjb/vpp/vpp.yaml

diff --git a/jjb/vpp/include-raw-vpp-csit-device.sh b/jjb/vpp/include-raw-vpp-csit-device.sh
new file mode 100644 (file)
index 0000000..87be53f
--- /dev/null
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2019 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -exuo pipefail
+
+# Clone CSIT git repository and proceed with entry script located there.
+#
+# Variables read:
+# - WORKSPACE - Jenkins workspace to create csit subdirectory in.
+# - CSIT_REF - Override ref of CSIT git repository to checkout.
+# Directories updated:
+# - ${WORKSPACE}/csit - Created, holding a checked out CSIT repository.
+# - Multiple other side effects by entry script(s), see CSIT repository.
+
+cd "${WORKSPACE}"
+git clone https://gerrit.fd.io/r/csit --depth=1 --no-single-branch --no-checkout
+pushd "${WORKSPACE}/csit"
+if [[ -n "${CSIT_REF-}" ]]; then
+    git fetch --depth=1 https://gerrit.fd.io/r/csit "${CSIT_REF}"
+    git checkout FETCH_HEAD
+else
+    git checkout HEAD
+fi
+popd
+csit_entry_dir="${WORKSPACE}/csit/resources/libraries/bash/entry"
+source "${csit_entry_dir}/with_oper_for_vpp.sh" "per_patch_device.sh"
diff --git a/jjb/vpp/include-raw-vpp-csit-functional.sh b/jjb/vpp/include-raw-vpp-csit-functional.sh
deleted file mode 100644 (file)
index 5a7f27c..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/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
-
-# 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 [ $? != 0 ]; then
-    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/
-if [ -e dpdk/vpp-dpdk-dkms*.deb ]
-then
-    cp dpdk/vpp-dpdk-dkms*.deb csit/
-else
-    cp /w/dpdk/vpp-dpdk-dkms*.deb csit/
-fi
-
-# 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"
-                ;;
-            stable/1804 )
-                BRANCH_ID="oper-rls1804"
-                ;;
-            stable/1807 )
-                BRANCH_ID="oper-rls1807"
-                ;;
-            stable/1810 )
-                BRANCH_ID="oper-rls1810"
-                ;;
-            stable/1901 )
-                BRANCH_ID="oper-rls1901"
-                ;;
-            * )
-                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
-    # make sure that bootstrap.sh is executable
-    chmod +x bootstrap.sh
-    # run the script
-    ./bootstrap.sh *.deb
-else
-    echo 'ERROR: No bootstrap.sh found'
-    exit 1
-fi
-
-# vim: ts=4 ts=4 sts=4 et :
index bb35466..36cf959 100644 (file)
             notbuilt: true
 
 - trigger:
-    name: gerrit-trigger-csit-virltest
+    name: gerrit-trigger-csit-devicetest
     triggers:
       - gerrit:
           server-name: 'Primary'
           trigger-on:
             - comment-added-contains-event:
-                comment-contains-value: 'virltest'
+                comment-contains-value: 'devicetest'
           projects:
             - project-compare-type: 'ANT'
               project-pattern: '{name}'
index 69a404a..5e8769a 100644 (file)
@@ -54,7 +54,6 @@
 - project:
     name: vpp-misc
     jobs:
-      - 'vpp-csit-verify-virl-{stream}'
       - 'vpp-checkstyle-verify-{stream}'
     project: 'vpp'
     stream:
     name: vpp-perpatch
     jobs:
       - 'vpp-csit-verify-perf-{stream}-2n-skx'
+      - 'vpp-csit-verify-device-{stream}-1n-skx'
     project: 'vpp'
     stream:
       - master:
           branch: 'master'
           repo-stream-part: 'master'
-    os: ubuntu1604
+    os: ubuntu1804
 
 - project:
     name: vpp-master-only
           fixed-delay: 90
 
 - job-template:
-    name: 'vpp-csit-verify-virl-{stream}'
+    name: 'vpp-csit-verify-device-{stream}-1n-skx'
 
     project-type: freestyle
-    node: '{os}-us'
+    node: 'vpp-csit-device'
     concurrent: true
 
     build-discarder:
       - os-parameter:
           os: '{os}'
       - repo-name-parameter:
-          repo-name: '{repo-stream-part}.ubuntu.xenial.main'
-      - is-csit-vpp-job-parameter:
-          is-csit-vpp-job: 'True'
-      - string:
-          name: CSIT_REF
-          description: "Also testing CSIT_REF"
+          repo-name: '{repo-stream-part}.ubuntu.bionic.main'
+      - gerrit-refspec-parameter
+      - gerrit-event-type-parameter
+      - gerrit-event-comment-text-parameter
+      - gerrit-csit-refspec-parameter
       - stream-parameter:
           stream: '{stream}'
 
           build-timeout: '90'
 
     triggers:
-      - gerrit-trigger-csit-virltest:
+      - gerrit-trigger-csit-devicetest:
           name: '{project}'
           branch: '{branch}'
 
     builders:
-      - shell: 'echo "VPP_BRANCH={branch}" > $WORKSPACE/variables.prop'
-      - inject:
-          properties-file: variables.prop
       - shell:
-          !include-raw-escape:
-          - ../scripts/setup_vpp_ubuntu_docker_test.sh
-          - ../scripts/setup_vpp_dpdk_dev_env.sh
-          - include-raw-vpp-build.sh
+          !include-raw-escape: ../scripts/setup_vpp_ubuntu_docker_test.sh
       - shell:
           !include-raw-escape:
-          - include-raw-vpp-csit-functional.sh
+          - include-raw-vpp-csit-device.sh
+
 
     publishers:
       - archive-artifacts:
           artifacts: >
-            **/csit/report.html,
-            **/csit/log.html,
-            **/csit/output.xml
+            **/csit_current/**/*.*
           latest-only: false
 
       - robot-report:
-          output-path: 'csit'
+          output-path: 'csit_current/'
 
       - fdio-infra-shiplogs:
           maven-version: 'mvn33-new'
     name: 'vpp-csit-verify-perf-{stream}-2n-skx'
 
     project-type: freestyle
-    node: '{os}-basebuild-8c-32g'
+    node: '{os}-us'
     concurrent: true
 
     build-discarder:
           branch: '{branch}'
 
     builders:
+      - shell:
+          !include-raw-escape: ../scripts/setup_vpp_ubuntu_docker_test.sh
       - shell:
           !include-raw-escape:
-          - clone-csit-run-main.sh
+          - include-raw-vpp-csit-perf.sh
 
     publishers:
       - archive-artifacts:
           artifacts: >
-            **/csit_new/**/*.*,
+            **/csit_current/**/*.*,
             **/csit_parent/**/*.*
           latest-only: false
 
       - robot-report:
-          output-path: 'csit_new/0/'
+          output-path: 'csit_current/0/'
 
       - fdio-infra-shiplogs:
           maven-version: 'mvn33-new'