Merge "bug fix: reporting Tempest"
authorMorgan Richomme <morgan.richomme@orange.com>
Fri, 1 Sep 2017 07:03:15 +0000 (07:03 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Fri, 1 Sep 2017 07:03:15 +0000 (07:03 +0000)
jjb/apex/apex-download-artifact.sh
jjb/apex/apex-unit-test.sh
jjb/ci_gate_security/anteater-report-to-gerrit.sh
jjb/fuel/fuel-daily-jobs.yml
jjb/releng/opnfv-repo-archiver.sh [new file with mode: 0644]
jjb/releng/opnfv-utils.yml
jjb/yardstick/yardstick-daily.sh
utils/test/testapi/3rd_party/static/testapi-ui/components/pods/pods.html
utils/test/testapi/3rd_party/static/testapi-ui/components/pods/podsController.js

index 860cd60..7293e82 100755 (executable)
@@ -21,7 +21,7 @@ if [[ "$ARTIFACT_VERSION" =~ dev ]]; then
   tar -xvf apex-${OPNFV_ARTIFACT_VERSION}.tar.gz
   popd > /dev/null
 else
-  echo "Will download RPMs..."
+  echo "Will use RPMs..."
 
   # Must be RPMs/ISO
   echo "Downloading latest properties file"
@@ -33,13 +33,13 @@ else
   source $BUILD_DIRECTORY/opnfv.properties
 
   RPM_INSTALL_PATH=$(echo "http://"$OPNFV_RPM_URL | sed 's/\/'"$(basename $OPNFV_RPM_URL)"'//')
-  RPM_LIST=${RPM_INSTALL_PATH}/$(basename $OPNFV_RPM_URL)
+  RPM_LIST=$(basename $OPNFV_RPM_URL)
 
   # find version of RPM
   VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | grep -Eo '[0-9]+\.[0-9]+-([0-9]{8}|[a-z]+-[0-9]\.[0-9]+)')
   # build RPM List which already includes base Apex RPM
-  RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-undercloud-${VERSION_EXTENSION}.noarch.rpm"
-  RPM_LIST+=" ${RPM_INSTALL_PATH}/python34-opnfv-apex-${VERSION_EXTENSION}.noarch.rpm"
+  RPM_LIST+=" opnfv-apex-undercloud-${VERSION_EXTENSION}.noarch.rpm"
+  RPM_LIST+=" python34-opnfv-apex-${VERSION_EXTENSION}.noarch.rpm"
 
   # remove old / install new RPMs
   if rpm -q opnfv-apex > /dev/null; then
@@ -48,10 +48,20 @@ else
       sudo yum remove -y ${INSTALLED_RPMS}
     fi
   fi
+  # Create an rpms dir on slave
+  mkdir -p ~/apex_rpms
+  pushd ~/apex_rpms
+  # Remove older rpms which do not match this version
+  find . ! -name *${VERSION_EXTENSION}.noarch.rpm -type f -exec rm -f {} +
+  # Download RPM only if changed on server
+  for rpm in $RPM_LIST; do
+    wget -N ${RPM_INSTALL_PATH}/${rpm}
+  done
   if ! sudo yum install -y $RPM_LIST; then
     echo "Unable to install new RPMs: $RPM_LIST"
     exit 1
   fi
+  popd
 fi
 
 # TODO: Uncomment these lines to verify SHA512SUMs once the sums are
index 12cb862..abcddca 100755 (executable)
@@ -9,7 +9,6 @@ echo
 
 
 pushd ci/ > /dev/null
-sudo BASE="${WORKSPACE}/build" LIB="${WORKSPACE}/lib" ./clean.sh
 ./test.sh
 popd
 
index 00a78ce..a749d1d 100644 (file)
@@ -13,7 +13,7 @@ if [[ -e securityaudit.log ]] ; then
         EXITSTATUS=1
     fi
 
-    cat securityaudit.log  | awk -F"ERROR - " '{print $2}' | sed -e "s/\"/\\\\\"/g;s/\'/\\\\\'/g"> shortlog
+    awk -F"ERROR - " '{print $2}' securityaudit.log | sed -e "s/\"/\\\\\"/g;s/\'/\\\\/g"> shortlog
 
     ssh -p 29418 gerrit.opnfv.org \
         "gerrit review -p $GERRIT_PROJECT \
index cbdd3dd..e5bb409 100644 (file)
         branch: 'stable/{stream}'
         disabled: true
         gs-pathname: '/{stream}'
+    danube: &danube
+        stream: danube
+        branch: 'stable/{stream}'
+        disabled: false
+        gs-pathname: '/{stream}'
 #--------------------------------
 # POD, INSTALLER, AND BRANCH MAPPING
 #--------------------------------
@@ -53,6 +58,9 @@
         - zte-pod3:
             slave-label: zte-pod3
             <<: *euphrates
+        - zte-pod1:
+            slave-label: zte-pod1
+            <<: *danube
 #--------------------------------
 #       scenarios
 #--------------------------------
         # 2.here the stream means the SUT stream, dovetail stream is defined in its own job
         # 3.only debug testsuite here(refstack, ha, ipv6, bgpvpn)
         # 4.not used for release criteria or compliance,
-        #   only to debug the dovetail tool bugs with bgpvpn
-        # 5,only run against scenario os-odl_l2-bgpvpn-ha(regex used here, can extend to more scenarios future)
+        #   only to debug the dovetail tool bugs with bgpvpn and nosdn-nofeature
+        # 5.only run against scenario os-odl_l2-bgpvpn-ha(regex used here, can extend to more scenarios future)
+        # 6.ZTE pod1, os-nosdn-nofeature-ha and os-odl_l2-bgpvpn-ha, run against danube
         - conditional-step:
             condition-kind: regex-match
-            regex: os-odl_l2-bgpvpn-ha
+            regex: os-(nosdn-nofeature|odl_l2-bgpvpn)-ha
             label: '{scenario}'
             steps:
                 - trigger-builds:
                         build-step-failure-threshold: 'never'
                         failure-threshold: 'never'
                         unstable-threshold: 'FAILURE'
-        # ZTE pod1 weekly(Sunday), os-odl_l2-nofeature-ha, run against master and euphrates
-        - conditional-step:
-            condition-kind: and
-            condition-operands:
-                - condition-kind: regex-match
-                  regex: os-odl_l2-nofeature-ha
-                  label: '{scenario}'
-                - condition-kind: regex-match
-                  regex: zte-pod1
-                  label: '{pod}'
-                - condition-kind: day-of-week
-                  day-selector: select-days
-                  days:
-                      SAT: true
-                  use-build-time: true
-            steps:
-                - trigger-builds:
-                    - project: 'dovetail-fuel-zte-pod1-proposed_tests-{stream}'
-                      current-parameters: false
-                      predefined-parameters:
-                        DEPLOY_SCENARIO={scenario}
-                      block: true
-                      same-node: true
-                      block-thresholds:
-                        build-step-failure-threshold: 'never'
-                        failure-threshold: 'never'
-                        unstable-threshold: 'FAILURE'
 
     publishers:
         - email:
     name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-noha-zte-pod3-daily-euphrates-trigger'
     triggers:
         - timed: ''
+#------------------------------------------------
+# ZTE POD1 Triggers running against danube branch
+#------------------------------------------------
+- trigger:
+    name: 'fuel-os-nosdn-nofeature-ha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: '0 2 * * 6'
+- trigger:
+    name: 'fuel-os-odl_l2-nofeature-ha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-odl_l3-nofeature-ha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-onos-sfc-ha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-onos-nofeature-ha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-odl_l2-bgpvpn-ha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: '0 2 * * 1,3,5'
+- trigger:
+    name: 'fuel-os-odl_l2-sfc-ha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-nosdn-kvm-ha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-nosdn-ovs-ha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
+# NOHA Scenarios
+- trigger:
+    name: 'fuel-os-nosdn-nofeature-noha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-odl_l2-nofeature-noha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-odl_l3-nofeature-noha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-onos-sfc-noha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-onos-nofeature-noha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-odl_l2-sfc-noha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-odl_l2-bgpvpn-noha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-nosdn-kvm-noha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-nosdn-ovs-noha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-nosdn-kvm_ovs_dpdk-noha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-noha-zte-pod1-daily-danube-trigger'
+    triggers:
+        - timed: ''
diff --git a/jjb/releng/opnfv-repo-archiver.sh b/jjb/releng/opnfv-repo-archiver.sh
new file mode 100644 (file)
index 0000000..c9fdba3
--- /dev/null
@@ -0,0 +1,66 @@
+#!/bin/bash
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2016 Linux Foundation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+set -o errexit
+set -o pipefail
+export PATH=$PATH:/usr/local/bin/
+
+DATE="$(date +%Y%m%d)"
+
+declare -a PROJECT_LIST
+EXCLUDE_PROJECTS="All-Projects|All-Users|securedlab"
+CLONE_PATH="$WORKSPACE/opnfv-repos"
+
+# Generate project list from gerrit
+PROJECT_LIST=($(ssh -p 29418 jenkins-ci@gerrit.opnfv.org gerrit ls-projects | egrep -v $EXCLUDE_PROJECTS))
+
+echo "Cloning all OPNFV repositories"
+echo "------------------------------"
+
+for PROJECT in "${PROJECT_LIST[@]}"; do
+  echo "> Cloning $PROJECT"
+  if [ ! -d "$CLONE_PATH/$PROJECT" ]; then
+    git clone "https://gerrit.opnfv.org/gerrit/$PROJECT.git" $CLONE_PATH/$PROJECT
+  else
+    pushd "$CLONE_PATH/$PROJECT" &>/dev/null
+    git pull -f
+    popd &> /dev/null
+  fi
+
+  # Don't license scan kernel or qemu in kvmfornfv
+  if [ "$PROJECT" == "kvmfornfv" ]; then
+    rm -rf "$CLONE_PATH/$PROJECT/{kernel,qemu}"
+  fi
+done
+
+echo "Finished cloning OPNFV repositories"
+echo "-----------------------------------"
+
+# Copy repos and clear git data
+echo "Copying repos to $WORKSPACE/opnfv-archive and removing .git files"
+cp -R $CLONE_PATH $WORKSPACE/opnfv-archive
+find $WORKSPACE/opnfv-archive -type d -iname '.git' -exec rm -rf {} +
+find $WORKSPACE/opnfv-archive -type f -iname '.git*' -exec rm -rf {} +
+
+# Create archive
+echo "Creating archive: opnfv-archive-$DATE.tar.gz"
+echo "--------------------------------------"
+cd $WORKSPACE
+tar -czf "opnfv-archive-$DATE.tar.gz" opnfv-archive && rm -rf opnfv-archive
+echo "Archiving Complete."
+
+echo "Uploading artifacts"
+echo "--------------------------------------"
+
+gsutil cp "$WORKSPACE/opnfv-archive-$DATE.tar.gz" \
+    "gs://opnfv-archive/opnfv-archive-$DATE.tar.gz" 2>&1
+
+rm -f opnfv-archive-$DATE.tar.gz
+
+echo "Finished"
index 717bb3c..ac1ec07 100644 (file)
@@ -4,6 +4,8 @@
 
     jobs:
         - 'prune-docker-images'
+        - 'archive-repositories'
+
 ########################
 # job templates
 ########################
 
     triggers:
         - timed: '@midnight'
+
+- job-template:
+    name: 'archive-repositories'
+
+    disabled: false
+
+    concurrent: true
+
+    parameters:
+        - node:
+            name: SLAVE_NAME
+            description: Where to create the archive
+            default-slaves:
+                - master
+            allowed-multiselect: false
+            ignore-offline-nodes: true
+
+    triggers:
+        - timed: '@monthly'
+
+    builders:
+        - shell:
+            !include-raw-escape: opnfv-repo-archiver.sh
index ccee971..c91ea47 100755 (executable)
@@ -20,7 +20,7 @@ fi
 
 if [[ ${INSTALLER_TYPE} == 'joid' ]]; then
     if [[ "${DEPLOY_SCENARIO:0:2}" == "k8" ]];then
-        rc_file_vol="-v $LAB_CONFIG/admin.conf:/etc/yardstick/admin.conf"
+        rc_file_vol="-v /home/ubuntu/config:/etc/yardstick/admin.conf"
     else
         # If production lab then creds may be retrieved dynamically
         # creds are on the jumphost, always in the same folder
@@ -59,8 +59,14 @@ sudo rm -rf ${dir_result}/*
 map_log_dir="-v ${dir_result}:/tmp/yardstick"
 
 # Run docker
-cmd="sudo docker run ${opts} ${envs} ${rc_file_vol} ${cacert_file_vol} ${map_log_dir} ${sshkey} opnfv/yardstick:${DOCKER_TAG} \
+if [[ ${INSTALLER_TYPE} == "joid" && "${DEPLOY_SCENARIO:0:2}" == "k8" ]];then
+    juju ssh kubernetes-master/0 sudo apt-get install docker.io
+    cmd="juju ssh kubernetes-master/0 sudo docker run ${opts} ${envs} ${rc_file_vol} ${cacert_file_vol} ${map_log_dir} ${sshkey} opnfv/yardstick:${DOCKER_TAG} exec_tests.sh ${YARDSTICK_DB_BACKEND} ${YARDSTICK_SCENARIO_SUITE_NAME}"
+else
+    cmd="sudo docker run ${opts} ${envs} ${rc_file_vol} ${cacert_file_vol} ${map_log_dir} ${sshkey} opnfv/yardstick:${DOCKER_TAG} \
     exec_tests.sh ${YARDSTICK_DB_BACKEND} ${YARDSTICK_SCENARIO_SUITE_NAME}"
+fi
+
 echo "Yardstick: Running docker cmd: ${cmd}"
 ${cmd}
 
index cdfcfaf..7ce36ca 100644 (file)
@@ -63,7 +63,7 @@
         </tbody>
     </table>
 </div>
-
+<br>
 <div ng-show="ctrl.showError" class="alert alert-danger" role="alert">
     <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
     <span class="sr-only">Error:</span>
index 53e8b1e..2012586 100644 (file)
@@ -31,7 +31,6 @@
     function PodsController($scope, $http, $filter, $state, testapiApiUrl,
         raiseAlert) {
         var ctrl = this;
-
         ctrl.url = testapiApiUrl + '/pods';
 
         ctrl.create = create;
          */
         function create() {
             ctrl.showError = false;
-            var pods_url = ctrl.url;
-            var body = {
-                name: ctrl.name,
-                mode: ctrl.mode,
-                role: ctrl.role,
-                details: ctrl.details
-            };
 
-            ctrl.podsRequest =
-                $http.post(pods_url, body).error(function (error) {
-                    ctrl.showError = true;
-                    ctrl.error =
-                        'Error creating the new pod from server: ' +
-                        angular.toJson(error);
-                });
+            if(ctrl.name != ""){
+                var pods_url = ctrl.url;
+                var body = {
+                    name: ctrl.name,
+                    mode: ctrl.mode,
+                    role: ctrl.role,
+                    details: ctrl.details
+                };
+                ctrl.podsRequest =
+                    $http.post(pods_url, body).error(function (error) {
+                        ctrl.showError = true;
+                        ctrl.error =
+                            'Error creating the new pod from server: ' +
+                            angular.toJson(error);
+                    });
+            }
+            else{
+                ctrl.showError = true;
+                        ctrl.error = 'Name is missing.'
+            }
         }
 
         /**