Merge "reslove issue about can not trigger verify jobs"
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>
Thu, 20 Oct 2016 14:57:35 +0000 (14:57 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Thu, 20 Oct 2016 14:57:35 +0000 (14:57 +0000)
111 files changed:
jjb/armband/armband-ci-jobs.yml
jjb/functest/functest-ci-jobs.yml
jjb/infra/bifrost-verify-jobs.yml
jjb/opnfv/slave-params.yml
jjb/vswitchperf/vswitchperf.yml
jjb/yardstick/yardstick-ci-jobs.yml
prototypes/puppet-infracloud/modules/opnfv/manifests/server.pp
utils/test/dashboard/README.rst [moved from utils/test/result_collection_api/update/templates/__init__.py with 100% similarity]
utils/test/dashboard/dashboard/conf/config.py
utils/test/dashboard/dashboard/conf/testcases.py
utils/test/dashboard/dashboard/elastic2kibana/dashboard_assembler.py
utils/test/dashboard/dashboard/elastic2kibana/main.py
utils/test/dashboard/dashboard/elastic2kibana/utility.py
utils/test/dashboard/dashboard/elastic2kibana/visualization_assembler.py
utils/test/dashboard/dashboard/elastic2kibana_main.py [deleted file]
utils/test/dashboard/dashboard/functest/format.py [moved from utils/test/dashboard/dashboard/mongo2elastic/format.py with 94% similarity]
utils/test/dashboard/dashboard/mongo2elastic/main.py
utils/test/dashboard/dashboard/mongo2elastic_main.py [deleted file]
utils/test/dashboard/dashboard/qtip/format.py [new file with mode: 0644]
utils/test/dashboard/etc/config.ini
utils/test/dashboard/install.sh [new file with mode: 0755]
utils/test/dashboard/setup.cfg [new file with mode: 0644]
utils/test/dashboard/setup.py [new file with mode: 0644]
utils/test/reporting/functest/reporting-status.py
utils/test/reporting/functest/reportingUtils.py
utils/test/testapi/3rd_party/static/.gitignore [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/.gitignore with 100% similarity]
utils/test/testapi/3rd_party/static/css/highlight.default.css [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/css/highlight.default.css with 100% similarity]
utils/test/testapi/3rd_party/static/css/hightlight.default.css [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/css/hightlight.default.css with 100% similarity]
utils/test/testapi/3rd_party/static/css/screen.css [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/css/screen.css with 100% similarity]
utils/test/testapi/3rd_party/static/endpoint.html [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/endpoint.html with 100% similarity]
utils/test/testapi/3rd_party/static/images/explorer_icons.png [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/explorer_icons.png with 100% similarity]
utils/test/testapi/3rd_party/static/images/logo_small.png [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/logo_small.png with 100% similarity]
utils/test/testapi/3rd_party/static/images/pet_store_api.png [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/pet_store_api.png with 100% similarity]
utils/test/testapi/3rd_party/static/images/throbber.gif [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/throbber.gif with 100% similarity]
utils/test/testapi/3rd_party/static/images/wordnik_api.png [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/images/wordnik_api.png with 100% similarity]
utils/test/testapi/3rd_party/static/index.html [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/index.html with 100% similarity]
utils/test/testapi/3rd_party/static/lib/backbone-min.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/backbone-min.js with 100% similarity]
utils/test/testapi/3rd_party/static/lib/handlebars-1.0.0.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/handlebars-1.0.0.js with 100% similarity]
utils/test/testapi/3rd_party/static/lib/highlight.7.3.pack.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/highlight.7.3.pack.js with 100% similarity]
utils/test/testapi/3rd_party/static/lib/jquery-1.8.0.min.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/jquery-1.8.0.min.js with 100% similarity]
utils/test/testapi/3rd_party/static/lib/jquery.ba-bbq.min.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/jquery.ba-bbq.min.js with 100% similarity]
utils/test/testapi/3rd_party/static/lib/jquery.slideto.min.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/jquery.slideto.min.js with 100% similarity]
utils/test/testapi/3rd_party/static/lib/jquery.wiggle.min.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/jquery.wiggle.min.js with 100% similarity]
utils/test/testapi/3rd_party/static/lib/shred.bundle.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/shred.bundle.js with 100% similarity]
utils/test/testapi/3rd_party/static/lib/shred/content.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/shred/content.js with 100% similarity]
utils/test/testapi/3rd_party/static/lib/swagger-oauth.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/swagger-oauth.js with 100% similarity]
utils/test/testapi/3rd_party/static/lib/swagger.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/swagger.js with 100% similarity]
utils/test/testapi/3rd_party/static/lib/underscore-min.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/lib/underscore-min.js with 100% similarity]
utils/test/testapi/3rd_party/static/o2c.html [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/o2c.html with 100% similarity]
utils/test/testapi/3rd_party/static/swagger-ui.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/swagger-ui.js with 100% similarity]
utils/test/testapi/3rd_party/static/swagger-ui.min.js [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/static/swagger-ui.min.js with 100% similarity]
utils/test/testapi/README.rst [moved from utils/test/result_collection_api/README.rst with 97% similarity]
utils/test/testapi/docker/Dockerfile [moved from utils/test/result_collection_api/docker/Dockerfile with 96% similarity]
utils/test/testapi/docker/prepare-env.sh [moved from utils/test/result_collection_api/docker/prepare-env.sh with 100% similarity]
utils/test/testapi/docker/start-server.sh [moved from utils/test/result_collection_api/docker/start-server.sh with 100% similarity]
utils/test/testapi/etc/config.ini [moved from utils/test/result_collection_api/etc/config.ini with 100% similarity]
utils/test/testapi/install.sh [new file with mode: 0755]
utils/test/testapi/opnfv_testapi/__init__.py [moved from utils/test/result_collection_api/opnfv_testapi/__init__.py with 100% similarity]
utils/test/testapi/opnfv_testapi/cmd/__init__.py [moved from utils/test/result_collection_api/opnfv_testapi/cmd/__init__.py with 100% similarity]
utils/test/testapi/opnfv_testapi/cmd/server.py [moved from utils/test/result_collection_api/opnfv_testapi/cmd/server.py with 100% similarity]
utils/test/testapi/opnfv_testapi/common/__init__.py [moved from utils/test/result_collection_api/opnfv_testapi/common/__init__.py with 100% similarity]
utils/test/testapi/opnfv_testapi/common/config.py [moved from utils/test/result_collection_api/opnfv_testapi/common/config.py with 100% similarity]
utils/test/testapi/opnfv_testapi/common/constants.py [moved from utils/test/result_collection_api/opnfv_testapi/common/constants.py with 100% similarity]
utils/test/testapi/opnfv_testapi/resources/__init__.py [moved from utils/test/result_collection_api/opnfv_testapi/resources/__init__.py with 100% similarity]
utils/test/testapi/opnfv_testapi/resources/handlers.py [moved from utils/test/result_collection_api/opnfv_testapi/resources/handlers.py with 100% similarity]
utils/test/testapi/opnfv_testapi/resources/models.py [moved from utils/test/result_collection_api/opnfv_testapi/resources/models.py with 100% similarity]
utils/test/testapi/opnfv_testapi/resources/pod_handlers.py [moved from utils/test/result_collection_api/opnfv_testapi/resources/pod_handlers.py with 100% similarity]
utils/test/testapi/opnfv_testapi/resources/pod_models.py [moved from utils/test/result_collection_api/opnfv_testapi/resources/pod_models.py with 100% similarity]
utils/test/testapi/opnfv_testapi/resources/project_handlers.py [moved from utils/test/result_collection_api/opnfv_testapi/resources/project_handlers.py with 100% similarity]
utils/test/testapi/opnfv_testapi/resources/project_models.py [moved from utils/test/result_collection_api/opnfv_testapi/resources/project_models.py with 100% similarity]
utils/test/testapi/opnfv_testapi/resources/result_handlers.py [moved from utils/test/result_collection_api/opnfv_testapi/resources/result_handlers.py with 100% similarity]
utils/test/testapi/opnfv_testapi/resources/result_models.py [moved from utils/test/result_collection_api/opnfv_testapi/resources/result_models.py with 100% similarity]
utils/test/testapi/opnfv_testapi/resources/testcase_handlers.py [moved from utils/test/result_collection_api/opnfv_testapi/resources/testcase_handlers.py with 100% similarity]
utils/test/testapi/opnfv_testapi/resources/testcase_models.py [moved from utils/test/result_collection_api/opnfv_testapi/resources/testcase_models.py with 100% similarity]
utils/test/testapi/opnfv_testapi/router/__init__.py [moved from utils/test/result_collection_api/opnfv_testapi/router/__init__.py with 100% similarity]
utils/test/testapi/opnfv_testapi/router/url_mappings.py [moved from utils/test/result_collection_api/opnfv_testapi/router/url_mappings.py with 100% similarity]
utils/test/testapi/opnfv_testapi/tests/__init__.py [moved from utils/test/result_collection_api/opnfv_testapi/tests/__init__.py with 100% similarity]
utils/test/testapi/opnfv_testapi/tests/unit/__init__.py [moved from utils/test/result_collection_api/opnfv_testapi/tests/unit/__init__.py with 100% similarity]
utils/test/testapi/opnfv_testapi/tests/unit/fake_pymongo.py [moved from utils/test/result_collection_api/opnfv_testapi/tests/unit/fake_pymongo.py with 100% similarity]
utils/test/testapi/opnfv_testapi/tests/unit/test_base.py [moved from utils/test/result_collection_api/opnfv_testapi/tests/unit/test_base.py with 100% similarity]
utils/test/testapi/opnfv_testapi/tests/unit/test_fake_pymongo.py [moved from utils/test/result_collection_api/opnfv_testapi/tests/unit/test_fake_pymongo.py with 100% similarity]
utils/test/testapi/opnfv_testapi/tests/unit/test_pod.py [moved from utils/test/result_collection_api/opnfv_testapi/tests/unit/test_pod.py with 100% similarity]
utils/test/testapi/opnfv_testapi/tests/unit/test_project.py [moved from utils/test/result_collection_api/opnfv_testapi/tests/unit/test_project.py with 100% similarity]
utils/test/testapi/opnfv_testapi/tests/unit/test_result.py [moved from utils/test/result_collection_api/opnfv_testapi/tests/unit/test_result.py with 100% similarity]
utils/test/testapi/opnfv_testapi/tests/unit/test_testcase.py [moved from utils/test/result_collection_api/opnfv_testapi/tests/unit/test_testcase.py with 100% similarity]
utils/test/testapi/opnfv_testapi/tests/unit/test_version.py [moved from utils/test/result_collection_api/opnfv_testapi/tests/unit/test_version.py with 100% similarity]
utils/test/testapi/opnfv_testapi/tornado_swagger/README.md [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/README.md with 100% similarity]
utils/test/testapi/opnfv_testapi/tornado_swagger/__init__.py [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/__init__.py with 100% similarity]
utils/test/testapi/opnfv_testapi/tornado_swagger/handlers.py [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/handlers.py with 100% similarity]
utils/test/testapi/opnfv_testapi/tornado_swagger/settings.py [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/settings.py with 100% similarity]
utils/test/testapi/opnfv_testapi/tornado_swagger/swagger.py [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/swagger.py with 100% similarity]
utils/test/testapi/opnfv_testapi/tornado_swagger/views.py [moved from utils/test/result_collection_api/opnfv_testapi/tornado_swagger/views.py with 100% similarity]
utils/test/testapi/requirements.txt [moved from utils/test/result_collection_api/requirements.txt with 100% similarity]
utils/test/testapi/run_test.sh [moved from utils/test/result_collection_api/run_test.sh with 100% similarity]
utils/test/testapi/setup.cfg [moved from utils/test/result_collection_api/setup.cfg with 100% similarity]
utils/test/testapi/setup.py [moved from utils/test/result_collection_api/setup.py with 100% similarity]
utils/test/testapi/test-requirements.txt [moved from utils/test/result_collection_api/test-requirements.txt with 100% similarity]
utils/test/testapi/update/README.md [moved from utils/test/result_collection_api/update/README.md with 100% similarity]
utils/test/testapi/update/__init__.py [moved from utils/test/result_collection_api/update/__init__.py with 100% similarity]
utils/test/testapi/update/playbook-update.sh [moved from utils/test/result_collection_api/update/playbook-update.sh with 100% similarity]
utils/test/testapi/update/templates/__init__.py [new file with mode: 0644]
utils/test/testapi/update/templates/backup_mongodb.py [moved from utils/test/result_collection_api/update/templates/backup_mongodb.py with 100% similarity]
utils/test/testapi/update/templates/changes_in_mongodb.py [moved from utils/test/result_collection_api/update/templates/changes_in_mongodb.py with 100% similarity]
utils/test/testapi/update/templates/restore_mongodb.py [moved from utils/test/result_collection_api/update/templates/restore_mongodb.py with 100% similarity]
utils/test/testapi/update/templates/rm_images.sh [moved from utils/test/result_collection_api/update/templates/rm_images.sh with 100% similarity]
utils/test/testapi/update/templates/rm_olds.sh [moved from utils/test/result_collection_api/update/templates/rm_olds.sh with 100% similarity]
utils/test/testapi/update/templates/update_mongodb.py [moved from utils/test/result_collection_api/update/templates/update_mongodb.py with 100% similarity]
utils/test/testapi/update/templates/utils.py [moved from utils/test/result_collection_api/update/templates/utils.py with 100% similarity]
utils/test/testapi/update/test.yml [moved from utils/test/result_collection_api/update/test.yml with 100% similarity]
utils/test/testapi/update/update.yml [moved from utils/test/result_collection_api/update/update.yml with 100% similarity]
utils/test/testapi/update/update_api.py [moved from utils/test/result_collection_api/update/update_api.py with 100% similarity]

index d4fa5da..2122959 100644 (file)
             slave-label: arm-pod2
             installer: fuel
             <<: *colorado
+        - arm-pod3:
+            slave-label: arm-pod3
+            installer: fuel
+            <<: *colorado
 #--------------------------------
 #        master
 #--------------------------------
             slave-label: arm-pod2
             installer: fuel
             <<: *master
+        - arm-pod3:
+            slave-label: arm-pod3
+            installer: fuel
+            <<: *master
 #--------------------------------
 #       scenarios
 #--------------------------------
     name: 'fuel-os-odl_l2-sfc-noha-arm-pod2-colorado-trigger'
     triggers:
         - timed: ''
+#----------------------------------------------------------
+# Enea Armband POD 3 Triggers running against master branch
+#----------------------------------------------------------
+- trigger:
+    name: 'fuel-os-odl_l2-nofeature-ha-arm-pod3-master-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-nosdn-nofeature-ha-arm-pod3-master-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-odl_l3-nofeature-ha-arm-pod3-master-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-odl_l2-bgpvpn-ha-arm-pod3-master-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-odl_l2-nofeature-noha-arm-pod3-master-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-odl_l2-sfc-ha-arm-pod3-master-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-odl_l2-sfc-noha-arm-pod3-master-trigger'
+    triggers:
+        - timed: ''
+#---------------------------------------------------------------
+# Enea Armband POD 3 Triggers running against colorado branch
+#---------------------------------------------------------------
+- trigger:
+    name: 'fuel-os-odl_l2-nofeature-ha-arm-pod3-colorado-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-nosdn-nofeature-ha-arm-pod3-colorado-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-odl_l3-nofeature-ha-arm-pod3-colorado-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-odl_l2-bgpvpn-ha-arm-pod3-colorado-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-odl_l2-nofeature-noha-arm-pod3-colorado-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-odl_l2-sfc-ha-arm-pod3-colorado-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'fuel-os-odl_l2-sfc-noha-arm-pod3-colorado-trigger'
+    triggers:
+        - timed: ''
index 3487793..afeb1f9 100644 (file)
             slave-label: '{pod}'
             installer: fuel
             <<: *master
+        - arm-pod3:
+            slave-label: '{pod}'
+            installer: fuel
+            <<: *master
         - zte-pod1:
             slave-label: '{pod}'
             installer: fuel
             slave-label: '{pod}'
             installer: fuel
             <<: *colorado
+        - arm-pod3:
+            slave-label: '{pod}'
+            installer: fuel
+            <<: *colorado
 # PODs for verify jobs triggered by each patch upload
         - ool-virtual1:
             slave-label: '{pod}'
index a2a57d4..d15bf74 100644 (file)
                     exclude-no-code-change: 'false'
                 - comment-added-contains-event:
                     comment-contains-value: 'recheck'
+            custom-url: '* $JOB_NAME $BUILD_URL'
+            silent-start: true
             projects:
               - project-compare-type: 'PLAIN'
                 project-pattern: 'openstack/bifrost'
index 7eca41a..b46960f 100644 (file)
             name: LAB_CONFIG_URL
             default: ssh://jenkins-enea@gerrit.opnfv.org:29418/securedlab
             description: 'Base URI to the configuration directory'
+- parameter:
+    name: 'arm-pod3-defaults'
+    parameters:
+        - node:
+            name: SLAVE_NAME
+            description: 'Slave name on Jenkins'
+            allowed-slaves:
+                - arm-pod3
+            default-slaves:
+                - arm-pod3
+        - string:
+            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://jenkins-enea@gerrit.opnfv.org:29418/securedlab
+            description: 'Base URI to the configuration directory'
 - parameter:
     name: 'intel-virtual6-defaults'
     parameters:
index 363423d..233cf08 100644 (file)
             make
             # run basic sanity test
             make sanity
+            cd ../ci
+            ./build-vsperf.sh verify
 
 - job-template:
     name: 'vswitchperf-merge-{stream}'
             cd src
             make clobber
             make
+            cd ../ci
+            ./build-vsperf.sh merge
index 962ea47..c10daab 100644 (file)
             installer: fuel
             auto-trigger-name: 'daily-trigger-disabled'
             <<: *colorado
+        - arm-pod3:
+            slave-label: '{pod}'
+            installer: fuel
+            auto-trigger-name: 'daily-trigger-disabled'
+            <<: *master
+        - arm-pod3:
+            slave-label: '{pod}'
+            installer: fuel
+            auto-trigger-name: 'daily-trigger-disabled'
+            <<: *colorado
         - orange-pod2:
             slave-label: '{pod}'
             installer: joid
             default: '-i 104.197.68.199:8086'
             description: 'Arguments to use in order to choose the backend DB'
 
+- parameter:
+    name: 'yardstick-params-arm-pod3'
+    parameters:
+        - string:
+            name: YARDSTICK_DB_BACKEND
+            default: '-i 104.197.68.199:8086'
+            description: 'Arguments to use in order to choose the backend DB'
+
 - parameter:
     name: 'yardstick-params-virtual'
     parameters:
index a1e7d5d..6b608a7 100644 (file)
@@ -239,5 +239,13 @@ class opnfv::server (
     multiple => true,
   }
 
+  # disable selinux in case of RHEL
+  if ($::osfamily == 'RedHat') {
+    class { 'selinux':
+      mode => 'disabled',
+    }
+  }
+
+  # update hosts
   create_resources('host', hiera_hash('hosts'))
 }
index 48fed88..6114e90 100644 (file)
@@ -1,5 +1,6 @@
 #! /usr/bin/env python
 
+import urlparse
 from ConfigParser import SafeConfigParser, NoOptionError
 
 
@@ -22,11 +23,12 @@ class APIConfig:
     """
 
     def __init__(self):
-        self._default_config_location = "../etc/config.ini"
+        self._default_config_location = "/etc/dashboard/config.ini"
         self.es_url = 'http://localhost:9200'
         self.es_creds = None
         self.kibana_url = None
         self.js_path = None
+        self.index_url = None
 
     def _get_str_parameter(self, section, param):
         try:
@@ -67,6 +69,8 @@ class APIConfig:
         obj.es_creds = obj._get_str_parameter("elastic", "creds")
         obj.kibana_url = obj._get_str_parameter("kibana", "url")
         obj.js_path = obj._get_str_parameter("kibana", "js_path")
+        index = obj._get_str_parameter("elastic", "index")
+        obj.index_url = urlparse.urljoin(obj.es_url, index)
 
         return obj
 
@@ -74,7 +78,9 @@ class APIConfig:
         return "elastic_url = %s \n" \
                "elastic_creds = %s \n" \
                "kibana_url = %s \n" \
+               "index_url = %s \n" \
                "js_path = %s \n" % (self.es_url,
                                     self.es_creds,
                                     self.kibana_url,
+                                    self.index_url,
                                     self.js_path)
index e120987..ff801b4 100644 (file)
@@ -1,7 +1,7 @@
 import yaml
 
 
-with open('./functest/testcases.yaml') as f:
+with open('/etc/dashboard/testcases.yaml') as f:
     testcases_yaml = yaml.safe_load(f)
 f.close()
 
index da7ccfc..651168b 100644 (file)
@@ -1,7 +1,7 @@
 import json
 
 import utility
-from common import elastic_access
+from dashboard.common import elastic_access
 
 
 class DashboardAssembler(object):
index 4542c31..112d222 100644 (file)
@@ -1,13 +1,12 @@
 #! /usr/bin/env python
 import json
-import urlparse
 
 import argparse
 
-from common import elastic_access
-from common import logger_utils
-from conf import config
-from conf import testcases
+from dashboard.common import elastic_access
+from dashboard.common import logger_utils
+from dashboard.conf import config
+from dashboard.conf import testcases
 from dashboard_assembler import DashboardAssembler
 from visualization_assembler import VisualizationAssembler
 
@@ -131,10 +130,9 @@ class KibanaConstructor(object):
             }
         })
 
-        elastic_data = elastic_access.get_docs(
-            urlparse.urljoin(CONF.es_url, '/testapi/results'),
-            CONF.es_creds,
-            query)
+        elastic_data = elastic_access.get_docs(CONF.index_url,
+                                               CONF.es_creds,
+                                               query)
 
         pods_and_scenarios = {}
 
index dccd28a..55578bd 100644 (file)
@@ -2,7 +2,7 @@ import json
 
 from jinja2 import Environment, PackageLoader
 
-env = Environment(loader=PackageLoader('elastic2kibana', 'templates'))
+env = Environment(loader=PackageLoader('dashboard', 'elastic2kibana/templates'))
 env.filters['jsonify'] = json.dumps
 
 
index 1cb0ba8..d7e6e54 100644 (file)
@@ -1,7 +1,7 @@
 import json
 
 import utility
-from common import elastic_access
+from dashboard.common import elastic_access
 
 
 class VisStateBuilder(object):
diff --git a/utils/test/dashboard/dashboard/elastic2kibana_main.py b/utils/test/dashboard/dashboard/elastic2kibana_main.py
deleted file mode 100644 (file)
index 3ec27cb..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-from elastic2kibana.main import main
-
-if __name__ == '__main__':
-    main()
@@ -184,21 +184,3 @@ def format_vims(testcase):
         }
     }
     return True
-
-
-def format_qpi(testcase):
-    """
-    Look for these and leave any of those:
-        details.index
-
-    If none are present, then return False
-    """
-    details = testcase['details']
-    if 'index' not in details:
-        return False
-
-    for key, value in details.items():
-        if key != 'index':
-            del details[key]
-
-    return True
index 8c7300b..688f55f 100644 (file)
@@ -5,15 +5,15 @@ import json
 import os
 import subprocess
 import traceback
-import urlparse
 import uuid
 
 import argparse
 
-from common import logger_utils, elastic_access
-from conf import testcases
-from conf.config import APIConfig
-from mongo2elastic import format
+from dashboard.common import elastic_access
+from dashboard.common import logger_utils
+from dashboard.conf import testcases
+from dashboard.conf.config import APIConfig
+from dashboard.mongo2elastic import format
 
 logger = logger_utils.DashboardLogger('mongo2elastic').get
 
@@ -187,7 +187,7 @@ class DocumentsPublisher(object):
             self._remove()
             exit(-1)
 
-    def get_existed_docs(self):
+    def get_exists(self):
         if self.days == 0:
             body = '''{{
                         "query": {{
@@ -241,10 +241,6 @@ class DocumentsPublisher(object):
 
 
 def main():
-    base_elastic_url = urlparse.urljoin(CONF.es_url, '/testapi/results')
-    days = args.latest_days
-    es_creds = CONF.es_creds
-
     for project, case_dicts in testcases.testcases_yaml.items():
         for case_dict in case_dicts:
             case = case_dict.get('name')
@@ -252,6 +248,6 @@ def main():
             DocumentsPublisher(project,
                                case,
                                fmt,
-                               days,
-                               base_elastic_url,
-                               es_creds).export().get_existed_docs().publish()
+                               args.latest_days,
+                               CONF.index_url,
+                               CONF.es_creds).export().get_exists().publish()
diff --git a/utils/test/dashboard/dashboard/mongo2elastic_main.py b/utils/test/dashboard/dashboard/mongo2elastic_main.py
deleted file mode 100644 (file)
index 141d8f3..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-from mongo2elastic.main import main
-
-if __name__ == '__main__':
-    main()
diff --git a/utils/test/dashboard/dashboard/qtip/format.py b/utils/test/dashboard/dashboard/qtip/format.py
new file mode 100644 (file)
index 0000000..b78fa5b
--- /dev/null
@@ -0,0 +1,19 @@
+#! /usr/bin/env python
+
+
+def format_qpi(testcase):
+    """
+    Look for these and leave any of those:
+        details.index
+
+    If none are present, then return False
+    """
+    details = testcase['details']
+    if 'index' not in details:
+        return False
+
+    for key, value in details.items():
+        if key != 'index':
+            del details[key]
+
+    return True
index d932798..77adc16 100644 (file)
@@ -2,6 +2,7 @@
 # the CONF object in config.ini must be updated
 [elastic]
 url = http://localhost:9200
+index = testapi/results
 creds =
 
 [kibana]
diff --git a/utils/test/dashboard/install.sh b/utils/test/dashboard/install.sh
new file mode 100755 (executable)
index 0000000..9fd60d9
--- /dev/null
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+usage="
+Script to install dashboard automatically.
+This script should be run under root.
+
+usage:
+    bash $(basename "$0") [-h|--help] [-t <test_name>]
+
+where:
+    -h|--help         show this help text
+    -p|--project      project dashboard
+      <project_name>"
+
+# Parse parameters
+while [[ $# > 0 ]]
+    do
+    key="$1"
+    case $key in
+        -h|--help)
+            echo "$usage"
+            exit 0
+            shift
+        ;;
+        -p|--project)
+            PROJECT="$2"
+            shift
+        ;;
+        *)
+            echo "unknown option $1 $2"
+            exit 1
+        ;;
+    esac
+    shift # past argument or value
+done
+
+if [[ $(whoami) != "root" ]]; then
+    echo "Error: This script must be run as root!"
+    exit 1
+fi
+
+if [ -z ${PROJECT+x} ]; then
+    echo "project must be specified"
+    exit 1
+fi
+
+if [ $PROJECT != "functest" ] && [ $PROJECT != "qtip" ];then
+    echo "unsupported project $PROJECT"
+    exit 1
+fi
+
+cp -f dashboard/$PROJECT/format.py dashboard/mongo2elastic
+cp -f dashboard/$PROJECT/testcases.yaml etc/
+python setup.py install
diff --git a/utils/test/dashboard/setup.cfg b/utils/test/dashboard/setup.cfg
new file mode 100644 (file)
index 0000000..dd01358
--- /dev/null
@@ -0,0 +1,43 @@
+[metadata]
+name = dashboard
+summary = Test Result Collector
+description-file =
+    README.rst
+author = SerenaFeng
+author-email = feng.xiaowei@zte.com.cn
+#home-page = http://www.opnfv.org/
+classifier =
+    Environment :: opnfv
+    Intended Audience :: Information Technology
+    Intended Audience :: System Administrators
+    License :: OSI Approved :: Apache Software License
+    Operating System :: POSIX :: Linux
+    Programming Language :: Python
+    Programming Language :: Python :: 2
+    Programming Language :: Python :: 2.7
+
+[global]
+setup-hooks =
+    pbr.hooks.setup_hook
+
+[files]
+packages =
+    dashboard
+package_data =
+    dashboard =
+        elastic2kibana/templates/*.*
+data_files =
+    /etc/dashboard =
+        etc/config.ini
+        etc/testcases.yaml
+
+[entry_points]
+console_scripts =
+    dashboard_mongo2elastic = dashboard.mongo2elastic.main:main
+    dashboard_elastic2kibana = dashboard.elastic2kibana.main:main
+
+[egg_info]
+tag_build =
+tag_date = 0
+tag_svn_revision = 0
+
diff --git a/utils/test/dashboard/setup.py b/utils/test/dashboard/setup.py
new file mode 100644 (file)
index 0000000..59637a5
--- /dev/null
@@ -0,0 +1,8 @@
+import setuptools
+
+__author__ = 'serena'
+
+
+setuptools.setup(
+    setup_requires=['pbr>=1.8'],
+    pbr=True)
index b527b78..653448e 100755 (executable)
@@ -82,6 +82,10 @@ for version in conf.versions:
         items = {}
         scenario_result_criteria = {}
 
+        scenario_file_name = (conf.REPORTING_PATH +
+                              "/functest/release/" + version +
+                              "/scenario_history.txt")
+
         # For all the scenarios get results
         for s, s_result in scenario_results.items():
             logger.info("---------------------------------")
@@ -185,11 +189,8 @@ for version in conf.versions:
                 scenario_criteria = conf.MAX_SCENARIO_CRITERIA
 
             s_score = str(scenario_score) + "/" + str(scenario_criteria)
-            s_score_percent = 0.0
-            try:
-                s_score_percent = float(scenario_score) / float(scenario_criteria) * 100
-            except:
-                logger.error("cannot calculate the score percent")
+            s_score_percent = utils.getScenarioPercent(scenario_score,
+                                                       scenario_criteria)
 
             s_status = "KO"
             if scenario_score < scenario_criteria:
@@ -209,10 +210,7 @@ for version in conf.versions:
                     f.write(info)
 
             # Save daily results in a file
-            path_validation_file = (conf.REPORTING_PATH +
-                                    "/functest/release/" + version +
-                                    "/scenario_history.txt")
-            with open(path_validation_file, "a") as f:
+            with open(scenario_file_name, "a") as f:
                 info = (reportingDate + "," + s + "," + installer +
                         "," + s_score + "," +
                         str(round(s_score_percent)) + "\n")
@@ -239,34 +237,39 @@ for version in conf.versions:
                                      version=version,
                                      date=reportingDate)
 
-    with open(conf.REPORTING_PATH + "/functest/release/" + version +
-              "/index-status-" + installer + ".html", "wb") as fh:
-        fh.write(outputText)
+        # csv
+        # generate sub files based on scenario_history.txt
+        scenario_installer_file_name = (conf.REPORTING_PATH +
+                                        "/functest/release/" + version +
+                                        "/scenario_history_" + installer +
+                                        ".txt")
+        scenario_installer_file = open(scenario_installer_file_name, "a")
+        logger.info("Generate CSV...")
+        with open(scenario_file_name, "r") as f:
+            for line in f:
+                if installer in line:
+                    logger.debug("Add new line... %s" % line)
+                    scenario_installer_file.write(line)
+        scenario_installer_file.close
+
+        with open(conf.REPORTING_PATH + "/functest/release/" + version +
+                  "/index-status-" + installer + ".html", "wb") as fh:
+            fh.write(outputText)
+        logger.info("CSV generated...")
 
-    # Generate outputs for export
-    # pdf
-    try:
-        pdf_path = ("http://testresults.opnfv.org/reporting/" +
-                    "functest/release/" + version +
-                    "/index-status-" + installer + ".html")
-        pdf_doc_name = (conf.REPORTING_PATH +
-                        "/functest/release/" + version +
-                        "/status-" + installer + ".pdf")
-        pdfkit.from_url(pdf_path, pdf_doc_name)
-    except IOError:
-        logger.info("pdf generated anyway...")
-    except:
-        logger.error("impossible to generate PDF")
-    # csv
-    # generate sub files based on scenario_history.txt
-    scenario_installer_file_name = (conf.REPORTING_PATH +
-                                    "/functest/release/" + version +
-                                    "/scenario_history_" +
-                                    installer + ".txt")
-    scenario_installer_file = open(scenario_installer_file_name, "w")
-    with open(path_validation_file, "r") as f:
-        for line in f:
-            if installer in line:
-                scenario_installer_file.write(line)
-    scenario_installer_file.close
+        # Generate outputs for export
+        # pdf
+        logger.info("Generate PDF...")
+        try:
+            pdf_path = ("http://testresults.opnfv.org/reporting/" +
+                        "functest/release/" + version +
+                        "/index-status-" + installer + ".html")
+            pdf_doc_name = (conf.REPORTING_PATH +
+                            "/functest/release/" + version +
+                            "/status-" + installer + ".pdf")
+            pdfkit.from_url(pdf_path, pdf_doc_name)
+            logger.info("PDF generated...")
+        except IOError:
+            logger.info("pdf generated anyway...")
+        except:
+            logger.error("impossible to generate PDF")
index 9ba02e8..74d6f19 100644 (file)
@@ -176,3 +176,11 @@ def getJenkinsUrl(build_tag):
         print 'Impossible to get jenkins url:'
 
     return jenkins_url
+
+def getScenarioPercent(scenario_score,scenario_criteria):
+    score = 0.0
+    try:
+        score = float(scenario_score) / float(scenario_criteria) * 100
+    except:
+        print 'Impossible to calculate the percentage score'
+    return score
similarity index 97%
rename from utils/test/result_collection_api/README.rst
rename to utils/test/testapi/README.rst
index c0075bc..44ab2a4 100644 (file)
@@ -25,7 +25,7 @@ How to install
 
 From within your environment, just run:
 
-    python setup.py install
+    ./install.sh
 
 How to run
 ^^^^^^^^^^
similarity index 96%
rename from utils/test/result_collection_api/docker/Dockerfile
rename to utils/test/testapi/docker/Dockerfile
index ffee4c2..b0272e6 100644 (file)
@@ -46,7 +46,7 @@ RUN pip install --upgrade pip
 RUN git config --global http.sslVerify false
 RUN git clone https://gerrit.opnfv.org/gerrit/releng /home/releng
 
-WORKDIR /home/releng/utils/test/result_collection_api/
+WORKDIR /home/releng/utils/test/testapi/
 RUN pip install -r requirements.txt
 RUN python setup.py install
 CMD ["bash", "docker/start-server.sh"]
diff --git a/utils/test/testapi/install.sh b/utils/test/testapi/install.sh
new file mode 100755 (executable)
index 0000000..43229ea
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+usage="
+Script to install opnfv_tesgtapi automatically.
+This script should be run under root.
+
+usage:
+    bash $(basename "$0") [-h|--help] [-t <test_name>]
+
+where:
+    -h|--help         show this help text"
+
+if [[ $(whoami) != "root" ]]; then
+    echo "Error: This script must be run as root!"
+    exit 1
+fi
+
+cp -fr 3rd_party/static opnfv_testapi/tornado_swagger
+python setup.py install
+rm -fr opnfv_testapi/tornado_swagger/static
diff --git a/utils/test/testapi/update/templates/__init__.py b/utils/test/testapi/update/templates/__init__.py
new file mode 100644 (file)
index 0000000..e69de29