Merge "yardstick: updated yardstick jobs for armband to use labels"
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>
Tue, 6 Sep 2016 10:56:39 +0000 (10:56 +0000)
committerGerrit Code Review <gerrit@172.30.200.206>
Tue, 6 Sep 2016 10:56:39 +0000 (10:56 +0000)
jjb/armband/armband-ci-jobs.yml
jjb/armband/armband-deploy.sh
jjb/opnfv/slave-params.yml
prototypes/bifrost/scripts/test-bifrost-deployment.sh
utils/push-test-logs.sh
utils/test/scripts/backup-db.sh
utils/test/scripts/mongo_to_elasticsearch.py

index 9493cd8..bffa91d 100644 (file)
     triggers:
         - timed: '0 3 * * 5'
 #----------------------------------------------------------------------
-# Enea Armband CI Baremetal Triggers running against brahmaputra branch
+# Enea Armband CI Baremetal Triggers running against colorado branch
 #----------------------------------------------------------------------
 - trigger:
     name: 'armband-fuel-os-odl_l2-nofeature-ha-baremetal-colorado-trigger'
     triggers:
         - timed: ''
 #--------------------------------------------------------------------
-# Enea Armband CI Virtual Triggers running against brahmaputra branch
+# Enea Armband CI Virtual Triggers running against colorado branch
 #--------------------------------------------------------------------
 - trigger:
     name: 'armband-fuel-os-odl_l2-nofeature-ha-virtual-colorado-trigger'
     triggers:
         - timed: ''
 #---------------------------------------------------------------
-# Enea Armband POD 2 Triggers running against brahmaputra branch
+# Enea Armband POD 2 Triggers running against colorado branch
 #---------------------------------------------------------------
 - trigger:
     name: 'armband-fuel-os-odl_l2-nofeature-ha-arm-pod2-colorado-trigger'
index 901f845..fb4c1ea 100755 (executable)
@@ -50,6 +50,13 @@ if [[ $LAB_CONFIG_URL =~ ^(git|ssh):// ]]; then
     echo "cloning $LAB_CONFIG_URL"
     git clone --quiet --branch ${GIT_BRANCH##origin/} $LAB_CONFIG_URL lab-config
     LAB_CONFIG_URL=file://${WORKSPACE}/lab-config
+
+    # Source local_env if present, which contains POD-specific config
+    local_env="${WORKSPACE}/lab-config/labs/$LAB_NAME/$POD_NAME/fuel/config/local_env"
+    if [ -e $local_env ]; then
+        echo "-- Sourcing local environment file"
+        source $local_env
+    fi
 fi
 
 # releng wants us to use nothing else but opnfv.iso for now. We comply.
index 608ce43..0c8435d 100644 (file)
             name: GIT_BASE
             default: https://gerrit.opnfv.org/gerrit/$PROJECT
             description: 'Git URL to use on this Jenkins Slave'
+        - string:
+            name: LAB_CONFIG_URL
+            default: ssh://git@git.enea.com/pharos/lab-config
+            description: 'Base URI to the configuration directory'
 - parameter:
     name: 'joid-baremetal-defaults'
     parameters:
             name: GIT_BASE
             default: https://gerrit.opnfv.org/gerrit/$PROJECT
             description: 'Git URL to use on this Jenkins Slave'
+        - string:
+            name: LAB_CONFIG_URL
+            default: ssh://git@git.enea.com/pharos/lab-config
+            description: 'Base URI to the configuration directory'
 - parameter:
     name: 'joid-virtual-defaults'
     parameters:
             name: GIT_BASE
             default: https://gerrit.opnfv.org/gerrit/$PROJECT
             description: 'Git URL to use on this Jenkins Slave'
-        - string:
-            name: DEFAULT_BRIDGE
-            default: 'admin6_br0,public6_br0'
-            desciption: 'The bridge to use for Fuel PXE booting. It can be a comma sparated list of bridges, in which case the first is the PXE boot bridge, and all subsequent interfaces that will be added to the VM. If left empty, most deploy scripts will default to pxebr.'
-        - string:
-            name: DEPLOY_TIMEOUT
-            default: '360'
-            description: 'Deployment timeout in minutes'
         - string:
             name: LAB_CONFIG_URL
             default: ssh://git@git.enea.com/pharos/lab-config
             name: GIT_BASE
             default: https://gerrit.opnfv.org/gerrit/$PROJECT
             description: 'Git URL to use on this Jenkins Slave'
-        - string:
-            name: DEFAULT_BRIDGE
-            default: 'admin_br0,public_br0'
-            desciption: 'The bridge to use for Fuel PXE booting. It can be a comma sparated list of bridges, in which case the first is the PXE boot bridge, and all subsequent interfaces that will be added to the VM. If left empty, most deploy scripts will default to pxebr.'
-        - string:
-            name: DEPLOY_TIMEOUT
-            default: '360'
-            description: 'Deployment timeout in minutes'
         - string:
             name: LAB_CONFIG_URL
             default: ssh://git@git.enea.com/pharos/lab-config
index 66affe9..d796f35 100755 (executable)
@@ -71,17 +71,17 @@ set -x -o nounset
 cd $BIFROST_HOME/playbooks
 
 # Syntax check of dynamic inventory test path
-${ANSIBLE} -vvvv \
-       -i inventory/localhost \
-       test-bifrost-create-vm.yaml \
-       --syntax-check \
-       --list-tasks
-${ANSIBLE} -vvvv \
-       -i inventory/localhost \
-       ${TEST_PLAYBOOK} \
-       --syntax-check \
-       --list-tasks \
-       -e testing_user=${TESTING_USER}
+for task in syntax-check list-tasks; do
+    ${ANSIBLE} -vvvv \
+           -i inventory/localhost \
+           test-bifrost-create-vm.yaml \
+           --${task}
+    ${ANSIBLE} -vvvv \
+           -i inventory/localhost \
+           ${TEST_PLAYBOOK} \
+           --${task} \
+           -e testing_user=${TESTING_USER}
+done
 
 # Create the test VMS
 ${ANSIBLE} -vvvv \
index 24b3281..0fa882b 100644 (file)
@@ -54,8 +54,14 @@ if [ -d "$dir_result" ]; then
             if [ $? != 0 ]; then
                 echo "Not possible to push results to artifact: gsutil not installed.";
             else
-                echo "copy result files to artifact $project_artifact"
-                gsutil -m cp -r "$dir_result" gs://artifacts.opnfv.org/"$project_artifact"/ >/dev/null 2>&1
+                echo "Uploading logs to artifact $project_artifact"
+                gsutil -m cp -r "$dir_result"/* gs://artifacts.opnfv.org/"$project_artifact"/ >/dev/null 2>&1
+                echo "Logs can be found in http://artifacts.opnfv.org/logs_${project}_${testbed}.html"
+                cd $dir_result
+                files=($(find . -name \* -print|sed 's/^\.//'|sed '/^\s*$/d'))
+                for f in ${files[@]}; do
+                    echo "http://artifacts.opnfv.org/${project_artifact}${f}"
+                done
             fi
         fi
     else
index aa36aa3..35c3fbe 100644 (file)
@@ -18,16 +18,16 @@ echo "Create Directory for backup"
 mkdir -p $TARGET_DIR
 
 echo "Export results"
-mongoexport -db test_results_collection -c test_results --out $TARGET_DIR/results.json
+mongoexport --db test_results_collection -c results --out $TARGET_DIR/backup-results.json
 echo "Export test cases"
-mongoexport --db test_results_collection -c test_cases --out $TARGET_DIR/backup-cases.json
+mongoexport --db test_results_collection -c testcases --out $TARGET_DIR/backup-cases.json
 echo "Export projects"
-mongoexport --db test_results_collection -c test_projects --out $TARGET_DIR/backup-projects.json
+mongoexport --db test_results_collection -c projects --out $TARGET_DIR/backup-projects.json
 echo "Export pods"
-mongoexport --db test_results_collection -c pod --out $TARGET_DIR/backup-pod.json
+mongoexport --db test_results_collection -c pods --out $TARGET_DIR/backup-pod.json
 
 echo "Create tar.gz"
-tar -cvzf $TEST_RESULT_DB_BACKUP $TARGET_DIR
+#tar -cvzf $TEST_RESULT_DB_BACKUP $TARGET_DIR
 
 echo "Delete temp directory"
-rm -Rf $TARGET_DIR
+#rm -Rf $TARGET_DIR
index 2ffbc17..ded58ef 100644 (file)
@@ -1,13 +1,16 @@
 #! /usr/bin/env python
-import logging
-import argparse
-import shared_utils
+import datetime
 import json
-import urlparse
-import uuid
+import logging
 import os
 import subprocess
-import datetime
+import traceback
+import urlparse
+import uuid
+
+import argparse
+
+import shared_utils
 
 logger = logging.getLogger('mongo_to_elasticsearch')
 logger.setLevel(logging.DEBUG)
@@ -370,18 +373,21 @@ def modify_mongo_entry(testcase):
         project = testcase['project_name']
         case_name = testcase['case_name']
         logger.info("Processing mongo test case '{}'".format(case_name))
-        if project == 'functest':
-            if case_name == 'rally_sanity':
-                return modify_functest_rally(testcase)
-            elif case_name.lower() == 'odl':
-                return modify_functest_odl(testcase)
-            elif case_name.lower() == 'onos':
-                return modify_functest_onos(testcase)
-            elif case_name.lower() == 'vims':
-                return modify_functest_vims(testcase)
-            elif case_name == 'tempest_smoke_serial':
-                return modify_functest_tempest(testcase)
-        return modify_default_entry(testcase)
+        try:
+            if project == 'functest':
+                if case_name == 'rally_sanity':
+                    return modify_functest_rally(testcase)
+                elif case_name.lower() == 'odl':
+                    return modify_functest_odl(testcase)
+                elif case_name.lower() == 'onos':
+                    return modify_functest_onos(testcase)
+                elif case_name.lower() == 'vims':
+                    return modify_functest_vims(testcase)
+                elif case_name == 'tempest_smoke_serial':
+                    return modify_functest_tempest(testcase)
+            return modify_default_entry(testcase)
+        except Exception:
+            logger.error("Fail in modify testcase[%s]\nerror message: %s" % (testcase, traceback.format_exc()))
     else:
         return False