diff options
-rwxr-xr-x | jjb/apex/apex-deploy.sh | 2 | ||||
-rw-r--r-- | jjb/apex/apex.yml | 23 | ||||
-rw-r--r-- | jjb/armband/armband-ci-jobs.yml | 14 | ||||
-rwxr-xr-x | jjb/armband/armband-deploy.sh | 4 | ||||
-rw-r--r-- | jjb/compass4nfv/compass-ci-jobs.yml | 1 | ||||
-rw-r--r-- | jjb/compass4nfv/compass-deploy.sh | 5 | ||||
-rw-r--r-- | jjb/compass4nfv/compass-project-jobs.yml | 1 | ||||
-rw-r--r-- | jjb/compass4nfv/compass-verify-jobs.yml | 3 | ||||
-rwxr-xr-x | jjb/daisy4nfv/daisy4nfv-download-artifact.sh | 13 | ||||
-rw-r--r-- | jjb/fuel/fuel-daily-jobs.yml | 14 | ||||
-rwxr-xr-x | jjb/fuel/fuel-download-artifact.sh | 8 | ||||
-rwxr-xr-x | jjb/kvmfornfv/kvmfornfv-test.sh | 9 | ||||
-rw-r--r-- | jjb/kvmfornfv/kvmfornfv.yml | 10 | ||||
-rw-r--r-- | jjb/multisite/multisite-daily-jobs.yml | 247 | ||||
-rw-r--r-- | jjb/opnfv/installer-params.yml | 10 | ||||
-rw-r--r-- | jjb/opnfv/opnfv-docs.yml | 2 | ||||
-rw-r--r-- | jjb/opnfv/opnfv-lint.yml | 2 | ||||
-rw-r--r-- | jjb/opnfv/slave-params.yml | 10 | ||||
-rw-r--r-- | jjb/qtip/qtip-project-jobs.yml | 7 | ||||
-rw-r--r-- | jjb/vswitchperf/vswitchperf.yml | 22 | ||||
-rw-r--r-- | jjb/yardstick/yardstick-project-jobs.yml | 2 | ||||
-rw-r--r-- | modules/README.rst (renamed from modules/Readme.txt) | 7 | ||||
-rw-r--r-- | modules/opnfv/__init__.py (renamed from utils/installer-adapter/__init__.py) | 0 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/InstallerHandler.py (renamed from utils/installer-adapter/InstallerHandler.py) | 8 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/__init__.py (renamed from modules/__init.py__) | 0 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/apex/ApexAdapter.py (renamed from utils/installer-adapter/ApexAdapter.py) | 0 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/apex/__init__.py (renamed from modules/installer_adapters/__init.py__) | 0 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/compass/CompassAdapter.py (renamed from utils/installer-adapter/CompassAdapter.py) | 0 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/compass/__init__.py (renamed from modules/utils/__init.py__) | 0 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/fuel/FuelAdapter.py (renamed from utils/installer-adapter/FuelAdapter.py) | 6 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/fuel/__init__.py | 0 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/fuel/example.py (renamed from utils/installer-adapter/example.py) | 10 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/joid/JoidAdapter.py (renamed from utils/installer-adapter/JoidAdapter.py) | 0 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/joid/__init__.py | 0 | ||||
-rw-r--r-- | modules/opnfv/utils/Connection.py | 30 | ||||
-rw-r--r-- | modules/opnfv/utils/Credentials.py | 101 | ||||
-rw-r--r-- | modules/opnfv/utils/OPNFVExceptions.py | 126 | ||||
-rw-r--r-- | modules/opnfv/utils/OPNFVLogger.py (renamed from utils/installer-adapter/RelengLogger.py) | 0 | ||||
-rw-r--r-- | modules/opnfv/utils/SSHUtils.py (renamed from utils/installer-adapter/SSHUtils.py) | 7 | ||||
-rw-r--r-- | modules/opnfv/utils/__init__.py | 0 | ||||
-rw-r--r-- | modules/opnfv/utils/constants.py | 15 | ||||
-rwxr-xr-x | modules/run_unit_tests.sh | 36 | ||||
-rw-r--r-- | modules/setup.py | 25 | ||||
-rw-r--r-- | modules/tests/__init__.py | 0 | ||||
-rw-r--r-- | modules/tests/unit/__init__.py | 0 | ||||
-rw-r--r-- | modules/tests/unit/utils/__init__.py | 0 | ||||
-rw-r--r-- | modules/tests/unit/utils/test_OPNFVExceptions.py | 74 | ||||
-rwxr-xr-x | prototypes/bifrost/scripts/test-bifrost-deployment.sh | 6 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/css/font-awesome.min.css (renamed from utils/test/reporting/assets/css/font-awesome.min.css) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/css/ie8.css (renamed from utils/test/reporting/assets/css/ie8.css) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/css/ie9.css (renamed from utils/test/reporting/assets/css/ie9.css) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/css/main.css (renamed from utils/test/reporting/assets/css/main.css) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/fonts/FontAwesome.otf (renamed from utils/test/reporting/assets/fonts/FontAwesome.otf) | bin | 124988 -> 124988 bytes | |||
-rw-r--r-- | utils/test/reporting/3rd_party/fonts/fontawesome-webfont.eot (renamed from utils/test/reporting/assets/fonts/fontawesome-webfont.eot) | bin | 76518 -> 76518 bytes | |||
-rw-r--r-- | utils/test/reporting/3rd_party/fonts/fontawesome-webfont.svg (renamed from utils/test/reporting/assets/fonts/fontawesome-webfont.svg) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/fonts/fontawesome-webfont.ttf (renamed from utils/test/reporting/assets/fonts/fontawesome-webfont.ttf) | bin | 152796 -> 152796 bytes | |||
-rw-r--r-- | utils/test/reporting/3rd_party/fonts/fontawesome-webfont.woff (renamed from utils/test/reporting/assets/fonts/fontawesome-webfont.woff) | bin | 90412 -> 90412 bytes | |||
-rw-r--r-- | utils/test/reporting/3rd_party/fonts/fontawesome-webfont.woff2 (renamed from utils/test/reporting/assets/fonts/fontawesome-webfont.woff2) | bin | 71896 -> 71896 bytes | |||
-rw-r--r-- | utils/test/reporting/3rd_party/js/ie/html5shiv.js (renamed from utils/test/reporting/assets/js/ie/html5shiv.js) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/js/ie/respond.min.js (renamed from utils/test/reporting/assets/js/ie/respond.min.js) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/js/jquery.min.js (renamed from utils/test/reporting/assets/js/jquery.min.js) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/js/main.js (renamed from utils/test/reporting/assets/js/main.js) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/js/skel.min.js (renamed from utils/test/reporting/assets/js/skel.min.js) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/js/util.js (renamed from utils/test/reporting/assets/js/util.js) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/base/_page.scss (renamed from utils/test/reporting/assets/sass/base/_page.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/base/_typography.scss (renamed from utils/test/reporting/assets/sass/base/_typography.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/components/_box.scss (renamed from utils/test/reporting/assets/sass/components/_box.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/components/_button.scss (renamed from utils/test/reporting/assets/sass/components/_button.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/components/_form.scss (renamed from utils/test/reporting/assets/sass/components/_form.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/components/_icon.scss (renamed from utils/test/reporting/assets/sass/components/_icon.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/components/_image.scss (renamed from utils/test/reporting/assets/sass/components/_image.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/components/_list.scss (renamed from utils/test/reporting/assets/sass/components/_list.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/components/_section.scss (renamed from utils/test/reporting/assets/sass/components/_section.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/components/_table.scss (renamed from utils/test/reporting/assets/sass/components/_table.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/components/_tiles.scss (renamed from utils/test/reporting/assets/sass/components/_tiles.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/ie8.scss (renamed from utils/test/reporting/assets/sass/ie8.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/ie9.scss (renamed from utils/test/reporting/assets/sass/ie9.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/layout/_footer.scss (renamed from utils/test/reporting/assets/sass/layout/_footer.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/layout/_header.scss (renamed from utils/test/reporting/assets/sass/layout/_header.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/layout/_main.scss (renamed from utils/test/reporting/assets/sass/layout/_main.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/layout/_menu.scss (renamed from utils/test/reporting/assets/sass/layout/_menu.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/layout/_wrapper.scss (renamed from utils/test/reporting/assets/sass/layout/_wrapper.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/libs/_functions.scss (renamed from utils/test/reporting/assets/sass/libs/_functions.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/libs/_mixins.scss (renamed from utils/test/reporting/assets/sass/libs/_mixins.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/libs/_skel.scss (renamed from utils/test/reporting/assets/sass/libs/_skel.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/libs/_vars.scss (renamed from utils/test/reporting/assets/sass/libs/_vars.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/3rd_party/sass/main.scss (renamed from utils/test/reporting/assets/sass/main.scss) | 0 | ||||
-rw-r--r-- | utils/test/reporting/docker/Dockerfile | 43 | ||||
-rwxr-xr-x | utils/test/reporting/docker/reporting.sh | 65 | ||||
-rw-r--r-- | utils/test/reporting/docker/requirements.pip | 12 | ||||
-rwxr-xr-x | utils/test/reporting/functest/reporting-status.py | 118 | ||||
-rwxr-xr-x | utils/test/reporting/functest/reporting-tempest.py | 37 | ||||
-rwxr-xr-x | utils/test/reporting/functest/reporting-vims.py | 35 | ||||
-rw-r--r-- | utils/test/reporting/functest/reportingConf.py | 26 | ||||
-rw-r--r-- | utils/test/reporting/functest/reportingUtils.py | 186 | ||||
-rw-r--r-- | utils/test/reporting/functest/template/index-status-tmpl.html | 26 | ||||
-rw-r--r-- | utils/test/reporting/functest/template/index-tempest-tmpl.html | 12 | ||||
-rw-r--r-- | utils/test/reporting/functest/template/index-vims-tmpl.html | 12 | ||||
-rw-r--r-- | utils/test/reporting/functest/testCase.py | 6 | ||||
-rw-r--r-- | utils/test/reporting/html/colorado.html (renamed from utils/test/reporting/colorado.html) | 26 | ||||
-rw-r--r-- | utils/test/reporting/html/danube.html (renamed from utils/test/reporting/danube.html) | 26 | ||||
-rw-r--r-- | utils/test/reporting/html/elements.html (renamed from utils/test/reporting/elements.html) | 46 | ||||
-rw-r--r-- | utils/test/reporting/html/functest-colorado.html (renamed from utils/test/reporting/functest-colorado.html) | 32 | ||||
-rw-r--r-- | utils/test/reporting/html/functest-master.html (renamed from utils/test/reporting/functest-master.html) | 32 | ||||
-rw-r--r-- | utils/test/reporting/html/generic.html (renamed from utils/test/reporting/generic.html) | 24 | ||||
-rw-r--r-- | utils/test/reporting/html/index.html (renamed from utils/test/reporting/index.html) | 24 | ||||
-rw-r--r-- | utils/test/reporting/img/colorado.jpg (renamed from utils/test/reporting/images/colorado.jpg) | bin | 28682 -> 28682 bytes | |||
-rw-r--r-- | utils/test/reporting/img/danube.jpg (renamed from utils/test/reporting/images/danube.jpg) | bin | 51220 -> 51220 bytes | |||
-rw-r--r-- | utils/test/reporting/img/functest.jpg (renamed from utils/test/reporting/images/functest.jpg) | bin | 32653 -> 32653 bytes | |||
-rw-r--r-- | utils/test/reporting/img/functest.jpg.old (renamed from utils/test/reporting/images/functest.jpg.old) | bin | 32653 -> 32653 bytes | |||
-rw-r--r-- | utils/test/reporting/img/gauge_0.png | bin | 0 -> 3644 bytes | |||
-rw-r--r-- | utils/test/reporting/img/gauge_100.png | bin | 0 -> 3191 bytes | |||
-rw-r--r-- | utils/test/reporting/img/gauge_16.7.png | bin | 0 -> 3170 bytes | |||
-rw-r--r-- | utils/test/reporting/img/gauge_25.png | bin | 0 -> 3108 bytes | |||
-rw-r--r-- | utils/test/reporting/img/gauge_33.3.png | bin | 0 -> 3081 bytes | |||
-rw-r--r-- | utils/test/reporting/img/gauge_41.7.png | bin | 0 -> 3169 bytes | |||
-rw-r--r-- | utils/test/reporting/img/gauge_50.png | bin | 0 -> 3123 bytes | |||
-rw-r--r-- | utils/test/reporting/img/gauge_58.3.png | bin | 0 -> 3161 bytes | |||
-rw-r--r-- | utils/test/reporting/img/gauge_66.7.png | bin | 0 -> 3069 bytes | |||
-rw-r--r-- | utils/test/reporting/img/gauge_75.png | bin | 0 -> 3030 bytes | |||
-rw-r--r-- | utils/test/reporting/img/gauge_8.3.png | bin | 0 -> 2993 bytes | |||
-rw-r--r-- | utils/test/reporting/img/gauge_83.3.png | bin | 0 -> 3122 bytes | |||
-rw-r--r-- | utils/test/reporting/img/gauge_91.7.png | bin | 0 -> 3008 bytes | |||
-rw-r--r-- | utils/test/reporting/img/icon-nok.png | bin | 0 -> 2317 bytes | |||
-rw-r--r-- | utils/test/reporting/img/icon-ok.png | bin | 0 -> 4063 bytes | |||
-rw-r--r-- | utils/test/reporting/img/logo.svg (renamed from utils/test/reporting/images/logo.svg) | 0 | ||||
-rw-r--r-- | utils/test/reporting/img/pic01.jpg (renamed from utils/test/reporting/images/pic01.jpg) | bin | 6311 -> 6311 bytes | |||
-rw-r--r-- | utils/test/reporting/img/pic02.jpg (renamed from utils/test/reporting/images/pic02.jpg) | bin | 6084 -> 6084 bytes | |||
-rw-r--r-- | utils/test/reporting/img/pic03.jpg (renamed from utils/test/reporting/images/pic03.jpg) | bin | 5788 -> 5788 bytes | |||
-rw-r--r-- | utils/test/reporting/img/pic04.jpg (renamed from utils/test/reporting/images/pic04.jpg) | bin | 6499 -> 6499 bytes | |||
-rw-r--r-- | utils/test/reporting/img/pic05.jpg (renamed from utils/test/reporting/images/pic05.jpg) | bin | 5232 -> 5232 bytes | |||
-rw-r--r-- | utils/test/reporting/img/pic06.jpg (renamed from utils/test/reporting/images/pic06.jpg) | bin | 6704 -> 6704 bytes | |||
-rw-r--r-- | utils/test/reporting/img/pic07.jpg (renamed from utils/test/reporting/images/pic07.jpg) | bin | 5606 -> 5606 bytes | |||
-rw-r--r-- | utils/test/reporting/img/pic08.jpg (renamed from utils/test/reporting/images/pic08.jpg) | bin | 5889 -> 5889 bytes | |||
-rw-r--r-- | utils/test/reporting/img/pic09.jpg (renamed from utils/test/reporting/images/pic09.jpg) | bin | 5808 -> 5808 bytes | |||
-rw-r--r-- | utils/test/reporting/img/pic10.jpg (renamed from utils/test/reporting/images/pic10.jpg) | bin | 6489 -> 6489 bytes | |||
-rw-r--r-- | utils/test/reporting/img/pic11.jpg (renamed from utils/test/reporting/images/pic11.jpg) | bin | 6338 -> 6338 bytes | |||
-rw-r--r-- | utils/test/reporting/img/pic12.jpg (renamed from utils/test/reporting/images/pic12.jpg) | bin | 6261 -> 6261 bytes | |||
-rw-r--r-- | utils/test/reporting/img/pic13.jpg (renamed from utils/test/reporting/images/pic13.jpg) | bin | 17129 -> 17129 bytes | |||
-rw-r--r-- | utils/test/reporting/img/pic14.jpg (renamed from utils/test/reporting/images/pic14.jpg) | bin | 2580 -> 2580 bytes | |||
-rw-r--r-- | utils/test/reporting/img/pic15.jpg (renamed from utils/test/reporting/images/pic15.jpg) | bin | 2560 -> 2560 bytes | |||
-rw-r--r-- | utils/test/reporting/img/weather-clear.png | bin | 0 -> 1560 bytes | |||
-rw-r--r-- | utils/test/reporting/img/weather-few-clouds.png | bin | 0 -> 1927 bytes | |||
-rw-r--r-- | utils/test/reporting/img/weather-overcast.png | bin | 0 -> 1588 bytes | |||
-rw-r--r-- | utils/test/reporting/img/weather-storm.png | bin | 0 -> 2137 bytes | |||
-rw-r--r-- | utils/test/reporting/img/yardstick.jpg (renamed from utils/test/reporting/images/yardstick.jpg) | bin | 41093 -> 41093 bytes | |||
-rw-r--r-- | utils/test/reporting/reporting.yaml | 49 | ||||
-rwxr-xr-x | utils/test/reporting/run_unit_tests.sh | 43 | ||||
-rw-r--r-- | utils/test/reporting/setup.py | 22 | ||||
-rw-r--r-- | utils/test/reporting/tests/__init__.py | 0 | ||||
-rw-r--r-- | utils/test/reporting/tests/unit/__init__.py | 0 | ||||
-rw-r--r-- | utils/test/reporting/tests/unit/utils/__init__.py | 0 | ||||
-rw-r--r-- | utils/test/reporting/tests/unit/utils/test_utils.py | 29 | ||||
-rw-r--r-- | utils/test/reporting/utils/__init__.py | 0 | ||||
-rw-r--r-- | utils/test/reporting/utils/reporting_utils.py | 355 | ||||
-rw-r--r-- | utils/test/reporting/yardstick/reporting-status.py | 52 | ||||
-rw-r--r-- | utils/test/reporting/yardstick/reportingConf.py | 29 | ||||
-rw-r--r-- | utils/test/reporting/yardstick/reportingUtils.py | 115 | ||||
-rw-r--r-- | utils/test/reporting/yardstick/scenarios.py | 19 | ||||
-rw-r--r-- | utils/test/reporting/yardstick/template/index-status-tmpl.html | 9 |
160 files changed, 1679 insertions, 691 deletions
diff --git a/jjb/apex/apex-deploy.sh b/jjb/apex/apex-deploy.sh index e21387ac6..bbceb4b88 100755 --- a/jjb/apex/apex-deploy.sh +++ b/jjb/apex/apex-deploy.sh @@ -176,6 +176,8 @@ else # settings for bare metal deployment if [ "$IPV6_FLAG" == "True" ]; then NETWORK_FILE="/root/network/network_settings_v6.yaml" + elif [[ "$JOB_NAME" == *master* ]]; then + NETWORK_FILE="/root/network/network_settings-master.yaml" else NETWORK_FILE="/root/network/network_settings.yaml" fi diff --git a/jjb/apex/apex.yml b/jjb/apex/apex.yml index 643972bd2..8bfc53d59 100644 --- a/jjb/apex/apex.yml +++ b/jjb/apex/apex.yml @@ -220,13 +220,13 @@ git-revision: false block: true same-node: true -# - trigger-builds: -# - project: 'functest-apex-{verify-slave}-suite-{stream}' -# predefined-parameters: | -# DEPLOY_SCENARIO=os-odl_l2-nofeature-ha -# FUNCTEST_SUITE_NAME=healthcheck -# block: true -# same-node: true + - trigger-builds: + - project: 'functest-apex-{verify-slave}-suite-{stream}' + predefined-parameters: | + DEPLOY_SCENARIO=os-odl_l2-nofeature-ha + FUNCTEST_SUITE_NAME=healthcheck + block: true + same-node: true - 'apex-workspace-cleanup' - job-template: @@ -949,11 +949,16 @@ - trigger: name: 'apex-master' triggers: - - timed: '0 0 20 8 *' + - timed: '0 3 * * 0' + - timed: '0 3 * * 4' - trigger: name: 'apex-colorado' triggers: - - timed: '0 3 * * *' + - timed: '0 3 * * 1' + - timed: '0 3 * * 2' + - timed: '0 3 * * 3' + - timed: '0 3 * * 5' + - timed: '0 3 * * 6' - trigger: name: 'apex-gs-clean-{stream}' triggers: diff --git a/jjb/armband/armband-ci-jobs.yml b/jjb/armband/armband-ci-jobs.yml index 2122959a9..b1cd9bf75 100644 --- a/jjb/armband/armband-ci-jobs.yml +++ b/jjb/armband/armband-ci-jobs.yml @@ -303,31 +303,31 @@ - trigger: name: 'fuel-os-odl_l2-nofeature-ha-armband-virtual-master-trigger' triggers: - - timed: '' + - timed: '0 2 * * 1' - trigger: name: 'fuel-os-nosdn-nofeature-ha-armband-virtual-master-trigger' triggers: - - timed: '' + - timed: '0 2 * * 2' - trigger: name: 'fuel-os-odl_l3-nofeature-ha-armband-virtual-master-trigger' triggers: - - timed: '' + - timed: '0 2 * * 3' - trigger: name: 'fuel-os-odl_l2-bgpvpn-ha-armband-virtual-master-trigger' triggers: - - timed: '' + - timed: '0 2 * * 4' - trigger: name: 'fuel-os-odl_l2-nofeature-noha-armband-virtual-master-trigger' triggers: - - timed: '' + - timed: '0 2 * * 5' - trigger: name: 'fuel-os-odl_l2-sfc-ha-armband-virtual-master-trigger' triggers: - - timed: '' + - timed: '0 2 * * 6' - trigger: name: 'fuel-os-odl_l2-sfc-noha-armband-virtual-master-trigger' triggers: - - timed: '' + - timed: '0 2 * * 7' #-------------------------------------------------------------------- # Enea Armband CI Virtual Triggers running against colorado branch #-------------------------------------------------------------------- diff --git a/jjb/armband/armband-deploy.sh b/jjb/armband/armband-deploy.sh index c8e58afa8..e0631c424 100755 --- a/jjb/armband/armband-deploy.sh +++ b/jjb/armband/armband-deploy.sh @@ -61,6 +61,10 @@ if [[ $LAB_CONFIG_URL =~ ^(git|ssh):// ]]; then fi fi +if [[ "$NODE_NAME" =~ "virtual" ]]; then + POD_NAME="virtual_kvm" +fi + # releng wants us to use nothing else but opnfv.iso for now. We comply. ISO_FILE=$WORKSPACE/opnfv.iso diff --git a/jjb/compass4nfv/compass-ci-jobs.yml b/jjb/compass4nfv/compass-ci-jobs.yml index eb9113114..b70bfc67b 100644 --- a/jjb/compass4nfv/compass-ci-jobs.yml +++ b/jjb/compass4nfv/compass-ci-jobs.yml @@ -248,6 +248,7 @@ name: COMPASS_OPENSTACK_VERSION choices: - 'mitaka' + - 'newton' - 'liberty' - choice: name: COMPASS_OS_VERSION_OPTION diff --git a/jjb/compass4nfv/compass-deploy.sh b/jjb/compass4nfv/compass-deploy.sh index 65e44b670..256717953 100644 --- a/jjb/compass4nfv/compass-deploy.sh +++ b/jjb/compass4nfv/compass-deploy.sh @@ -33,6 +33,11 @@ if [[ "${COMPASS_OS_VERSION_OPTION}" = "xenial" ]] && [[ "${OPENSTACK_VERSION}" export OPENSTACK_VERSION=${OPENSTACK_VERSION}_${COMPASS_OS_VERSION_OPTION} export OS_VERSION=${COMPASS_OS_VERSION_OPTION} fi +if [[ "${OPENSTACK_VERSION}" = "newton" ]]; then + export OS_VERSION="xenial" + export OPENSTACK_VERSION=${OPENSTACK_VERSION}_${OS_VERSION} +fi + if [[ "${DEPLOY_SCENARIO}" =~ "-ocl" ]]; then export NETWORK_CONF_FILE=network_ocl.yml diff --git a/jjb/compass4nfv/compass-project-jobs.yml b/jjb/compass4nfv/compass-project-jobs.yml index 3a52e91c9..50ff072fb 100644 --- a/jjb/compass4nfv/compass-project-jobs.yml +++ b/jjb/compass4nfv/compass-project-jobs.yml @@ -125,6 +125,7 @@ name: COMPASS_OPENSTACK_VERSION choices: - 'mitaka' + - 'newton' - 'liberty' - choice: name: COMPASS_OS_VERSION diff --git a/jjb/compass4nfv/compass-verify-jobs.yml b/jjb/compass4nfv/compass-verify-jobs.yml index 82e3dfdf2..cc04ad3da 100644 --- a/jjb/compass4nfv/compass-verify-jobs.yml +++ b/jjb/compass4nfv/compass-verify-jobs.yml @@ -124,7 +124,7 @@ name: basic condition: SUCCESSFUL projects: - - name: 'compass-verify-basic-{stream}' + - name: 'opnfv-lint-verify-{stream}' current-parameters: true node-parameters: true kill-phase-on: FAILURE @@ -243,6 +243,7 @@ name: COMPASS_OPENSTACK_VERSION choices: - 'mitaka' + - 'newton' - 'liberty' - choice: name: COMPASS_OS_VERSION diff --git a/jjb/daisy4nfv/daisy4nfv-download-artifact.sh b/jjb/daisy4nfv/daisy4nfv-download-artifact.sh index 7ac76a5eb..90b5fa62f 100755 --- a/jjb/daisy4nfv/daisy4nfv-download-artifact.sh +++ b/jjb/daisy4nfv/daisy4nfv-download-artifact.sh @@ -11,26 +11,31 @@ set -o errexit set -o pipefail +# use proxy url to replace the nomral URL, for googleusercontent.com will be blocked randomly +[[ "$NODE_NAME" =~ (zte) ]] && GS_URL=$GS_BASE_PROXY + if [[ "$JOB_NAME" =~ "merge" ]]; then echo "Downloading http://$GS_URL/opnfv-gerrit-$GERRIT_CHANGE_NUMBER.properties" # get the properties file for the Daisy4nfv BIN built for a merged change - curl -s -o $WORKSPACE/latest.properties http://$GS_URL/opnfv-gerrit-$GERRIT_CHANGE_NUMBER.properties + curl -L -s -o $WORKSPACE/latest.properties http://$GS_URL/opnfv-gerrit-$GERRIT_CHANGE_NUMBER.properties else # get the latest.properties file in order to get info regarding latest artifact echo "Downloading http://$GS_URL/latest.properties" - curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties + curl -L -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties fi # check if we got the file -[[ -f latest.properties ]] || exit 1 +[[ -f $WORKSPACE/latest.properties ]] || exit 1 # source the file so we get artifact metadata -source latest.properties +source $WORKSPACE/latest.properties # echo the info about artifact that is used during the deployment OPNFV_ARTIFACT=${OPNFV_ARTIFACT_URL/*\/} echo "Using $OPNFV_ARTIFACT for deployment" +[[ "$NODE_NAME" =~ (zte) ]] && OPNFV_ARTIFACT_URL=${GS_BASE_PROXY%%/*}/$OPNFV_ARTIFACT_URL + # log info to console echo "Downloading the $INSTALLER_TYPE artifact using URL http://$OPNFV_ARTIFACT_URL" echo "This could take some time..." diff --git a/jjb/fuel/fuel-daily-jobs.yml b/jjb/fuel/fuel-daily-jobs.yml index 1c7946a87..6c2d6f021 100644 --- a/jjb/fuel/fuel-daily-jobs.yml +++ b/jjb/fuel/fuel-daily-jobs.yml @@ -273,31 +273,31 @@ - trigger: name: 'fuel-os-odl_l2-nofeature-ha-baremetal-daily-master-trigger' triggers: - - timed: '5 23 * * *' + - timed: '' # '5 23 * * *' - trigger: name: 'fuel-os-odl_l3-nofeature-ha-baremetal-daily-master-trigger' triggers: - - timed: '5 2 * * *' + - timed: '' # '5 2 * * *' - trigger: name: 'fuel-os-onos-sfc-ha-baremetal-daily-master-trigger' triggers: - - timed: '5 5 * * *' + - timed: '' # '5 5 * * *' - trigger: name: 'fuel-os-onos-nofeature-ha-baremetal-daily-master-trigger' triggers: - - timed: '5 8 * * *' + - timed: '' # '5 8 * * *' - trigger: name: 'fuel-os-odl_l2-sfc-ha-baremetal-daily-master-trigger' triggers: - - timed: '5 11 * * *' + - timed: '' # '5 11 * * *' - trigger: name: 'fuel-os-odl_l2-bgpvpn-ha-baremetal-daily-master-trigger' triggers: - - timed: '5 14 * * *' + - timed: '' # '5 14 * * *' - trigger: name: 'fuel-os-nosdn-kvm-ha-baremetal-daily-master-trigger' triggers: - - timed: '5 17 * * *' + - timed: '' # '5 17 * * *' - trigger: name: 'fuel-os-nosdn-ovs-ha-baremetal-daily-master-trigger' triggers: diff --git a/jjb/fuel/fuel-download-artifact.sh b/jjb/fuel/fuel-download-artifact.sh index 3f691d821..2a0f09a3f 100755 --- a/jjb/fuel/fuel-download-artifact.sh +++ b/jjb/fuel/fuel-download-artifact.sh @@ -11,16 +11,16 @@ set -o errexit set -o pipefail # use proxy url to replace the nomral URL, for googleusercontent.com will be blocked randomly -[[ "$NODE_NAME" =~ (zte) ]] && GS_URL=$GS_BASE_PROXY +[[ "$NODE_NAME" =~ (zte) ]] && GS_URL=${GS_BASE_PROXY%%/*}/$GS_URL if [[ "$JOB_NAME" =~ "merge" ]]; then echo "Downloading http://$GS_URL/opnfv-gerrit-$GERRIT_CHANGE_NUMBER.properties" # get the properties file for the Fuel ISO built for a merged change - curl -s -o $WORKSPACE/latest.properties http://$GS_URL/opnfv-gerrit-$GERRIT_CHANGE_NUMBER.properties + curl -L -s -o $WORKSPACE/latest.properties http://$GS_URL/opnfv-gerrit-$GERRIT_CHANGE_NUMBER.properties else # get the latest.properties file in order to get info regarding latest artifact echo "Downloading http://$GS_URL/latest.properties" - curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties + curl -L -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties fi # check if we got the file @@ -59,7 +59,7 @@ echo "--------------------------------------------------------" echo # download the file -curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1 +curl -L -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1 # list the file ls -al $WORKSPACE/opnfv.iso diff --git a/jjb/kvmfornfv/kvmfornfv-test.sh b/jjb/kvmfornfv/kvmfornfv-test.sh index f677f470d..b31d61cce 100755 --- a/jjb/kvmfornfv/kvmfornfv-test.sh +++ b/jjb/kvmfornfv/kvmfornfv-test.sh @@ -13,9 +13,16 @@ else exit 1 fi +echo $TEST_NAME + # do stuff differently based on the job type case "$JOB_TYPE" in - verify|daily) + verify) + #start the test + cd $WORKSPACE + ./ci/test_kvmfornfv.sh $JOB_TYPE + ;; + daily) #start the test cd $WORKSPACE ./ci/test_kvmfornfv.sh $JOB_TYPE $TEST_NAME diff --git a/jjb/kvmfornfv/kvmfornfv.yml b/jjb/kvmfornfv/kvmfornfv.yml index 2c8446e07..04fce221c 100644 --- a/jjb/kvmfornfv/kvmfornfv.yml +++ b/jjb/kvmfornfv/kvmfornfv.yml @@ -112,8 +112,6 @@ node-parameters: false kill-phase-on: FAILURE abort-all-job: true - - - job-template: name: 'kvmfornfv-verify-{phase}-{stream}' @@ -271,7 +269,7 @@ name: build condition: SUCCESSFUL projects: - - name: 'kvmfornfv-Packet_Forwarding-daily-build-{stream}' + - name: 'kvmfornfv-Packet_Forwarding-daily-test-{stream}' current-parameters: false node-parameters: false git-revision: true @@ -316,21 +314,21 @@ # parameter macros ######################## - parameter: - name: 'kvmfornfv-Idle_Idle-daily-parameter' + name: 'kvmfornfv-Idle_Idle-daily-test-{stream}' parameters: - string: name: TEST_NAME default: 'idle_idle' description: "Daily job to run cyclictest without applying any stress" - parameter: - name: 'kvmfornfv-Stress_Idle-daily-parameter' + name: 'kvmfornfv-Stress_Idle-daily-test-{stream}' parameters: - string: name: TEST_NAME default: 'stress_idle' description: "Daily job to run cyclictest with stress applied" - parameter: - name: 'kvmfornfv-Packet_Forwarding-daily-parameter' + name: 'kvmfornfv-Packet_Forwarding-daily-test-{stream}' parameters: - string: name: TEST_NAME diff --git a/jjb/multisite/multisite-daily-jobs.yml b/jjb/multisite/multisite-daily-jobs.yml new file mode 100644 index 000000000..cfb40a1fa --- /dev/null +++ b/jjb/multisite/multisite-daily-jobs.yml @@ -0,0 +1,247 @@ +- project: + name: kingbird + + project: 'multisite' + + jobs: + - 'multisite-kingbird-virtual-daily-{stream}' + - 'multisite-{phase}-{stream}' + + phase: + - 'fuel-deploy-regionone-virtual' + - 'fuel-deploy-regiontwo-virtual' + - 'register-endpoints' + - 'update-auth' + - 'kingbird-deploy-virtual' + - 'kingbird-functest' + + stream: + - master: + branch: '{stream}' + gs-pathname: '' + disabled: false + timed: '#@midnight' + +- job-template: + name: 'multisite-kingbird-virtual-daily-{stream}' + + project-type: multijob + + disabled: '{obj:disabled}' + + concurrent: false + + parameters: + - project-parameter: + project: '{project}' + - string: + name: KINGBIRD_LOG_FILE + default: $WORKSPACE/kingbird.log + - 'multisite-virtual-defaults' + - string: + name: DEPLOY_SCENARIO + default: 'os-nosdn-multisite-noha' + + triggers: + - timed: '{timed}' + + builders: + - description-setter: + description: "Built on $NODE_NAME" + - multijob: + name: fuel-deploy-virtual + condition: SUCCESSFUL + projects: + - name: 'multisite-fuel-deploy-regionone-virtual-{stream}' + current-parameters: false + predefined-parameters: | + FUEL_VERSION=latest + DEPLOY_SCENARIO=$DEPLOY_SCENARIO + OS_REGION=RegionOne + REGIONONE_IP=10.2.117.79 + REGIONTWO_IP=10.2.117.181 + node-parameters: false + node-label-name: SLAVE_LABEL + node-label: intel-virtual2 + kill-phase-on: FAILURE + abort-all-job: true + - name: 'multisite-fuel-deploy-regiontwo-virtual-{stream}' + current-parameters: false + predefined-parameters: | + FUEL_VERSION=latest + DEPLOY_SCENARIO=$DEPLOY_SCENARIO + OS_REGION=RegionTwo + REGIONONE_IP=10.2.117.79 + REGIONTWO_IP=10.2.117.181 + node-parameters: false + node-label-name: SLAVE_LABEL + node-label: intel-virtual6 + kill-phase-on: FAILURE + abort-all-job: true + - multijob: + name: centralize-keystone + condition: SUCCESSFUL + projects: + - name: 'multisite-register-endpoints-{stream}' + current-parameters: false + predefined-parameters: | + OS_REGION=RegionOne + REGIONONE_IP=10.2.117.79 + REGIONTWO_IP=10.2.117.181 + node-parameters: false + node-label-name: SLAVE_LABEL + node-label: intel-virtual2 + kill-phase-on: FAILURE + abort-all-job: true + - name: 'multisite-update-auth-{stream}' + current-parameters: false + predefined-parameters: | + OS_REGION=RegionTwo + REGIONONE_IP=10.2.117.79 + REGIONTWO_IP=10.2.117.181 + node-parameters: false + node-label-name: SLAVE_LABEL + node-label: intel-virtual6 + kill-phase-on: FAILURE + abort-all-job: true + - multijob: + name: kingbird-deploy-virtual + condition: SUCCESSFUL + projects: + - name: 'multisite-kingbird-deploy-virtual-{stream}' + current-parameters: false + predefined-parameters: | + OS_REGION=RegionOne + REGIONONE_IP=10.2.117.79 + REGIONTWO_IP=10.2.117.181 + node-parameters: false + node-label-name: SLAVE_LABEL + node-label: intel-virtual2 + kill-phase-on: FAILURE + abort-all-job: true + - multijob: + name: kingbird-functest + condition: SUCCESSFUL + projects: + - name: 'multisite-kingbird-functest-{stream}' + current-parameters: false + predefined-parameters: | + OS_REGION=RegionOne + REGIONONE_IP=10.2.117.79 + REGIONTWO_IP=10.2.117.181 + node-parameters: false + node-label-name: SLAVE_LABEL + node-label: intel-virtual2 + kill-phase-on: NEVER + abort-all-job: false + +- job-template: + name: 'multisite-{phase}-{stream}' + + concurrent: false + + builders: + - description-setter: + description: "Built on $NODE_NAME" + - 'multisite-{phase}-builder': + stream: '{stream}' + + publishers: + - 'multisite-{phase}-publisher' + +######################## +# builder macros +######################## +- builder: + name: 'multisite-fuel-deploy-regionone-virtual-builder' + builders: + - shell: | + #!/bin/bash + + echo "This is where we deploy fuel, extract passwords and save into file" +- builder: + name: 'multisite-fuel-deploy-regiontwo-virtual-builder' + builders: + - shell: | + #!/bin/bash + + echo "This is where we deploy fuel, extract publicUrl, privateUrl, and adminUrl and save into file" +- builder: + name: 'multisite-register-endpoints-builder' + builders: + - copyartifact: + project: 'multisite-fuel-deploy-regiontwo-virtual-{stream}' + which-build: multijob-build + filter: "RegionTwo-Endpoints.txt" + - shell: | + #!/bin/bash + + echo "This is where we register RegionTwo in RegionOne keystone" +- builder: + name: 'multisite-update-auth-builder' + builders: + - copyartifact: + project: 'multisite-fuel-deploy-regionone-virtual-{stream}' + which-build: multijob-build + filter: "RegionOne-Passwords.txt" + - shell: | + #!/bin/bash + + echo "This is where we read passwords from RegionOne-passwords.txt and replace passwords in RegionTwo" +- builder: + name: 'multisite-kingbird-deploy-virtual-builder' + builders: + - shell: | + #!/bin/bash + + echo "This is where we install kingbird" +- builder: + name: 'multisite-kingbird-functest-builder' + builders: + - shell: | + #!/bin/bash + + echo "This is where we run kingbird-functest" +######################## +# publisher macros +######################## +- publisher: + name: 'multisite-fuel-deploy-regionone-virtual-publisher' + publishers: + - archive: + artifacts: '/root/servicepass.ini' + allow-empty: false + only-if-success: true + fingerprint: true +- publisher: + name: 'multisite-fuel-deploy-regiontwo-virtual-publisher' + publishers: + - archive: + artifacts: '/root/endpoints.ini' + allow-empty: false + only-if-success: true + fingerprint: true +- publisher: + name: 'multisite-register-endpoints-publisher' + publishers: + - archive: + artifacts: 'dummy.txt' + allow-empty: true +- publisher: + name: 'multisite-update-auth-publisher' + publishers: + - archive: + artifacts: 'dummy.txt' + allow-empty: true +- publisher: + name: 'multisite-kingbird-deploy-virtual-publisher' + publishers: + - archive: + artifacts: 'dummy.txt' + allow-empty: true +- publisher: + name: 'multisite-kingbird-functest-publisher' + publishers: + - archive: + artifacts: 'dummy.txt' + allow-empty: true diff --git a/jjb/opnfv/installer-params.yml b/jjb/opnfv/installer-params.yml index ec0b86170..55f4769b7 100644 --- a/jjb/opnfv/installer-params.yml +++ b/jjb/opnfv/installer-params.yml @@ -59,7 +59,7 @@ parameters: - string: name: INSTALLER_IP - default: '192.168.Y.Y' + default: '192.168.122.5' description: 'IP of the installer' - string: name: INSTALLER_TYPE @@ -67,11 +67,11 @@ description: 'Installer used for deploying OPNFV on this POD' - string: name: OS_RELEASE - default: 'mitaka' - description: 'OpenStack release (liberty|mitaka)' + default: 'newton' + description: 'OpenStack release (mitaka|newton)' - string: name: EXTERNAL_NETWORK - default: ext-net4 + default: ext-net description: "External network used for Floating ips." - string: name: LAB_CONFIG @@ -84,7 +84,7 @@ - string: name: UBUNTU_DISTRO default: 'xenial' - description: "Ubuntu distribution to use for Openstack (trusty|xenial)" + description: "Ubuntu distribution to use for Openstack (xenial)" - string: name: CPU_ARCHITECTURE default: 'amd64' diff --git a/jjb/opnfv/opnfv-docs.yml b/jjb/opnfv/opnfv-docs.yml index 307c1db44..442e8ea71 100644 --- a/jjb/opnfv/opnfv-docs.yml +++ b/jjb/opnfv/opnfv-docs.yml @@ -19,7 +19,7 @@ disabled: false - colorado: branch: 'stable/{stream}' - doc-version: '2.0' + doc-version: '3.0' gs-pathname: '/{stream}/{doc-version}' disabled: false diff --git a/jjb/opnfv/opnfv-lint.yml b/jjb/opnfv/opnfv-lint.yml index f2312f54c..652f28292 100644 --- a/jjb/opnfv/opnfv-lint.yml +++ b/jjb/opnfv/opnfv-lint.yml @@ -55,7 +55,7 @@ comment-contains-value: 'reverify' projects: - project-compare-type: 'REG_EXP' - project-pattern: 'functest|sdnvpn|qtip|daisy|sfc|compass4nfv' + project-pattern: 'functest|sdnvpn|qtip|daisy|sfc|escalator' branches: - branch-compare-type: 'ANT' branch-pattern: '**/{branch}' diff --git a/jjb/opnfv/slave-params.yml b/jjb/opnfv/slave-params.yml index b46960fa7..dd0c97996 100644 --- a/jjb/opnfv/slave-params.yml +++ b/jjb/opnfv/slave-params.yml @@ -660,6 +660,16 @@ name: SSH_KEY default: /root/.ssh/id_rsa description: 'SSH key to be used' +- parameter: + name: 'multisite-virtual-defaults' + parameters: + - label: + name: SLAVE_LABEL + default: 'multisite-virtual' + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/$PROJECT + description: 'Git URL to use on this Jenkins Slave' ##################################################### # These slaves are just dummy slaves for sandbox jobs ##################################################### diff --git a/jjb/qtip/qtip-project-jobs.yml b/jjb/qtip/qtip-project-jobs.yml index 722a9beb3..f192e8679 100644 --- a/jjb/qtip/qtip-project-jobs.yml +++ b/jjb/qtip/qtip-project-jobs.yml @@ -59,4 +59,9 @@ builders: - shell: | - echo "Nothing to verify!" + #!/bin/bash + set -o errexit + set -o pipefail + set -o xtrace + + tox diff --git a/jjb/vswitchperf/vswitchperf.yml b/jjb/vswitchperf/vswitchperf.yml index 3f7f6bf2d..5f952de00 100644 --- a/jjb/vswitchperf/vswitchperf.yml +++ b/jjb/vswitchperf/vswitchperf.yml @@ -63,11 +63,12 @@ concurrent: true properties: - - throttle: - enabled: true - max-total: 3 - max-per-node: 2 - option: 'project' + - build-blocker: + use-build-blocker: true + blocking-jobs: + - 'vswitchperf-verify-.*' + - 'vswitchperf-merge-.*' + block-level: 'NODE' parameters: - project-parameter: @@ -125,11 +126,12 @@ concurrent: true properties: - - throttle: - enabled: true - max-total: 3 - max-per-node: 2 - option: 'project' + - build-blocker: + use-build-blocker: true + blocking-jobs: + - 'vswitchperf-verify-.*' + - 'vswitchperf-merge-.*' + block-level: 'NODE' parameters: - project-parameter: diff --git a/jjb/yardstick/yardstick-project-jobs.yml b/jjb/yardstick/yardstick-project-jobs.yml index db07e9d83..abc6eeb4b 100644 --- a/jjb/yardstick/yardstick-project-jobs.yml +++ b/jjb/yardstick/yardstick-project-jobs.yml @@ -122,7 +122,7 @@ # install python packages easy_install -U setuptools easy_install -U pip - pip install -r tests/ci/requirements.txt + pip install -r requirements.txt || pip install -r tests/ci/requirements.txt pip install -e . # unit tests diff --git a/modules/Readme.txt b/modules/README.rst index 32becc21e..caec46b1d 100644 --- a/modules/Readme.txt +++ b/modules/README.rst @@ -3,9 +3,10 @@ This directory may be used to add new tools that might be useful for any project in OPNFV. This tools must be python based and shall be imported as follows: - from releng.modules.utils import SSHUtils - from releng.modules.utils import RelengLogger - ... + from opnfv.utils import SSHUtils + from opnfv.utils import OPNFVLogger + from opnfv.utils import OPNFVException + from opnfv.utils import constants For further information about how to use this modules directory, contact: fatih.degirmenci@ericsson.com diff --git a/utils/installer-adapter/__init__.py b/modules/opnfv/__init__.py index e69de29bb..e69de29bb 100644 --- a/utils/installer-adapter/__init__.py +++ b/modules/opnfv/__init__.py diff --git a/utils/installer-adapter/InstallerHandler.py b/modules/opnfv/installer_adapters/InstallerHandler.py index b81b806ca..e353ef3f4 100644 --- a/utils/installer-adapter/InstallerHandler.py +++ b/modules/opnfv/installer_adapters/InstallerHandler.py @@ -7,10 +7,10 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -from FuelAdapter import FuelAdapter -from ApexAdapter import ApexAdapter -from CompassAdapter import CompassAdapter -from JoidAdapter import JoidAdapter +from opnfv.installer_adapters.fuel.FuelAdapter import FuelAdapter +from opnfv.installer_adapters.apex.ApexAdapter import ApexAdapter +from opnfv.installer_adapters.compass.CompassAdapter import CompassAdapter +from opnfv.installer_adapters.joid.JoidAdapter import JoidAdapter INSTALLERS = ["fuel", "apex", "compass", "joid"] diff --git a/modules/__init.py__ b/modules/opnfv/installer_adapters/__init__.py index e69de29bb..e69de29bb 100644 --- a/modules/__init.py__ +++ b/modules/opnfv/installer_adapters/__init__.py diff --git a/utils/installer-adapter/ApexAdapter.py b/modules/opnfv/installer_adapters/apex/ApexAdapter.py index 17a27b10a..17a27b10a 100644 --- a/utils/installer-adapter/ApexAdapter.py +++ b/modules/opnfv/installer_adapters/apex/ApexAdapter.py diff --git a/modules/installer_adapters/__init.py__ b/modules/opnfv/installer_adapters/apex/__init__.py index e69de29bb..e69de29bb 100644 --- a/modules/installer_adapters/__init.py__ +++ b/modules/opnfv/installer_adapters/apex/__init__.py diff --git a/utils/installer-adapter/CompassAdapter.py b/modules/opnfv/installer_adapters/compass/CompassAdapter.py index 47cbc646d..47cbc646d 100644 --- a/utils/installer-adapter/CompassAdapter.py +++ b/modules/opnfv/installer_adapters/compass/CompassAdapter.py diff --git a/modules/utils/__init.py__ b/modules/opnfv/installer_adapters/compass/__init__.py index e69de29bb..e69de29bb 100644 --- a/modules/utils/__init.py__ +++ b/modules/opnfv/installer_adapters/compass/__init__.py diff --git a/utils/installer-adapter/FuelAdapter.py b/modules/opnfv/installer_adapters/fuel/FuelAdapter.py index 672fd5175..6f079404c 100644 --- a/utils/installer-adapter/FuelAdapter.py +++ b/modules/opnfv/installer_adapters/fuel/FuelAdapter.py @@ -8,8 +8,8 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -import SSHUtils as ssh_utils -import RelengLogger as rl +import opnfv.utils.SSHUtils as ssh_utils +import opnfv.utils.OPNFVLogger as logger class FuelAdapter: @@ -22,7 +22,7 @@ class FuelAdapter: installer_ip, self.installer_user, password=self.installer_password) - self.logger = rl.Logger("Handler").getLogger() + self.logger = logger.Logger("FuelHandler").getLogger() def runcmd_fuel_installer(self, cmd): _, stdout, stderr = (self diff --git a/modules/opnfv/installer_adapters/fuel/__init__.py b/modules/opnfv/installer_adapters/fuel/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/modules/opnfv/installer_adapters/fuel/__init__.py diff --git a/utils/installer-adapter/example.py b/modules/opnfv/installer_adapters/fuel/example.py index 804d79c3d..7fea4dfd7 100644 --- a/utils/installer-adapter/example.py +++ b/modules/opnfv/installer_adapters/fuel/example.py @@ -1,12 +1,12 @@ # This is an example of usage of this Tool # Author: Jose Lausuch (jose.lausuch@ericsson.com) -from InstallerHandler import InstallerHandler +import opnfv.installer_adapters.InstallerHandler as ins_handler -fuel_handler = InstallerHandler(installer='fuel', - installer_ip='10.20.0.2', - installer_user='root', - installer_pwd='r00tme') +fuel_handler = ins_handler.InstallerHandler(installer='fuel', + installer_ip='10.20.0.2', + installer_user='root', + installer_pwd='r00tme') print("Nodes in cluster 1:\n%s\n" % fuel_handler.get_nodes(options={'cluster': '1'})) print("Nodes in cluster 2:\n%s\n" % diff --git a/utils/installer-adapter/JoidAdapter.py b/modules/opnfv/installer_adapters/joid/JoidAdapter.py index be8c2ebac..be8c2ebac 100644 --- a/utils/installer-adapter/JoidAdapter.py +++ b/modules/opnfv/installer_adapters/joid/JoidAdapter.py diff --git a/modules/opnfv/installer_adapters/joid/__init__.py b/modules/opnfv/installer_adapters/joid/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/modules/opnfv/installer_adapters/joid/__init__.py diff --git a/modules/opnfv/utils/Connection.py b/modules/opnfv/utils/Connection.py new file mode 100644 index 000000000..a3be51409 --- /dev/null +++ b/modules/opnfv/utils/Connection.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 Orange 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 + + +import os +import time + + +class Connection(object): + + def __init__(self): + pass + + def verify_connectivity(self, target): + for x in range(0, 10): + ping_cmd = ("ping -c 1 -W 1 %s >/dev/null" % target) + response = os.system(ping_cmd) + if response == 0: + return os.EX_OK + time.sleep(1) + return os.EX_UNAVAILABLE + + def check_internet_access(self, url="www.google.com"): + return self.verify_connectivity(url) diff --git a/modules/opnfv/utils/Credentials.py b/modules/opnfv/utils/Credentials.py new file mode 100644 index 000000000..1882692b3 --- /dev/null +++ b/modules/opnfv/utils/Credentials.py @@ -0,0 +1,101 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 Orange 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 +# +# Usage example: +# from opnfv.utils.Credentials import Credentials as credentials +# credentials("fuel", "10.20.0.2", "root", "r00tme").fetch('./openrc') +# + +import os + +import opnfv.installer_adapters.InstallerHandler as ins_handler +import opnfv.utils.Connection as con +import opnfv.utils.OPNFVLogger as logger + + +class Credentials(object): + + def __init__(self, installer, ip, user, password=None): + self.installer = installer + self.ip = ip + self.logger = logger.Logger("Credentials", level="DEBUG").getLogger() + self.connection = con.Connection() + + if self.__check_installer_name(self.installer) != os.EX_OK: + self.logger.error("Installer %s not supported!" % self.installer) + return os.EX_CONFIG + else: + self.logger.debug("Installer %s supported." % self.installer) + + if self.connection.verify_connectivity(self.ip) != os.EX_OK: + self.logger.error("Installer %s not reachable!" % self.ip) + return os.EX_UNAVAILABLE + else: + self.logger.debug("IP %s is reachable!" % self.ip) + + self.logger.debug( + "Trying to stablish ssh connection to %s ..." % self.ip) + self.handler = ins_handler.InstallerHandler(installer, + ip, + user, + password) + + def __check_installer_name(self, installer): + if installer not in ("apex", "compass", "fuel", "joid"): + return os.EX_CONFIG + else: + return os.EX_OK + + def __check_path(self, path): + try: + with open(path, 'a'): + os.utime(path, None) + return os.EX_OK + except IOError as e: + self.logger.error(e) + return os.EX_IOERR + + def __fetch_creds_apex(self, target_path): + # TODO + pass + + def __fetch_creds_compass(self, target_path): + # TODO + pass + + def __fetch_creds_fuel(self, target_path): + creds_file = '/root/openrc' + try: + self.handler.get_file_from_controller(creds_file, target_path) + except Exception, e: + self.logger.error( + "Cannot get %s from controller. %e" % (creds_file, e)) + pass + + def __fetch_creds_joid(self, target_path): + # TODO + pass + + def fetch(self, target_path): + if self.__check_path(target_path) != os.EX_OK: + self.logger.error( + "Target path %s does not exist!" % target_path) + return os.EX_IOERR + else: + self.logger.debug("Target path correct.") + + self.logger.info("Fetching credentials from the deployment...") + if self.installer == "apex": + self.__fetch_creds_apex(target_path) + elif self.installer == "compass": + self.__fetch_creds_compass(target_path) + elif self.installer == "fuel": + self.__fetch_creds_fuel(target_path) + elif self.installer == "joid": + self.__fetch_creds_joid(target_path) diff --git a/modules/opnfv/utils/OPNFVExceptions.py b/modules/opnfv/utils/OPNFVExceptions.py new file mode 100644 index 000000000..03b3ea981 --- /dev/null +++ b/modules/opnfv/utils/OPNFVExceptions.py @@ -0,0 +1,126 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 Orange 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 +# +# This class defines Python OPNFV exceptions +# + + +class OPNFVException(Exception): + def __call__(self, *args): + return self.__class__(*(self.args + args)) + + +# ************************************ +# Generic +# ************************************ +class OPNFVSUTNotReachable(OPNFVException): + """Target System Under Test is not reachable""" + pass + + +class OPNFVCiExecutionError(OPNFVException): + """Error occurs during CI exection""" + pass + + +class TestDashboardError(OPNFVException): + """Impossible to report results to dashboard""" + pass + + +class TestReportingError(OPNFVException): + """Impossible to report results to reporting""" + pass + + +# ************************************ +# Exceptions related to test DB +# ************************************ +class TestDbNotReachable(OPNFVException): + """Test database is not reachable""" + pass + + +class UnknownScenario(OPNFVException): + """Test scenario is unknown""" + pass + + +class UnknownPod(OPNFVException): + """Test POD is unknown""" + pass + + +class UnknownProject(OPNFVException): + """Project is unknown""" + pass + + +class UnknownTestCase(OPNFVException): + """Test case is unknown""" + pass + + +class UnknownVersion(OPNFVException): + """Version is unknown""" + pass + + +class UnknownInstaller(OPNFVException): + """Installer is not supported""" + pass + + +# ******************* +# Test project errors +# ******************* +class FunctestExecutionError(OPNFVException): + """Internal Functest error""" + pass + + +class YardstickExecutionError(OPNFVException): + """Internal Yardstick error""" + pass + + +# ********************************** +# Errors related to Feature projects +# ********************************** +class TestCaseNotRunnable(OPNFVException): + """test case incompatible with SUT, scenario, installer""" + pass + + +class FeatureTestIntegrationError(OPNFVException): + """Impossible to integrate Feature test""" + pass + + +class FeatureTestExecutionError(OPNFVException): + """Error during Feature test execution""" + pass + + +# ********************************* +# Errors related to VNF on boarding +# ********************************* +class VNFTestNotRunnable(OPNFVException): + """VNF test is not compatible with SUT, scenario, installer""" + pass + + +class VNFIntegrationError(OPNFVException): + """Impossible to integrate the VNF test""" + pass + + +class VNFExecutionError(OPNFVException): + """Error during VNF test execution""" + pass diff --git a/utils/installer-adapter/RelengLogger.py b/modules/opnfv/utils/OPNFVLogger.py index 6fa4ef2e2..6fa4ef2e2 100644 --- a/utils/installer-adapter/RelengLogger.py +++ b/modules/opnfv/utils/OPNFVLogger.py diff --git a/utils/installer-adapter/SSHUtils.py b/modules/opnfv/utils/SSHUtils.py index c93888694..6c794c274 100644 --- a/utils/installer-adapter/SSHUtils.py +++ b/modules/opnfv/utils/SSHUtils.py @@ -10,10 +10,10 @@ import paramiko -import RelengLogger as rl +import opnfv.utils.OPNFVLogger as OPNFVLogger import os -logger = rl.Logger('SSHUtils').getLogger() +logger = OPNFVLogger.Logger('SSHUtils').getLogger() def get_ssh_client(hostname, username, password=None, jumphost=None): @@ -66,8 +66,9 @@ class JumpHostHopClient(paramiko.SSHClient): ''' Connect to a remote server using a jumphost hop ''' + def __init__(self, *args, **kwargs): - self.logger = rl.Logger("JumpHostHopClient").getLogger() + self.logger = OPNFVLogger.Logger("JumpHostHopClient").getLogger() self.jumphost_ssh = None self.jumphost_transport = None self.jumphost_channel = None diff --git a/modules/opnfv/utils/__init__.py b/modules/opnfv/utils/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/modules/opnfv/utils/__init__.py diff --git a/modules/opnfv/utils/constants.py b/modules/opnfv/utils/constants.py new file mode 100644 index 000000000..29f0d02c5 --- /dev/null +++ b/modules/opnfv/utils/constants.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 Orange 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 + +INSTALLERS = ['apex', 'fuel', 'compass', 'joid'] +VERSIONS = ['arno', 'brahmaputra', 'colorado', 'danube'] + +EXIT_OK = 0 +EXIT_RUN_ERROR = -1 +EXIT_PUSH_TO_TEST_DB_ERROR = -2 diff --git a/modules/run_unit_tests.sh b/modules/run_unit_tests.sh new file mode 100755 index 000000000..df511ce0c --- /dev/null +++ b/modules/run_unit_tests.sh @@ -0,0 +1,36 @@ +#!/bin/bash +set -o errexit +set -o pipefail + +# Either Workspace is set (CI) +if [ -z $WORKSPACE ] +then + WORKSPACE="." +fi + + +# *************** +# Run unit tests +# *************** +echo "Running unit tests..." + +# start vitual env +virtualenv $WORKSPACE/modules_venv +source $WORKSPACE/modules_venv/bin/activate + +# install python packages +easy_install -U setuptools +easy_install -U pip +pip install $WORKSPACE + + +# unit tests +nosetests --with-xunit \ + --cover-package=opnfv \ + --with-coverage \ + --cover-xml \ + --cover-html \ + tests/unit +rc=$? + +deactivate diff --git a/modules/setup.py b/modules/setup.py new file mode 100644 index 000000000..8ac5ceac3 --- /dev/null +++ b/modules/setup.py @@ -0,0 +1,25 @@ +############################################################################## +# 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 +############################################################################## + + +from setuptools import setup, find_packages + + +setup( + name="opnfv", + version="danube", + packages=find_packages(), + include_package_data=True, + package_data={ + }, + url="https://www.opnfv.org", + install_requires=["paramiko>=2.0.1", + "mock==1.3.0", + "nose==1.3.7", + "coverage==4.1", + "requests==2.9.1"] +) diff --git a/modules/tests/__init__.py b/modules/tests/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/modules/tests/__init__.py diff --git a/modules/tests/unit/__init__.py b/modules/tests/unit/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/modules/tests/unit/__init__.py diff --git a/modules/tests/unit/utils/__init__.py b/modules/tests/unit/utils/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/modules/tests/unit/utils/__init__.py diff --git a/modules/tests/unit/utils/test_OPNFVExceptions.py b/modules/tests/unit/utils/test_OPNFVExceptions.py new file mode 100644 index 000000000..fca927b58 --- /dev/null +++ b/modules/tests/unit/utils/test_OPNFVExceptions.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 Orange 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.0import requests +import unittest +import requests + +from opnfv.utils import OPNFVExceptions + + +def base_function(): + raise OPNFVExceptions.TestDbNotReachable('Test database is not reachable') + + +def base_function_wrong(): + raise OPNFVExceptions.NotSelfDefinedException + + +def db_connectivity(): + url = 'http://testresults.opnfv2.org/test/api/v1/projects/functest/cases' + r = requests.get(url) + if r.status_code is not 200: + raise OPNFVExceptions.TestDbNotReachable('Database not found') + + +def project_unknown(): + url = 'http://testresults.opnfv.org/test/api/v1/projects/functest2/cases' + r = requests.get(url) + if len(r.json()['testcases']) is 0: + raise OPNFVExceptions.UnknownProject + + +class TestBasicRaise(unittest.TestCase): + def test(self): + with self.assertRaises(Exception) as context: + base_function() + self.assertTrue('Test database is not reachable' in context.exception) + + +class TestWrongRaise(unittest.TestCase): + def test(self): + try: + base_function_wrong() + except OPNFVExceptions.OPNFVException: + assert(False) + except AttributeError: + assert(True) + + +class TestCaseDBNotReachable(unittest.TestCase): + def test(self): + with self.assertRaises(Exception) as context: + db_connectivity() + self.assertTrue('Database not found' in context.exception) + + +class TestUnkownProject(unittest.TestCase): + def test(self): + try: + project_unknown() + except OPNFVExceptions.TestDashboardError: + # should not be there + assert(False) + except OPNFVExceptions.UnknownProject: + assert(True) + except Exception: + assert(False) + +if __name__ == '__main__': + unittest.main() diff --git a/prototypes/bifrost/scripts/test-bifrost-deployment.sh b/prototypes/bifrost/scripts/test-bifrost-deployment.sh index 030faedcf..32a066388 100755 --- a/prototypes/bifrost/scripts/test-bifrost-deployment.sh +++ b/prototypes/bifrost/scripts/test-bifrost-deployment.sh @@ -34,13 +34,13 @@ PROVISION_WAIT_TIMEOUT=${PROVISION_WAIT_TIMEOUT:-2400} TEST_VM_NUM_NODES=3 export TEST_VM_NODE_NAMES="jumphost.opnfvlocal controller00.opnfvlocal compute00.opnfvlocal" export VM_DOMAIN_TYPE="kvm" -export VM_CPU=4 -export VM_DISK=100 +export VM_CPU=${VM_CPU:-4} +export VM_DISK=${VM_DISK:-100} TEST_PLAYBOOK="test-bifrost-infracloud.yaml" USE_INSPECTOR=true USE_CIRROS=false TESTING_USER=root -VM_MEMORY_SIZE="8192" +VM_MEMORY_SIZE=${VM_MEMORY_SIZE:-8192} DOWNLOAD_IPA=true CREATE_IPA_IMAGE=false INSPECT_NODES=true diff --git a/utils/test/reporting/assets/css/font-awesome.min.css b/utils/test/reporting/3rd_party/css/font-awesome.min.css index 9b27f8ea8..9b27f8ea8 100644 --- a/utils/test/reporting/assets/css/font-awesome.min.css +++ b/utils/test/reporting/3rd_party/css/font-awesome.min.css diff --git a/utils/test/reporting/assets/css/ie8.css b/utils/test/reporting/3rd_party/css/ie8.css index 8110fe537..8110fe537 100644 --- a/utils/test/reporting/assets/css/ie8.css +++ b/utils/test/reporting/3rd_party/css/ie8.css diff --git a/utils/test/reporting/assets/css/ie9.css b/utils/test/reporting/3rd_party/css/ie9.css index 2c1a43b88..2c1a43b88 100644 --- a/utils/test/reporting/assets/css/ie9.css +++ b/utils/test/reporting/3rd_party/css/ie9.css diff --git a/utils/test/reporting/assets/css/main.css b/utils/test/reporting/3rd_party/css/main.css index b74d484cb..b74d484cb 100644 --- a/utils/test/reporting/assets/css/main.css +++ b/utils/test/reporting/3rd_party/css/main.css diff --git a/utils/test/reporting/assets/fonts/FontAwesome.otf b/utils/test/reporting/3rd_party/fonts/FontAwesome.otf Binary files differindex d4de13e83..d4de13e83 100644 --- a/utils/test/reporting/assets/fonts/FontAwesome.otf +++ b/utils/test/reporting/3rd_party/fonts/FontAwesome.otf diff --git a/utils/test/reporting/assets/fonts/fontawesome-webfont.eot b/utils/test/reporting/3rd_party/fonts/fontawesome-webfont.eot Binary files differindex c7b00d2ba..c7b00d2ba 100644 --- a/utils/test/reporting/assets/fonts/fontawesome-webfont.eot +++ b/utils/test/reporting/3rd_party/fonts/fontawesome-webfont.eot diff --git a/utils/test/reporting/assets/fonts/fontawesome-webfont.svg b/utils/test/reporting/3rd_party/fonts/fontawesome-webfont.svg index 8b66187fe..8b66187fe 100644 --- a/utils/test/reporting/assets/fonts/fontawesome-webfont.svg +++ b/utils/test/reporting/3rd_party/fonts/fontawesome-webfont.svg diff --git a/utils/test/reporting/assets/fonts/fontawesome-webfont.ttf b/utils/test/reporting/3rd_party/fonts/fontawesome-webfont.ttf Binary files differindex f221e50a2..f221e50a2 100644 --- a/utils/test/reporting/assets/fonts/fontawesome-webfont.ttf +++ b/utils/test/reporting/3rd_party/fonts/fontawesome-webfont.ttf diff --git a/utils/test/reporting/assets/fonts/fontawesome-webfont.woff b/utils/test/reporting/3rd_party/fonts/fontawesome-webfont.woff Binary files differindex 6e7483cf6..6e7483cf6 100644 --- a/utils/test/reporting/assets/fonts/fontawesome-webfont.woff +++ b/utils/test/reporting/3rd_party/fonts/fontawesome-webfont.woff diff --git a/utils/test/reporting/assets/fonts/fontawesome-webfont.woff2 b/utils/test/reporting/3rd_party/fonts/fontawesome-webfont.woff2 Binary files differindex 7eb74fd12..7eb74fd12 100644 --- a/utils/test/reporting/assets/fonts/fontawesome-webfont.woff2 +++ b/utils/test/reporting/3rd_party/fonts/fontawesome-webfont.woff2 diff --git a/utils/test/reporting/assets/js/ie/html5shiv.js b/utils/test/reporting/3rd_party/js/ie/html5shiv.js index dcf351c86..dcf351c86 100644 --- a/utils/test/reporting/assets/js/ie/html5shiv.js +++ b/utils/test/reporting/3rd_party/js/ie/html5shiv.js diff --git a/utils/test/reporting/assets/js/ie/respond.min.js b/utils/test/reporting/3rd_party/js/ie/respond.min.js index e8d6207f7..e8d6207f7 100644 --- a/utils/test/reporting/assets/js/ie/respond.min.js +++ b/utils/test/reporting/3rd_party/js/ie/respond.min.js diff --git a/utils/test/reporting/assets/js/jquery.min.js b/utils/test/reporting/3rd_party/js/jquery.min.js index 0f60b7bd0..0f60b7bd0 100644 --- a/utils/test/reporting/assets/js/jquery.min.js +++ b/utils/test/reporting/3rd_party/js/jquery.min.js diff --git a/utils/test/reporting/assets/js/main.js b/utils/test/reporting/3rd_party/js/main.js index 7ae5408d3..7ae5408d3 100644 --- a/utils/test/reporting/assets/js/main.js +++ b/utils/test/reporting/3rd_party/js/main.js diff --git a/utils/test/reporting/assets/js/skel.min.js b/utils/test/reporting/3rd_party/js/skel.min.js index 0e7633aa2..0e7633aa2 100644 --- a/utils/test/reporting/assets/js/skel.min.js +++ b/utils/test/reporting/3rd_party/js/skel.min.js diff --git a/utils/test/reporting/assets/js/util.js b/utils/test/reporting/3rd_party/js/util.js index bdb8e9f0b..bdb8e9f0b 100644 --- a/utils/test/reporting/assets/js/util.js +++ b/utils/test/reporting/3rd_party/js/util.js diff --git a/utils/test/reporting/assets/sass/base/_page.scss b/utils/test/reporting/3rd_party/sass/base/_page.scss index 95397cb16..95397cb16 100644 --- a/utils/test/reporting/assets/sass/base/_page.scss +++ b/utils/test/reporting/3rd_party/sass/base/_page.scss diff --git a/utils/test/reporting/assets/sass/base/_typography.scss b/utils/test/reporting/3rd_party/sass/base/_typography.scss index 190762c77..190762c77 100644 --- a/utils/test/reporting/assets/sass/base/_typography.scss +++ b/utils/test/reporting/3rd_party/sass/base/_typography.scss diff --git a/utils/test/reporting/assets/sass/components/_box.scss b/utils/test/reporting/3rd_party/sass/components/_box.scss index 74d3eba02..74d3eba02 100644 --- a/utils/test/reporting/assets/sass/components/_box.scss +++ b/utils/test/reporting/3rd_party/sass/components/_box.scss diff --git a/utils/test/reporting/assets/sass/components/_button.scss b/utils/test/reporting/3rd_party/sass/components/_button.scss index 97fb389ad..97fb389ad 100644 --- a/utils/test/reporting/assets/sass/components/_button.scss +++ b/utils/test/reporting/3rd_party/sass/components/_button.scss diff --git a/utils/test/reporting/assets/sass/components/_form.scss b/utils/test/reporting/3rd_party/sass/components/_form.scss index af0d5f224..af0d5f224 100644 --- a/utils/test/reporting/assets/sass/components/_form.scss +++ b/utils/test/reporting/3rd_party/sass/components/_form.scss diff --git a/utils/test/reporting/assets/sass/components/_icon.scss b/utils/test/reporting/3rd_party/sass/components/_icon.scss index 5b9a40ca6..5b9a40ca6 100644 --- a/utils/test/reporting/assets/sass/components/_icon.scss +++ b/utils/test/reporting/3rd_party/sass/components/_icon.scss diff --git a/utils/test/reporting/assets/sass/components/_image.scss b/utils/test/reporting/3rd_party/sass/components/_image.scss index 81ae7a372..81ae7a372 100644 --- a/utils/test/reporting/assets/sass/components/_image.scss +++ b/utils/test/reporting/3rd_party/sass/components/_image.scss diff --git a/utils/test/reporting/assets/sass/components/_list.scss b/utils/test/reporting/3rd_party/sass/components/_list.scss index 9aadc22d1..9aadc22d1 100644 --- a/utils/test/reporting/assets/sass/components/_list.scss +++ b/utils/test/reporting/3rd_party/sass/components/_list.scss diff --git a/utils/test/reporting/assets/sass/components/_section.scss b/utils/test/reporting/3rd_party/sass/components/_section.scss index 5b1b02a5d..5b1b02a5d 100644 --- a/utils/test/reporting/assets/sass/components/_section.scss +++ b/utils/test/reporting/3rd_party/sass/components/_section.scss diff --git a/utils/test/reporting/assets/sass/components/_table.scss b/utils/test/reporting/3rd_party/sass/components/_table.scss index d6e872865..d6e872865 100644 --- a/utils/test/reporting/assets/sass/components/_table.scss +++ b/utils/test/reporting/3rd_party/sass/components/_table.scss diff --git a/utils/test/reporting/assets/sass/components/_tiles.scss b/utils/test/reporting/3rd_party/sass/components/_tiles.scss index cecbbbe8d..cecbbbe8d 100644 --- a/utils/test/reporting/assets/sass/components/_tiles.scss +++ b/utils/test/reporting/3rd_party/sass/components/_tiles.scss diff --git a/utils/test/reporting/assets/sass/ie8.scss b/utils/test/reporting/3rd_party/sass/ie8.scss index 534576206..534576206 100644 --- a/utils/test/reporting/assets/sass/ie8.scss +++ b/utils/test/reporting/3rd_party/sass/ie8.scss diff --git a/utils/test/reporting/assets/sass/ie9.scss b/utils/test/reporting/3rd_party/sass/ie9.scss index 65004c2ba..65004c2ba 100644 --- a/utils/test/reporting/assets/sass/ie9.scss +++ b/utils/test/reporting/3rd_party/sass/ie9.scss diff --git a/utils/test/reporting/assets/sass/layout/_footer.scss b/utils/test/reporting/3rd_party/sass/layout/_footer.scss index ce0ccbc99..ce0ccbc99 100644 --- a/utils/test/reporting/assets/sass/layout/_footer.scss +++ b/utils/test/reporting/3rd_party/sass/layout/_footer.scss diff --git a/utils/test/reporting/assets/sass/layout/_header.scss b/utils/test/reporting/3rd_party/sass/layout/_header.scss index 70a5fbaae..70a5fbaae 100644 --- a/utils/test/reporting/assets/sass/layout/_header.scss +++ b/utils/test/reporting/3rd_party/sass/layout/_header.scss diff --git a/utils/test/reporting/assets/sass/layout/_main.scss b/utils/test/reporting/3rd_party/sass/layout/_main.scss index 8643931e4..8643931e4 100644 --- a/utils/test/reporting/assets/sass/layout/_main.scss +++ b/utils/test/reporting/3rd_party/sass/layout/_main.scss diff --git a/utils/test/reporting/assets/sass/layout/_menu.scss b/utils/test/reporting/3rd_party/sass/layout/_menu.scss index 6a1895b1f..6a1895b1f 100644 --- a/utils/test/reporting/assets/sass/layout/_menu.scss +++ b/utils/test/reporting/3rd_party/sass/layout/_menu.scss diff --git a/utils/test/reporting/assets/sass/layout/_wrapper.scss b/utils/test/reporting/3rd_party/sass/layout/_wrapper.scss index 62ee1741c..62ee1741c 100644 --- a/utils/test/reporting/assets/sass/layout/_wrapper.scss +++ b/utils/test/reporting/3rd_party/sass/layout/_wrapper.scss diff --git a/utils/test/reporting/assets/sass/libs/_functions.scss b/utils/test/reporting/3rd_party/sass/libs/_functions.scss index 0e08c1a66..0e08c1a66 100644 --- a/utils/test/reporting/assets/sass/libs/_functions.scss +++ b/utils/test/reporting/3rd_party/sass/libs/_functions.scss diff --git a/utils/test/reporting/assets/sass/libs/_mixins.scss b/utils/test/reporting/3rd_party/sass/libs/_mixins.scss index 3325df0b0..3325df0b0 100644 --- a/utils/test/reporting/assets/sass/libs/_mixins.scss +++ b/utils/test/reporting/3rd_party/sass/libs/_mixins.scss diff --git a/utils/test/reporting/assets/sass/libs/_skel.scss b/utils/test/reporting/3rd_party/sass/libs/_skel.scss index 438b14797..438b14797 100644 --- a/utils/test/reporting/assets/sass/libs/_skel.scss +++ b/utils/test/reporting/3rd_party/sass/libs/_skel.scss diff --git a/utils/test/reporting/assets/sass/libs/_vars.scss b/utils/test/reporting/3rd_party/sass/libs/_vars.scss index 9cea5e966..9cea5e966 100644 --- a/utils/test/reporting/assets/sass/libs/_vars.scss +++ b/utils/test/reporting/3rd_party/sass/libs/_vars.scss diff --git a/utils/test/reporting/assets/sass/main.scss b/utils/test/reporting/3rd_party/sass/main.scss index 0173a6579..0173a6579 100644 --- a/utils/test/reporting/assets/sass/main.scss +++ b/utils/test/reporting/3rd_party/sass/main.scss diff --git a/utils/test/reporting/docker/Dockerfile b/utils/test/reporting/docker/Dockerfile new file mode 100644 index 000000000..789df9115 --- /dev/null +++ b/utils/test/reporting/docker/Dockerfile @@ -0,0 +1,43 @@ +######################################## +# Docker container for OPNFV-REPORTING +######################################## +# Purpose: run opnfv-reporting to provide consistent Testing reporting +# +# Maintained by Morgan Richomme +# Build: +# $ docker build -t opnfv/testreporting:tag . +## +# 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 +# + +FROM nginx:stable + +MAINTAINER Morgan Richomme <morgan.richomme@orange.com> +LABEL version="danube.1.0" description="OPNFV Test Reporting Docker container" + +ARG BRANCH=master + +ENV HOME /home/opnfv +ENV working_dir /home/opnfv/utils/test/reporting +ENV TERM xterm +ENV COLORTERM gnome-terminal +ENV CONFIG_REPORTING_YAML /home/opnfv/utils/test/reporting/reporting.yaml + +# Packaged dependencies +RUN apt-get update && apt-get install -y \ +ssh \ +git-core \ +wkhtmltopdf \ +--no-install-recommends + +RUN pip install --upgrade pip + +RUN pip install -r ${working_dir}/docker/requirements.txt +RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng /home/opnfv + +WORKDIR ${working_dir} +CMD ["bash", "./docker/reporting.sh"] +CMD ["bash", "mv display /usr/share/nginx/html"] diff --git a/utils/test/reporting/docker/reporting.sh b/utils/test/reporting/docker/reporting.sh new file mode 100755 index 000000000..5d4ea11f4 --- /dev/null +++ b/utils/test/reporting/docker/reporting.sh @@ -0,0 +1,65 @@ +#!/bin/bash +cd .. + +export PYTHONPATH="${PYTHONPATH}:." +export CONFIG_REPORTING_YAML=./reporting.yaml + +declare -a versions=(colorado master) +declare -a projects=(functest yardstick) + +project=$1 +reporting_type=$2 + +# create Directories if needed +for i in "${versions[@]}" +do + for j in "${projects[@]}" + do + mkdir -p display/$i/$j + done +done + +# copy images, js, css, 3rd_party +cp -Rf 3rd_party display +cp -Rf css display +cp -Rf html/* display +cp -Rf img display +cp -Rf js display + +# if nothing is precised run all the reporting generation +# projet | option +# $1 | $2 +# functest | status, vims, tempest +# yardstick | + +if [ -z "$1" ]; then + echo "********************************" + echo " Functest reporting " + echo "********************************" + echo "reporting vIMS..." + python ./functest/reporting-vims.py + echo "reporting vIMS...OK" + sleep 10 + echo "reporting Tempest..." + python ./functest/reporting-tempest.py + echo "reporting Tempest...OK" + sleep 10 + echo "reporting status..." + python ./functest/reporting-status.py + echo "Functest reporting status...OK" + + echo "********************************" + echo " Yardstick reporting " + echo "********************************" + python ./yardstick/reporting-status.py + echo "Yardstick reporting status...OK" +else + if [ -z "$2" ]; then + reporting_type="status" + fi + echo "********************************" + echo " $project/$reporting_type reporting " + echo "********************************" + python ./$project/reporting-$reporting_type.py +fi + diff --git a/utils/test/reporting/docker/requirements.pip b/utils/test/reporting/docker/requirements.pip new file mode 100644 index 000000000..21d5ba97a --- /dev/null +++ b/utils/test/reporting/docker/requirements.pip @@ -0,0 +1,12 @@ +# +# +# author: Morgan Richomme (morgan.richomme@orange.com) +# +# 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 +# +pdfkit==0.5.0 +PyYAML==3.11 +simplejson==3.8.1 diff --git a/utils/test/reporting/functest/reporting-status.py b/utils/test/reporting/functest/reporting-status.py index 653448eaf..cb13b099c 100755 --- a/utils/test/reporting/functest/reporting-status.py +++ b/utils/test/reporting/functest/reporting-status.py @@ -8,19 +8,20 @@ # import datetime import jinja2 -import pdfkit +import os import requests import sys import time import yaml -import reportingUtils as utils -import reportingConf as conf import testCase as tc import scenarioResult as sr +# manage conf +import utils.reporting_utils as rp_utils + # Logger -logger = utils.getLogger("Status") +logger = rp_utils.getLogger("Functest-Status") # Initialization testValid = [] @@ -33,14 +34,21 @@ tempest = tc.TestCase("tempest_smoke_serial", "functest", -1) # Retrieve the Functest configuration to detect which tests are relevant # according to the installer, scenario -cf = conf.TEST_CONF +cf = rp_utils.get_config('functest.test_conf') +period = rp_utils.get_config('general.period') +versions = rp_utils.get_config('general.versions') +installers = rp_utils.get_config('general.installers') +blacklist = rp_utils.get_config('functest.blacklist') +log_level = rp_utils.get_config('general.log.log_level') response = requests.get(cf) functest_yaml_config = yaml.safe_load(response.text) logger.info("*******************************************") +logger.info("* *") logger.info("* Generating reporting scenario status *") -logger.info("* Data retention = %s days *" % conf.PERIOD) +logger.info("* Data retention: %s days *" % period) +logger.info("* Log level: %s *" % log_level) logger.info("* *") logger.info("*******************************************") @@ -55,36 +63,41 @@ config_tiers = functest_yaml_config.get("tiers") for tier in config_tiers: if tier['order'] > 0 and tier['order'] < 3: for case in tier['testcases']: - if case['name'] not in conf.blacklist: + if case['name'] not in blacklist: testValid.append(tc.TestCase(case['name'], "functest", case['dependencies'])) elif tier['order'] == 3: for case in tier['testcases']: - if case['name'] not in conf.blacklist: + if case['name'] not in blacklist: testValid.append(tc.TestCase(case['name'], case['name'], case['dependencies'])) elif tier['order'] > 3: for case in tier['testcases']: - if case['name'] not in conf.blacklist: + if case['name'] not in blacklist: otherTestCases.append(tc.TestCase(case['name'], "functest", case['dependencies'])) +logger.debug("Functest reporting start") # For all the versions -for version in conf.versions: +for version in versions: # For all the installers - for installer in conf.installers: + for installer in installers: # get scenarios - scenario_results = utils.getScenarios(tempest, installer, version) - scenario_stats = utils.getScenarioStats(scenario_results) + scenario_results = rp_utils.getScenarios(tempest, installer, version) + scenario_stats = rp_utils.getScenarioStats(scenario_results) items = {} scenario_result_criteria = {} - scenario_file_name = (conf.REPORTING_PATH + - "/functest/release/" + version + - "/scenario_history.txt") + scenario_file_name = ("./display/" + version + + "/functest/scenario_history.txt") + # initiate scenario file if it does not exist + if not os.path.isfile(scenario_file_name): + with open(scenario_file_name, "a") as my_file: + logger.debug("Create scenario file: %s" % scenario_file_name) + my_file.write("date,scenario,installer,detail,score\n") # For all the scenarios get results for s, s_result in scenario_results.items(): @@ -102,7 +115,7 @@ for version in conf.versions: if len(s_result) > 0: build_tag = s_result[len(s_result)-1]['build_tag'] logger.debug("Build tag: %s" % build_tag) - s_url = s_url = utils.getJenkinsUrl(build_tag) + s_url = s_url = rp_utils.getJenkinsUrl(build_tag) logger.info("last jenkins url: %s" % s_url) testCases2BeDisplayed = [] # Check if test case is runnable / installer, scenario @@ -126,7 +139,8 @@ for version in conf.versions: nb_test_runnable_for_this_scenario += 1 logger.info(" Searching results for case %s " % (displayName)) - result = utils.getResult(dbName, installer, s, version) + result = rp_utils.getResult(dbName, installer, + s, version) # if no result set the value to 0 if result < 0: result = 0 @@ -158,7 +172,8 @@ for version in conf.versions: project = test_case.getProject() logger.info(" Searching results for case %s " % (displayName)) - result = utils.getResult(dbName, installer, s, version) + result = rp_utils.getResult(dbName, installer, + s, version) # at least 1 result for the test if result > -1: test_case.setCriteria(result) @@ -186,11 +201,11 @@ for version in conf.versions: scenario_criteria = nb_test_runnable_for_this_scenario * 3 # if 0 runnable tests set criteria at a high value if scenario_criteria < 1: - scenario_criteria = conf.MAX_SCENARIO_CRITERIA + scenario_criteria = 50 # conf.MAX_SCENARIO_CRITERIA s_score = str(scenario_score) + "/" + str(scenario_criteria) - s_score_percent = utils.getScenarioPercent(scenario_score, - scenario_criteria) + s_score_percent = rp_utils.getScenarioPercent(scenario_score, + scenario_criteria) s_status = "KO" if scenario_score < scenario_criteria: @@ -200,9 +215,9 @@ for version in conf.versions: else: logger.info(">>>>> scenario OK, save the information") s_status = "OK" - path_validation_file = (conf.REPORTING_PATH + - "/functest/release/" + version + - "/validated_scenario_history.txt") + path_validation_file = ("./display/" + version + + "/functest/" + + "validated_scenario_history.txt") with open(path_validation_file, "a") as f: time_format = "%Y-%m-%d %H:%M" info = (datetime.datetime.now().strftime(time_format) + @@ -222,54 +237,37 @@ for version in conf.versions: s_url) logger.info("--------------------------") - templateLoader = jinja2.FileSystemLoader(conf.REPORTING_PATH) + templateLoader = jinja2.FileSystemLoader(".") templateEnv = jinja2.Environment( loader=templateLoader, autoescape=True) - TEMPLATE_FILE = "/functest/template/index-status-tmpl.html" + TEMPLATE_FILE = "./functest/template/index-status-tmpl.html" template = templateEnv.get_template(TEMPLATE_FILE) outputText = template.render(scenario_stats=scenario_stats, scenario_results=scenario_result_criteria, items=items, installer=installer, - period=conf.PERIOD, + period=period, version=version, date=reportingDate) - # 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: + with open("./display/" + version + + "/functest/status-" + installer + ".html", "wb") as fh: fh.write(outputText) - logger.info("CSV generated...") + + logger.info("Manage export CSV & PDF") + rp_utils.export_csv(scenario_file_name, installer, version) + logger.error("CSV generated...") # 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") + # TODO Change once web site updated...use the current one + # to test pdf production + url_pdf = rp_utils.get_config('general.url') + pdf_path = ("./display/" + version + + "/functest/status-" + installer + ".html") + pdf_doc_name = ("./display/" + version + + "/functest/status-" + installer + ".pdf") + rp_utils.export_pdf(pdf_path, pdf_doc_name) + logger.info("PDF generated...") diff --git a/utils/test/reporting/functest/reporting-tempest.py b/utils/test/reporting/functest/reporting-tempest.py index 363f123cf..5d6bcc062 100755 --- a/utils/test/reporting/functest/reporting-tempest.py +++ b/utils/test/reporting/functest/reporting-tempest.py @@ -1,18 +1,22 @@ from urllib2 import Request, urlopen, URLError import json import jinja2 -import reportingConf as conf -import reportingUtils as utils +import os -installers = conf.installers +# manage conf +import utils.reporting_utils as rp_utils + +installers = rp_utils.get_config('general.installers') items = ["tests", "Success rate", "duration"] -PERIOD = conf.PERIOD +CURRENT_DIR = os.getcwd() + +PERIOD = rp_utils.get_config('general.period') criteria_nb_test = 165 criteria_duration = 1800 criteria_success_rate = 90 -logger = utils.getLogger("Tempest") +logger = rp_utils.getLogger("Tempest") logger.info("************************************************") logger.info("* Generating reporting Tempest_smoke_serial *") logger.info("* Data retention = %s days *" % PERIOD) @@ -25,10 +29,11 @@ logger.info("test duration < %s s " % criteria_duration) logger.info("success rate > %s " % criteria_success_rate) # For all the versions -for version in conf.versions: - for installer in conf.installers: +for version in rp_utils.get_config('general.versions'): + for installer in installers: # we consider the Tempest results of the last PERIOD days - url = 'http://' + conf.URL_BASE + "?case=tempest_smoke_serial" + url = ("http://" + rp_utils.get_config('testapi.url') + + "?case=tempest_smoke_serial") request = Request(url + '&period=' + str(PERIOD) + '&installer=' + installer + '&version=' + version) @@ -68,8 +73,9 @@ for version in conf.versions: nb_tests_run = result['details']['tests'] nb_tests_failed = result['details']['failures'] if nb_tests_run != 0: - success_rate = 100*(int(nb_tests_run) - - int(nb_tests_failed)) / int(nb_tests_run) + success_rate = 100*((int(nb_tests_run) - + int(nb_tests_failed)) / + int(nb_tests_run)) else: success_rate = 0 @@ -115,17 +121,18 @@ for version in conf.versions: except: logger.error("Error field not present (Brahamputra runs?)") - templateLoader = jinja2.FileSystemLoader(conf.REPORTING_PATH) - templateEnv = jinja2.Environment(loader=templateLoader, autoescape=True) + templateLoader = jinja2.FileSystemLoader(".") + templateEnv = jinja2.Environment(loader=templateLoader, + autoescape=True) - TEMPLATE_FILE = "/template/index-tempest-tmpl.html" + TEMPLATE_FILE = "./functest/template/index-tempest-tmpl.html" template = templateEnv.get_template(TEMPLATE_FILE) outputText = template.render(scenario_results=scenario_results, items=items, installer=installer) - with open(conf.REPORTING_PATH + "/release/" + version + - "/index-tempest-" + installer + ".html", "wb") as fh: + with open("./display/" + version + + "/functest/tempest-" + installer + ".html", "wb") as fh: fh.write(outputText) logger.info("Tempest automatic reporting succesfully generated.") diff --git a/utils/test/reporting/functest/reporting-vims.py b/utils/test/reporting/functest/reporting-vims.py index 430a5453c..2077d2a4a 100755 --- a/utils/test/reporting/functest/reporting-vims.py +++ b/utils/test/reporting/functest/reporting-vims.py @@ -1,10 +1,11 @@ from urllib2 import Request, urlopen, URLError import json import jinja2 -import reportingConf as conf -import reportingUtils as utils -logger = utils.getLogger("vIMS") +# manage conf +import utils.reporting_utils as rp_utils + +logger = rp_utils.getLogger("vIMS") def sig_test_format(sig_test): @@ -24,22 +25,26 @@ def sig_test_format(sig_test): total_sig_test_result['skipped'] = nbSkipped return total_sig_test_result +period = rp_utils.get_config('general.period') +versions = rp_utils.get_config('general.versions') +url_base = rp_utils.get_config('testapi.url') + logger.info("****************************************") logger.info("* Generating reporting vIMS *") -logger.info("* Data retention = %s days *" % conf.PERIOD) +logger.info("* Data retention = %s days *" % period) logger.info("* *") logger.info("****************************************") -installers = conf.installers +installers = rp_utils.get_config('general.installers') step_order = ["initialisation", "orchestrator", "vIMS", "sig_test"] logger.info("Start processing....") # For all the versions -for version in conf.versions: +for version in versions: for installer in installers: logger.info("Search vIMS results for installer: %s, version: %s" % (installer, version)) - request = Request("http://" + conf.URL_BASE + '?case=vims&installer=' + + request = Request("http://" + url_base + '?case=vims&installer=' + installer + '&version=' + version) try: @@ -81,7 +86,8 @@ for version in conf.versions: if int(m) != 0: m_display += str(int(m)) + "m " - step_result['duration_display'] = m_display + str(int(s)) + "s" + step_result['duration_display'] = (m_display + + str(int(s)) + "s") result['pr_step_ok'] = 0 if nb_step != 0: @@ -89,8 +95,9 @@ for version in conf.versions: try: logger.debug("Scenario %s, Installer %s" % (s_result[1]['scenario'], installer)) + res = result['details']['orchestrator']['duration'] logger.debug("Orchestrator deployment: %s s" - % result['details']['orchestrator']['duration']) + % res) logger.debug("vIMS deployment: %s s" % result['details']['vIMS']['duration']) logger.debug("Signaling testing: %s s" @@ -101,18 +108,18 @@ for version in conf.versions: logger.error("Data badly formatted") logger.debug("----------------------------------------") - templateLoader = jinja2.FileSystemLoader(conf.REPORTING_PATH) - templateEnv = jinja2.Environment(loader=templateLoader, autoescape=True) + templateLoader = jinja2.FileSystemLoader(".") + templateEnv = jinja2.Environment(loader=templateLoader, + autoescape=True) - TEMPLATE_FILE = "/template/index-vims-tmpl.html" + TEMPLATE_FILE = "./functest/template/index-vims-tmpl.html" template = templateEnv.get_template(TEMPLATE_FILE) outputText = template.render(scenario_results=scenario_results, step_order=step_order, installer=installer) - with open(conf.REPORTING_PATH + - "/release/" + version + "/index-vims-" + + with open("./display/" + version + "/functest/vims-" + installer + ".html", "wb") as fh: fh.write(outputText) diff --git a/utils/test/reporting/functest/reportingConf.py b/utils/test/reporting/functest/reportingConf.py deleted file mode 100644 index 1c9a2ac9f..000000000 --- a/utils/test/reporting/functest/reportingConf.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/python -# -# 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 -# -# Reporting: Declaration of the variables -# -# **************************************************** -installers = ["apex", "compass", "fuel", "joid"] -# list of test cases declared in testcases.yaml but that must not be -# taken into account for the scoring -blacklist = ["ovno", "security_scan"] -versions = ["master", "colorado"] -PERIOD = 10 -MAX_SCENARIO_CRITERIA = 50 -# get the last 5 test results to determinate the success criteria -NB_TESTS = 5 -# REPORTING_PATH = "/usr/share/nginx/html/reporting/functest" -REPORTING_PATH = "." -URL_BASE = 'testresults.opnfv.org/test/api/v1/results' -TEST_CONF = "https://git.opnfv.org/cgit/functest/plain/ci/testcases.yaml" -LOG_LEVEL = "ERROR" -LOG_FILE = REPORTING_PATH + "/reporting.log" diff --git a/utils/test/reporting/functest/reportingUtils.py b/utils/test/reporting/functest/reportingUtils.py deleted file mode 100644 index 74d6f19c9..000000000 --- a/utils/test/reporting/functest/reportingUtils.py +++ /dev/null @@ -1,186 +0,0 @@ -#!/usr/bin/python -# -# 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 -# -from urllib2 import Request, urlopen, URLError -import logging -import json -import reportingConf as conf - - -def getLogger(module): - logFormatter = logging.Formatter("%(asctime)s [" + - module + - "] [%(levelname)-5.5s] %(message)s") - logger = logging.getLogger() - - fileHandler = logging.FileHandler("{0}/{1}".format('.', conf.LOG_FILE)) - fileHandler.setFormatter(logFormatter) - logger.addHandler(fileHandler) - - consoleHandler = logging.StreamHandler() - consoleHandler.setFormatter(logFormatter) - logger.addHandler(consoleHandler) - logger.setLevel(conf.LOG_LEVEL) - return logger - - -def getApiResults(case, installer, scenario, version): - results = json.dumps([]) - # to remove proxy (to be removed at the end for local test only) - # proxy_handler = urllib2.ProxyHandler({}) - # opener = urllib2.build_opener(proxy_handler) - # urllib2.install_opener(opener) - # url = "http://127.0.0.1:8000/results?case=" + case + \ - # "&period=30&installer=" + installer - url = ("http://" + conf.URL_BASE + "?case=" + case + - "&period=" + str(conf.PERIOD) + "&installer=" + installer + - "&scenario=" + scenario + "&version=" + version + - "&last=" + str(conf.NB_TESTS)) - request = Request(url) - - try: - response = urlopen(request) - k = response.read() - results = json.loads(k) - except URLError, e: - print 'No kittez. Got an error code:', e - - return results - - -def getScenarios(case, installer, version): - - case = case.getName() - url = ("http://" + conf.URL_BASE + "?case=" + case + - "&period=" + str(conf.PERIOD) + "&installer=" + installer + - "&version=" + version) - request = Request(url) - - try: - response = urlopen(request) - k = response.read() - results = json.loads(k) - test_results = results['results'] - except URLError, e: - print 'Got an error code:', e - - if test_results is not None: - test_results.reverse() - - scenario_results = {} - - for r in test_results: - # Retrieve all the scenarios per installer - if not r['scenario'] in scenario_results.keys(): - scenario_results[r['scenario']] = [] - scenario_results[r['scenario']].append(r) - - return scenario_results - - -def getScenarioStats(scenario_results): - scenario_stats = {} - for k, v in scenario_results.iteritems(): - scenario_stats[k] = len(v) - - return scenario_stats - - -def getNbtestOk(results): - nb_test_ok = 0 - for r in results: - for k, v in r.iteritems(): - try: - if "PASS" in v: - nb_test_ok += 1 - except: - print "Cannot retrieve test status" - return nb_test_ok - - -def getResult(testCase, installer, scenario, version): - - # retrieve raw results - results = getApiResults(testCase, installer, scenario, version) - # let's concentrate on test results only - test_results = results['results'] - - # if results found, analyze them - if test_results is not None: - test_results.reverse() - - scenario_results = [] - - # print " ---------------- " - # print test_results - # print " ---------------- " - # print "nb of results:" + str(len(test_results)) - - for r in test_results: - # print r["start_date"] - # print r["criteria"] - scenario_results.append({r["start_date"]: r["criteria"]}) - # sort results - scenario_results.sort() - # 4 levels for the results - # 3: 4+ consecutive runs passing the success criteria - # 2: <4 successful consecutive runs but passing the criteria - # 1: close to pass the success criteria - # 0: 0% success, not passing - # -1: no run available - test_result_indicator = 0 - nbTestOk = getNbtestOk(scenario_results) - - # print "Nb test OK (last 10 days):"+ str(nbTestOk) - # check that we have at least 4 runs - if len(scenario_results) < 1: - # No results available - test_result_indicator = -1 - elif nbTestOk < 1: - test_result_indicator = 0 - elif nbTestOk < 2: - test_result_indicator = 1 - else: - # Test the last 4 run - if (len(scenario_results) > 3): - last4runResults = scenario_results[-4:] - nbTestOkLast4 = getNbtestOk(last4runResults) - # print "Nb test OK (last 4 run):"+ str(nbTestOkLast4) - if nbTestOkLast4 > 3: - test_result_indicator = 3 - else: - test_result_indicator = 2 - else: - test_result_indicator = 2 - return test_result_indicator - - -def getJenkinsUrl(build_tag): - # e.g. jenkins-functest-apex-apex-daily-colorado-daily-colorado-246 - # id = 246 - # note it is linked to jenkins format - # if this format changes...function to be adapted.... - url_base = "https://build.opnfv.org/ci/view/functest/job/" - jenkins_url = "" - try: - build_id = [int(s) for s in build_tag.split("-") if s.isdigit()] - jenkins_path = filter(lambda c: not c.isdigit(), build_tag) - url_id = jenkins_path[8:-1] + "/" + str(build_id[0]) - jenkins_url = url_base + url_id + "/console" - except: - 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 diff --git a/utils/test/reporting/functest/template/index-status-tmpl.html b/utils/test/reporting/functest/template/index-status-tmpl.html index e3c9c5fc0..094bbf8a2 100644 --- a/utils/test/reporting/functest/template/index-status-tmpl.html +++ b/utils/test/reporting/functest/template/index-status-tmpl.html @@ -3,12 +3,12 @@ <meta charset="utf-8"> <!-- Bootstrap core CSS --> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"> - <link href="../../../css/default.css" rel="stylesheet"> + <link href="../../css/default.css" rel="stylesheet"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> <script type="text/javascript" src="http://d3js.org/d3.v2.min.js"></script> - <script type="text/javascript" src="../../../js/gauge.js"></script> - <script type="text/javascript" src="../../../js/trend.js"></script> + <script type="text/javascript" src="../../js/gauge.js"></script> + <script type="text/javascript" src="../../js/trend.js"></script> <script> function onDocumentReady() { // Gauge management @@ -26,7 +26,7 @@ } // trend line management - d3.csv("./scenario_history.txt", function(data) { + d3.csv("./scenario_history.csv", function(data) { // *************************************** // Create the trend line {% for scenario,iteration in scenario_stats.iteritems() -%} @@ -69,11 +69,11 @@ $(document).ready(function (){ <h3 class="text-muted">Functest status page ({{version}}, {{date}})</h3> <nav> <ul class="nav nav-justified"> - <li class="active"><a href="http://testresults.opnfv.org/reporting/index.html">Home</a></li> - <li><a href="index-status-apex.html">Apex</a></li> - <li><a href="index-status-compass.html">Compass</a></li> - <li><a href="index-status-fuel.html">Fuel</a></li> - <li><a href="index-status-joid.html">Joid</a></li> + <li class="active"><a href="../../index.html">Home</a></li> + <li><a href="status-apex.html">Apex</a></li> + <li><a href="status-compass.html">Compass</a></li> + <li><a href="status-fuel.html">Fuel</a></li> + <li><a href="status-joid.html">Joid</a></li> </ul> </nav> </div> @@ -133,13 +133,13 @@ $(document).ready(function (){ <tr class="tr-weather-weather"> {% for test in items[scenario] -%} {% if test.getCriteria() > 2 -%} - <td><img src="../../img/weather-clear.png"></td> + <td><img src="../../../img/weather-clear.png"></td> {%- elif test.getCriteria() > 1 -%} - <td><img src="../../img/weather-few-clouds.png"></td> + <td><img src="../../../img/weather-few-clouds.png"></td> {%- elif test.getCriteria() > 0 -%} - <td><img src="../../img/weather-overcast.png"></td> + <td><img src="../../../img/weather-overcast.png"></td> {%- elif test.getCriteria() > -1 -%} - <td><img src="../../img/weather-storm.png"></td> + <td><img src="../../../img/weather-storm.png"></td> {%- endif %} {%- endfor %} </tr> diff --git a/utils/test/reporting/functest/template/index-tempest-tmpl.html b/utils/test/reporting/functest/template/index-tempest-tmpl.html index 42d7ed339..db483070f 100644 --- a/utils/test/reporting/functest/template/index-tempest-tmpl.html +++ b/utils/test/reporting/functest/template/index-tempest-tmpl.html @@ -3,7 +3,7 @@ <meta charset="utf-8"> <!-- Bootstrap core CSS --> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"> - <link href="default.css" rel="stylesheet"> + <link href="../../css/default.css" rel="stylesheet"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> <script type="text/javascript"> @@ -21,11 +21,11 @@ <h3 class="text-muted">Tempest status page</h3> <nav> <ul class="nav nav-justified"> - <li class="active"><a href="http://testresults.opnfv.org/reporting/index.html">Home</a></li> - <li><a href="index-tempest-apex.html">Apex</a></li> - <li><a href="index-tempest-compass.html">Compass</a></li> - <li><a href="index-tempest-fuel.html">Fuel</a></li> - <li><a href="index-tempest-joid.html">Joid</a></li> + <li class="active"><a href="../../index.html">Home</a></li> + <li><a href="tempest-apex.html">Apex</a></li> + <li><a href="tempest-compass.html">Compass</a></li> + <li><a href="tempest-fuel.html">Fuel</a></li> + <li><a href="tempest-joid.html">Joid</a></li> </ul> </nav> </div> diff --git a/utils/test/reporting/functest/template/index-vims-tmpl.html b/utils/test/reporting/functest/template/index-vims-tmpl.html index 3836be91f..033c8ab33 100644 --- a/utils/test/reporting/functest/template/index-vims-tmpl.html +++ b/utils/test/reporting/functest/template/index-vims-tmpl.html @@ -3,7 +3,7 @@ <meta charset="utf-8"> <!-- Bootstrap core CSS --> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"> - <link href="default.css" rel="stylesheet"> + <link href="../../css/default.css" rel="stylesheet"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> <script type="text/javascript"> @@ -21,11 +21,11 @@ <h3 class="text-muted">vIMS status page</h3> <nav> <ul class="nav nav-justified"> - <li class="active"><a href="http://testresults.opnfv.org/reporting/index.html">Home</a></li> - <li><a href="index-vims-fuel.html">Fuel</a></li> - <li><a href="index-vims-compass.html">Compass</a></li> - <li><a href="index-vims-joid.html">JOID</a></li> - <li><a href="index-vims-apex.html">APEX</a></li> + <li class="active"><a href="../../index.html">Home</a></li> + <li><a href="vims-fuel.html">Fuel</a></li> + <li><a href="vims-compass.html">Compass</a></li> + <li><a href="vims-joid.html">JOID</a></li> + <li><a href="vims-apex.html">APEX</a></li> </ul> </nav> </div> diff --git a/utils/test/reporting/functest/testCase.py b/utils/test/reporting/functest/testCase.py index a906f0da8..876beb267 100644 --- a/utils/test/reporting/functest/testCase.py +++ b/utils/test/reporting/functest/testCase.py @@ -40,7 +40,7 @@ class TestCase(object): 'domino': 'domino', 'odl-sfc': 'SFC', 'onos_sfc': 'SFC', - 'parser':'parser' + 'parser': 'parser' } try: self.displayName = display_name_matrix[self.name] @@ -131,9 +131,9 @@ class TestCase(object): 'security_scan': 'security', 'multisite': 'multisite', 'domino': 'domino-multinode', - 'odl-sfc': 'odl-sfc', + 'odl-sfc': 'functest-odl-sfc', 'onos_sfc': 'onos_sfc', - 'parser':'parser-basics' + 'parser': 'parser-basics' } try: return test_match_matrix[self.name] diff --git a/utils/test/reporting/colorado.html b/utils/test/reporting/html/colorado.html index 6d669396e..ad1cdd456 100644 --- a/utils/test/reporting/colorado.html +++ b/utils/test/reporting/html/colorado.html @@ -9,10 +9,10 @@ <title>Phantom by HTML5 UP</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
- <link rel="stylesheet" href="assets/css/main.css" />
- <!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
- <!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
+ <!--[if lte IE 8]><script src="3rd_party/js/ie/html5shiv.js"></script><![endif]-->
+ <link rel="stylesheet" href="3rd_party/css/main.css" />
+ <!--[if lte IE 9]><link rel="stylesheet" href="3rd_party/css/ie9.css" /><![endif]-->
+ <!--[if lte IE 8]><link rel="stylesheet" href="3rd_party/css/ie8.css" /><![endif]-->
</head>
<body>
<!-- Wrapper -->
@@ -24,7 +24,7 @@ <!-- Logo -->
<a href="index.html" class="logo">
- <span class="symbol"><img src="images/logo.svg" alt="" /></span><span class="title">Phantom</span>
+ <span class="symbol"><img src="img/logo.svg" alt="" /></span><span class="title">Phantom</span>
</a>
<!-- Nav -->
@@ -56,7 +56,7 @@ <section class="tiles">
<article class="style3">
<span class="image">
- <img src="images/functest.jpg" alt="" />
+ <img src="img/functest.jpg" alt="" />
</span>
<a href="functest-colorado.html">
<h2>Functest</h2>
@@ -67,9 +67,9 @@ </article>
<article class="style2">
<span class="image">
- <img src="images/yardstick.jpg" alt="" />
+ <img src="img/yardstick.jpg" alt="" />
</span>
- <a href="http://testresults.opnfv.org/reporting/yardstick/release/colorado/index-status-apex.html">
+ <a href="colorado/yardstick/status-apex.html">
<h2>Yardstick</h2>
<div class="content">
<p>Qualification and performance testing</p>
@@ -103,11 +103,11 @@ </div>
<!-- Scripts -->
- <script src="assets/js/jquery.min.js"></script>
- <script src="assets/js/skel.min.js"></script>
- <script src="assets/js/util.js"></script>
- <!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
- <script src="assets/js/main.js"></script>
+ <script src="3rd_party/js/jquery.min.js"></script>
+ <script src="3rd_party/js/skel.min.js"></script>
+ <script src="3rd_party/js/util.js"></script>
+ <!--[if lte IE 8]><script src="3rd_party/js/ie/respond.min.js"></script><![endif]-->
+ <script src="3rd_party/js/main.js"></script>
</body>
</html>
diff --git a/utils/test/reporting/danube.html b/utils/test/reporting/html/danube.html index 70cd85711..58d6bc0fe 100644 --- a/utils/test/reporting/danube.html +++ b/utils/test/reporting/html/danube.html @@ -9,10 +9,10 @@ <title>Phantom by HTML5 UP</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
- <link rel="stylesheet" href="assets/css/main.css" />
- <!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
- <!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
+ <!--[if lte IE 8]><script src="3rd_party/js/ie/html5shiv.js"></script><![endif]-->
+ <link rel="stylesheet" href="3rd_party/css/main.css" />
+ <!--[if lte IE 9]><link rel="stylesheet" href="3rd_party/css/ie9.css" /><![endif]-->
+ <!--[if lte IE 8]><link rel="stylesheet" href="3rd_party/css/ie8.css" /><![endif]-->
</head>
<body>
<!-- Wrapper -->
@@ -24,7 +24,7 @@ <!-- Logo -->
<a href="index.html" class="logo">
- <span class="symbol"><img src="images/logo.svg" alt="" /></span><span class="title">Phantom</span>
+ <span class="symbol"><img src="img/logo.svg" alt="" /></span><span class="title">Phantom</span>
</a>
<!-- Nav -->
@@ -56,7 +56,7 @@ <section class="tiles">
<article class="style3">
<span class="image">
- <img src="images/functest.jpg" alt="" />
+ <img src="img/functest.jpg" alt="" />
</span>
<a href="functest-master.html">
<h2>Functest</h2>
@@ -67,9 +67,9 @@ </article>
<article class="style2">
<span class="image">
- <img src="images/yardstick.jpg" alt="" />
+ <img src="img/yardstick.jpg" alt="" />
</span>
- <a href="http://testresults.opnfv.org/reporting/yardstick/release/master/index-status-apex.html">
+ <a href="master/yardstick/status-apex.html">
<h2>Yardstick</h2>
<div class="content">
<p>Qualification and performance testing</p>
@@ -103,11 +103,11 @@ </div>
<!-- Scripts -->
- <script src="assets/js/jquery.min.js"></script>
- <script src="assets/js/skel.min.js"></script>
- <script src="assets/js/util.js"></script>
- <!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
- <script src="assets/js/main.js"></script>
+ <script src="3rd_party/js/jquery.min.js"></script>
+ <script src="3rd_party/js/skel.min.js"></script>
+ <script src="3rd_party/js/util.js"></script>
+ <!--[if lte IE 8]><script src="3rd_party/js/ie/respond.min.js"></script><![endif]-->
+ <script src="3rd_party/js/main.js"></script>
</body>
</html>
diff --git a/utils/test/reporting/elements.html b/utils/test/reporting/html/elements.html index 3bfbfc115..7b9bb4d25 100644 --- a/utils/test/reporting/elements.html +++ b/utils/test/reporting/html/elements.html @@ -9,10 +9,10 @@ <title>Elements - Phantom by HTML5 UP</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
- <link rel="stylesheet" href="assets/css/main.css" />
- <!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
- <!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
+ <!--[if lte IE 8]><script src="3rd_party/js/ie/html5shiv.js"></script><![endif]-->
+ <link rel="stylesheet" href="3rd_party/css/main.css" />
+ <!--[if lte IE 9]><link rel="stylesheet" href="3rd_party/css/ie9.css" /><![endif]-->
+ <!--[if lte IE 8]><link rel="stylesheet" href="3rd_party/css/ie8.css" /><![endif]-->
</head>
<body>
<!-- Wrapper -->
@@ -24,7 +24,7 @@ <!-- Logo -->
<a href="index.html" class="logo">
- <span class="symbol"><img src="images/logo.svg" alt="" /></span><span class="title">Phantom</span>
+ <span class="symbol"><img src="img/logo.svg" alt="" /></span><span class="title">Phantom</span>
</a>
<!-- Nav -->
@@ -347,21 +347,21 @@ print 'It took ' + i + ' iterations to sort the deck.';</code></pre> <h3>Fit</h3>
<div class="box alt">
<div class="row uniform">
- <div class="12u$"><span class="image fit"><img src="images/pic13.jpg" alt="" /></span></div>
- <div class="4u"><span class="image fit"><img src="images/pic01.jpg" alt="" /></span></div>
- <div class="4u"><span class="image fit"><img src="images/pic02.jpg" alt="" /></span></div>
- <div class="4u$"><span class="image fit"><img src="images/pic03.jpg" alt="" /></span></div>
- <div class="4u"><span class="image fit"><img src="images/pic03.jpg" alt="" /></span></div>
- <div class="4u"><span class="image fit"><img src="images/pic01.jpg" alt="" /></span></div>
- <div class="4u$"><span class="image fit"><img src="images/pic02.jpg" alt="" /></span></div>
- <div class="4u"><span class="image fit"><img src="images/pic02.jpg" alt="" /></span></div>
- <div class="4u"><span class="image fit"><img src="images/pic03.jpg" alt="" /></span></div>
- <div class="4u$"><span class="image fit"><img src="images/pic01.jpg" alt="" /></span></div>
+ <div class="12u$"><span class="image fit"><img src="img/pic13.jpg" alt="" /></span></div>
+ <div class="4u"><span class="image fit"><img src="img/pic01.jpg" alt="" /></span></div>
+ <div class="4u"><span class="image fit"><img src="img/pic02.jpg" alt="" /></span></div>
+ <div class="4u$"><span class="image fit"><img src="img/pic03.jpg" alt="" /></span></div>
+ <div class="4u"><span class="image fit"><img src="img/pic03.jpg" alt="" /></span></div>
+ <div class="4u"><span class="image fit"><img src="img/pic01.jpg" alt="" /></span></div>
+ <div class="4u$"><span class="image fit"><img src="img/pic02.jpg" alt="" /></span></div>
+ <div class="4u"><span class="image fit"><img src="img/pic02.jpg" alt="" /></span></div>
+ <div class="4u"><span class="image fit"><img src="img/pic03.jpg" alt="" /></span></div>
+ <div class="4u$"><span class="image fit"><img src="img/pic01.jpg" alt="" /></span></div>
</div>
</div>
<h3>Left & Right</h3>
- <p><span class="image left"><img src="images/pic14.jpg" alt="" /></span>Fringilla nisl. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent.</p>
- <p><span class="image right"><img src="images/pic15.jpg" alt="" /></span>Fringilla nisl. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent.</p>
+ <p><span class="image left"><img src="img/pic14.jpg" alt="" /></span>Fringilla nisl. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent.</p>
+ <p><span class="image right"><img src="img/pic15.jpg" alt="" /></span>Fringilla nisl. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent.</p>
</section>
</div>
@@ -409,11 +409,11 @@ print 'It took ' + i + ' iterations to sort the deck.';</code></pre> </div>
<!-- Scripts -->
- <script src="assets/js/jquery.min.js"></script>
- <script src="assets/js/skel.min.js"></script>
- <script src="assets/js/util.js"></script>
- <!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
- <script src="assets/js/main.js"></script>
+ <script src="3rd_party/js/jquery.min.js"></script>
+ <script src="3rd_party/js/skel.min.js"></script>
+ <script src="3rd_party/js/util.js"></script>
+ <!--[if lte IE 8]><script src="3rd_party/js/ie/respond.min.js"></script><![endif]-->
+ <script src="3rd_party/js/main.js"></script>
</body>
-</html>
\ No newline at end of file +</html>
diff --git a/utils/test/reporting/functest-colorado.html b/utils/test/reporting/html/functest-colorado.html index 8e474008b..2fc76d1c5 100644 --- a/utils/test/reporting/functest-colorado.html +++ b/utils/test/reporting/html/functest-colorado.html @@ -9,10 +9,10 @@ <title>Phantom by HTML5 UP</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
- <link rel="stylesheet" href="assets/css/main.css" />
- <!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
- <!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
+ <!--[if lte IE 8]><script src="3rd_party/js/ie/html5shiv.js"></script><![endif]-->
+ <link rel="stylesheet" href="3rd_party/css/main.css" />
+ <!--[if lte IE 9]><link rel="stylesheet" href="3rd_party/css/ie9.css" /><![endif]-->
+ <!--[if lte IE 8]><link rel="stylesheet" href="3rd_party/css/ie8.css" /><![endif]-->
</head>
<body>
<!-- Wrapper -->
@@ -24,7 +24,7 @@ <!-- Logo -->
<a href="index.html" class="logo">
- <span class="symbol"><img src="images/logo.svg" alt="" /></span><span class="title">Phantom</span>
+ <span class="symbol"><img src="img/logo.svg" alt="" /></span><span class="title">Phantom</span>
</a>
<!-- Nav -->
@@ -56,9 +56,9 @@ <section class="tiles">
<article class="style5">
<span class="image">
- <img src="images/pic05.jpg" alt="" />
+ <img src="img/pic05.jpg" alt="" />
</span>
- <a href="http://testresults.opnfv.org/reporting/functest/release/colorado/index-status-apex.html">
+ <a href="colorado/functest/status-apex.html">
<h2>Status</h2>
<div class="content">
<p>Scenario status</p>
@@ -67,9 +67,9 @@ </article>
<article class="style2">
<span class="image">
- <img src="images/pic02.jpg" alt="" />
+ <img src="img/pic02.jpg" alt="" />
</span>
- <a href="http://testresults.opnfv.org/reporting/functest/release/colorado/index-vims-apex.html">
+ <a href="colorado/functest/vims-apex.html">
<h2>vIMS</h2>
<div class="content">
<p>Virtual IMS</p>
@@ -78,9 +78,9 @@ </article>
<article class="style3">
<span class="image">
- <img src="images/pic03.jpg" alt="" />
+ <img src="img/pic03.jpg" alt="" />
</span>
- <a href="http://testresults.opnfv.org/reporting/functest/release/colorado/index-tempest-apex.html">
+ <a href="colorado/functest/tempest-apex.html">
<h2>Tempest</h2>
<div class="content">
<p>Tempest OpenStack suite</p>
@@ -114,11 +114,11 @@ </div>
<!-- Scripts -->
- <script src="assets/js/jquery.min.js"></script>
- <script src="assets/js/skel.min.js"></script>
- <script src="assets/js/util.js"></script>
- <!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
- <script src="assets/js/main.js"></script>
+ <script src="3rd_party/js/jquery.min.js"></script>
+ <script src="3rd_party/js/skel.min.js"></script>
+ <script src="3rd_party/js/util.js"></script>
+ <!--[if lte IE 8]><script src="3rd_party/js/ie/respond.min.js"></script><![endif]-->
+ <script src="3rd_party/js/main.js"></script>
</body>
</html>
diff --git a/utils/test/reporting/functest-master.html b/utils/test/reporting/html/functest-master.html index 125b8c3cb..03217a6bd 100644 --- a/utils/test/reporting/functest-master.html +++ b/utils/test/reporting/html/functest-master.html @@ -9,10 +9,10 @@ <title>Phantom by HTML5 UP</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
- <link rel="stylesheet" href="assets/css/main.css" />
- <!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
- <!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
+ <!--[if lte IE 8]><script src="3rd_party/js/ie/html5shiv.js"></script><![endif]-->
+ <link rel="stylesheet" href="3rd_party/css/main.css" />
+ <!--[if lte IE 9]><link rel="stylesheet" href="3rd_party/css/ie9.css" /><![endif]-->
+ <!--[if lte IE 8]><link rel="stylesheet" href="3rd_party/css/ie8.css" /><![endif]-->
</head>
<body>
<!-- Wrapper -->
@@ -24,7 +24,7 @@ <!-- Logo -->
<a href="index.html" class="logo">
- <span class="symbol"><img src="images/logo.svg" alt="" /></span><span class="title">Phantom</span>
+ <span class="symbol"><img src="img/logo.svg" alt="" /></span><span class="title">Phantom</span>
</a>
<!-- Nav -->
@@ -56,9 +56,9 @@ <section class="tiles">
<article class="style5">
<span class="image">
- <img src="images/pic05.jpg" alt="" />
+ <img src="img/pic05.jpg" alt="" />
</span>
- <a href="http://testresults.opnfv.org/reporting/functest/release/master/index-status-apex.html">
+ <a href="master/status-apex.html">
<h2>Status</h2>
<div class="content">
<p>Scenario status</p>
@@ -67,9 +67,9 @@ </article>
<article class="style2">
<span class="image">
- <img src="images/pic02.jpg" alt="" />
+ <img src="img/pic02.jpg" alt="" />
</span>
- <a href="http://testresults.opnfv.org/reporting/functest/release/master/index-vims-apex.html">
+ <a href="master/vims-apex.html">
<h2>vIMS</h2>
<div class="content">
<p>Virtual IMS</p>
@@ -78,9 +78,9 @@ </article>
<article class="style3">
<span class="image">
- <img src="images/pic03.jpg" alt="" />
+ <img src="img/pic03.jpg" alt="" />
</span>
- <a href="http://testresults.opnfv.org/reporting/functest/release/master/index-tempest-apex.html">
+ <a href="master/tempest-apex.html">
<h2>Tempest</h2>
<div class="content">
<p>Tempest OpenStack suite</p>
@@ -114,11 +114,11 @@ </div>
<!-- Scripts -->
- <script src="assets/js/jquery.min.js"></script>
- <script src="assets/js/skel.min.js"></script>
- <script src="assets/js/util.js"></script>
- <!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
- <script src="assets/js/main.js"></script>
+ <script src="3rd_party/js/jquery.min.js"></script>
+ <script src="3rd_party/js/skel.min.js"></script>
+ <script src="3rd_party/js/util.js"></script>
+ <!--[if lte IE 8]><script src="3rd_party/js/ie/respond.min.js"></script><![endif]-->
+ <script src="3rd_party/js/main.js"></script>
</body>
</html>
diff --git a/utils/test/reporting/generic.html b/utils/test/reporting/html/generic.html index 1351b2a85..39273da80 100644 --- a/utils/test/reporting/generic.html +++ b/utils/test/reporting/html/generic.html @@ -9,10 +9,10 @@ <title>Generic - Phantom by HTML5 UP</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
- <link rel="stylesheet" href="assets/css/main.css" />
- <!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
- <!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
+ <!--[if lte IE 8]><script src="3rd_party/js/ie/html5shiv.js"></script><![endif]-->
+ <link rel="stylesheet" href="3rd_party/css/main.css" />
+ <!--[if lte IE 9]><link rel="stylesheet" href="3rd_party/css/ie9.css" /><![endif]-->
+ <!--[if lte IE 8]><link rel="stylesheet" href="3rd_party/css/ie8.css" /><![endif]-->
</head>
<body>
<!-- Wrapper -->
@@ -24,7 +24,7 @@ <!-- Logo -->
<a href="index.html" class="logo">
- <span class="symbol"><img src="images/logo.svg" alt="" /></span><span class="title">Phantom</span>
+ <span class="symbol"><img src="img/logo.svg" alt="" /></span><span class="title">Phantom</span>
</a>
<!-- Nav -->
@@ -53,7 +53,7 @@ <div id="main">
<div class="inner">
<h1>Generic Page</h1>
- <span class="image main"><img src="images/pic13.jpg" alt="" /></span>
+ <span class="image main"><img src="img/pic13.jpg" alt="" /></span>
<p>Donec eget ex magna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis. Praesent rutrum sem diam, vitae egestas enim auctor sit amet. Pellentesque leo mauris, consectetur id ipsum sit amet, fergiat. Pellentesque in mi eu massa lacinia malesuada et a elit. Donec urna ex, lacinia in purus ac, pretium pulvinar mauris. Curabitur sapien risus, commodo eget turpis at, elementum convallis elit. Pellentesque enim turpis, hendrerit tristique.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis dapibus rutrum facilisis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Etiam tristique libero eu nibh porttitor fermentum. Nullam venenatis erat id vehicula viverra. Nunc ultrices eros ut ultricies condimentum. Mauris risus lacus, blandit sit amet venenatis non, bibendum vitae dolor. Nunc lorem mauris, fringilla in aliquam at, euismod in lectus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In non lorem sit amet elit placerat maximus. Pellentesque aliquam maximus risus, vel venenatis mauris vehicula hendrerit.</p>
<p>Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis. Praesent rutrum sem diam, vitae egestas enim auctor sit amet. Pellentesque leo mauris, consectetur id ipsum sit amet, fersapien risus, commodo eget turpis at, elementum convallis elit. Pellentesque enim turpis, hendrerit tristique lorem ipsum dolor.</p>
@@ -102,11 +102,11 @@ </div>
<!-- Scripts -->
- <script src="assets/js/jquery.min.js"></script>
- <script src="assets/js/skel.min.js"></script>
- <script src="assets/js/util.js"></script>
- <!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
- <script src="assets/js/main.js"></script>
+ <script src="3rd_party/js/jquery.min.js"></script>
+ <script src="3rd_party/js/skel.min.js"></script>
+ <script src="3rd_party/js/util.js"></script>
+ <!--[if lte IE 8]><script src="3rd_party/js/ie/respond.min.js"></script><![endif]-->
+ <script src="3rd_party/js/main.js"></script>
</body>
-</html>
\ No newline at end of file +</html>
diff --git a/utils/test/reporting/index.html b/utils/test/reporting/html/index.html index 1fad2e3f8..b2b8b46f8 100644 --- a/utils/test/reporting/index.html +++ b/utils/test/reporting/html/index.html @@ -9,10 +9,10 @@ <title>OPNFV reporting</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
- <link rel="stylesheet" href="assets/css/main.css" />
- <!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
- <!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
+ <!--[if lte IE 8]><script src="3rd_party/js/ie/html5shiv.js"></script><![endif]-->
+ <link rel="stylesheet" href="3rd_party/css/main.css" />
+ <!--[if lte IE 9]><link rel="stylesheet" href="3rd_party/css/ie9.css" /><![endif]-->
+ <!--[if lte IE 8]><link rel="stylesheet" href="3rd_party/css/ie8.css" /><![endif]-->
</head>
<body>
<!-- Wrapper -->
@@ -24,7 +24,7 @@ <!-- Logo -->
<a href="index.html" class="logo">
- <span class="symbol"><img src="images/logo.svg" alt="" /></span><span class="title">Phantom</span>
+ <span class="symbol"><img src="img/logo.svg" alt="" /></span><span class="title">Phantom</span>
</a>
<!-- Nav -->
@@ -56,7 +56,7 @@ <section class="tiles">
<article class="style3">
<span class="image">
- <img src="images/colorado.jpg" alt="" />
+ <img src="img/colorado.jpg" alt="" />
</span>
<a href="colorado.html">
<h2>Colorado</h2>
@@ -67,7 +67,7 @@ </article>
<article class="style2">
<span class="image">
- <img src="images/danube.jpg" alt="" />
+ <img src="img/danube.jpg" alt="" />
</span>
<a href="danube.html">
<h2>Danube</h2>
@@ -103,11 +103,11 @@ </div>
<!-- Scripts -->
- <script src="assets/js/jquery.min.js"></script>
- <script src="assets/js/skel.min.js"></script>
- <script src="assets/js/util.js"></script>
- <!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
- <script src="assets/js/main.js"></script>
+ <script src="3rd_party/js/jquery.min.js"></script>
+ <script src="3rd_party/js/skel.min.js"></script>
+ <script src="3rd_party/js/util.js"></script>
+ <!--[if lte IE 8]><script src="3rd_party/js/ie/respond.min.js"></script><![endif]-->
+ <script src="3rd_party/js/main.js"></script>
</body>
</html>
diff --git a/utils/test/reporting/images/colorado.jpg b/utils/test/reporting/img/colorado.jpg Binary files differindex c88886e77..c88886e77 100644 --- a/utils/test/reporting/images/colorado.jpg +++ b/utils/test/reporting/img/colorado.jpg diff --git a/utils/test/reporting/images/danube.jpg b/utils/test/reporting/img/danube.jpg Binary files differindex a5778356f..a5778356f 100644 --- a/utils/test/reporting/images/danube.jpg +++ b/utils/test/reporting/img/danube.jpg diff --git a/utils/test/reporting/images/functest.jpg b/utils/test/reporting/img/functest.jpg Binary files differindex 3a10da388..3a10da388 100644 --- a/utils/test/reporting/images/functest.jpg +++ b/utils/test/reporting/img/functest.jpg diff --git a/utils/test/reporting/images/functest.jpg.old b/utils/test/reporting/img/functest.jpg.old Binary files differindex 3a10da388..3a10da388 100644 --- a/utils/test/reporting/images/functest.jpg.old +++ b/utils/test/reporting/img/functest.jpg.old diff --git a/utils/test/reporting/img/gauge_0.png b/utils/test/reporting/img/gauge_0.png Binary files differnew file mode 100644 index 000000000..ecefc0e66 --- /dev/null +++ b/utils/test/reporting/img/gauge_0.png diff --git a/utils/test/reporting/img/gauge_100.png b/utils/test/reporting/img/gauge_100.png Binary files differnew file mode 100644 index 000000000..e199e1561 --- /dev/null +++ b/utils/test/reporting/img/gauge_100.png diff --git a/utils/test/reporting/img/gauge_16.7.png b/utils/test/reporting/img/gauge_16.7.png Binary files differnew file mode 100644 index 000000000..3e3993c3b --- /dev/null +++ b/utils/test/reporting/img/gauge_16.7.png diff --git a/utils/test/reporting/img/gauge_25.png b/utils/test/reporting/img/gauge_25.png Binary files differnew file mode 100644 index 000000000..4923659b9 --- /dev/null +++ b/utils/test/reporting/img/gauge_25.png diff --git a/utils/test/reporting/img/gauge_33.3.png b/utils/test/reporting/img/gauge_33.3.png Binary files differnew file mode 100644 index 000000000..364574b4a --- /dev/null +++ b/utils/test/reporting/img/gauge_33.3.png diff --git a/utils/test/reporting/img/gauge_41.7.png b/utils/test/reporting/img/gauge_41.7.png Binary files differnew file mode 100644 index 000000000..8c3e910fa --- /dev/null +++ b/utils/test/reporting/img/gauge_41.7.png diff --git a/utils/test/reporting/img/gauge_50.png b/utils/test/reporting/img/gauge_50.png Binary files differnew file mode 100644 index 000000000..2874b9fcf --- /dev/null +++ b/utils/test/reporting/img/gauge_50.png diff --git a/utils/test/reporting/img/gauge_58.3.png b/utils/test/reporting/img/gauge_58.3.png Binary files differnew file mode 100644 index 000000000..beedc8aa9 --- /dev/null +++ b/utils/test/reporting/img/gauge_58.3.png diff --git a/utils/test/reporting/img/gauge_66.7.png b/utils/test/reporting/img/gauge_66.7.png Binary files differnew file mode 100644 index 000000000..93f44d133 --- /dev/null +++ b/utils/test/reporting/img/gauge_66.7.png diff --git a/utils/test/reporting/img/gauge_75.png b/utils/test/reporting/img/gauge_75.png Binary files differnew file mode 100644 index 000000000..9fc261ff8 --- /dev/null +++ b/utils/test/reporting/img/gauge_75.png diff --git a/utils/test/reporting/img/gauge_8.3.png b/utils/test/reporting/img/gauge_8.3.png Binary files differnew file mode 100644 index 000000000..59f86571e --- /dev/null +++ b/utils/test/reporting/img/gauge_8.3.png diff --git a/utils/test/reporting/img/gauge_83.3.png b/utils/test/reporting/img/gauge_83.3.png Binary files differnew file mode 100644 index 000000000..27ae4ec54 --- /dev/null +++ b/utils/test/reporting/img/gauge_83.3.png diff --git a/utils/test/reporting/img/gauge_91.7.png b/utils/test/reporting/img/gauge_91.7.png Binary files differnew file mode 100644 index 000000000..280865714 --- /dev/null +++ b/utils/test/reporting/img/gauge_91.7.png diff --git a/utils/test/reporting/img/icon-nok.png b/utils/test/reporting/img/icon-nok.png Binary files differnew file mode 100644 index 000000000..526b5294b --- /dev/null +++ b/utils/test/reporting/img/icon-nok.png diff --git a/utils/test/reporting/img/icon-ok.png b/utils/test/reporting/img/icon-ok.png Binary files differnew file mode 100644 index 000000000..3a9de2e89 --- /dev/null +++ b/utils/test/reporting/img/icon-ok.png diff --git a/utils/test/reporting/images/logo.svg b/utils/test/reporting/img/logo.svg index c8ece25f1..c8ece25f1 100644 --- a/utils/test/reporting/images/logo.svg +++ b/utils/test/reporting/img/logo.svg diff --git a/utils/test/reporting/images/pic01.jpg b/utils/test/reporting/img/pic01.jpg Binary files differindex 642a6b2c7..642a6b2c7 100644 --- a/utils/test/reporting/images/pic01.jpg +++ b/utils/test/reporting/img/pic01.jpg diff --git a/utils/test/reporting/images/pic02.jpg b/utils/test/reporting/img/pic02.jpg Binary files differindex 5bddb6de1..5bddb6de1 100644 --- a/utils/test/reporting/images/pic02.jpg +++ b/utils/test/reporting/img/pic02.jpg diff --git a/utils/test/reporting/images/pic03.jpg b/utils/test/reporting/img/pic03.jpg Binary files differindex 175449039..175449039 100644 --- a/utils/test/reporting/images/pic03.jpg +++ b/utils/test/reporting/img/pic03.jpg diff --git a/utils/test/reporting/images/pic04.jpg b/utils/test/reporting/img/pic04.jpg Binary files differindex 7deb5717d..7deb5717d 100644 --- a/utils/test/reporting/images/pic04.jpg +++ b/utils/test/reporting/img/pic04.jpg diff --git a/utils/test/reporting/images/pic05.jpg b/utils/test/reporting/img/pic05.jpg Binary files differindex 8f5e52304..8f5e52304 100644 --- a/utils/test/reporting/images/pic05.jpg +++ b/utils/test/reporting/img/pic05.jpg diff --git a/utils/test/reporting/images/pic06.jpg b/utils/test/reporting/img/pic06.jpg Binary files differindex 64722c0fa..64722c0fa 100644 --- a/utils/test/reporting/images/pic06.jpg +++ b/utils/test/reporting/img/pic06.jpg diff --git a/utils/test/reporting/images/pic07.jpg b/utils/test/reporting/img/pic07.jpg Binary files differindex d64aba850..d64aba850 100644 --- a/utils/test/reporting/images/pic07.jpg +++ b/utils/test/reporting/img/pic07.jpg diff --git a/utils/test/reporting/images/pic08.jpg b/utils/test/reporting/img/pic08.jpg Binary files differindex 11bed5208..11bed5208 100644 --- a/utils/test/reporting/images/pic08.jpg +++ b/utils/test/reporting/img/pic08.jpg diff --git a/utils/test/reporting/images/pic09.jpg b/utils/test/reporting/img/pic09.jpg Binary files differindex 7f77fe081..7f77fe081 100644 --- a/utils/test/reporting/images/pic09.jpg +++ b/utils/test/reporting/img/pic09.jpg diff --git a/utils/test/reporting/images/pic10.jpg b/utils/test/reporting/img/pic10.jpg Binary files differindex e4d732895..e4d732895 100644 --- a/utils/test/reporting/images/pic10.jpg +++ b/utils/test/reporting/img/pic10.jpg diff --git a/utils/test/reporting/images/pic11.jpg b/utils/test/reporting/img/pic11.jpg Binary files differindex a975380dd..a975380dd 100644 --- a/utils/test/reporting/images/pic11.jpg +++ b/utils/test/reporting/img/pic11.jpg diff --git a/utils/test/reporting/images/pic12.jpg b/utils/test/reporting/img/pic12.jpg Binary files differindex cc68345b3..cc68345b3 100644 --- a/utils/test/reporting/images/pic12.jpg +++ b/utils/test/reporting/img/pic12.jpg diff --git a/utils/test/reporting/images/pic13.jpg b/utils/test/reporting/img/pic13.jpg Binary files differindex dc892a239..dc892a239 100644 --- a/utils/test/reporting/images/pic13.jpg +++ b/utils/test/reporting/img/pic13.jpg diff --git a/utils/test/reporting/images/pic14.jpg b/utils/test/reporting/img/pic14.jpg Binary files differindex ab6cd9ace..ab6cd9ace 100644 --- a/utils/test/reporting/images/pic14.jpg +++ b/utils/test/reporting/img/pic14.jpg diff --git a/utils/test/reporting/images/pic15.jpg b/utils/test/reporting/img/pic15.jpg Binary files differindex 0e94d0a2f..0e94d0a2f 100644 --- a/utils/test/reporting/images/pic15.jpg +++ b/utils/test/reporting/img/pic15.jpg diff --git a/utils/test/reporting/img/weather-clear.png b/utils/test/reporting/img/weather-clear.png Binary files differnew file mode 100644 index 000000000..a0d967750 --- /dev/null +++ b/utils/test/reporting/img/weather-clear.png diff --git a/utils/test/reporting/img/weather-few-clouds.png b/utils/test/reporting/img/weather-few-clouds.png Binary files differnew file mode 100644 index 000000000..acfa78398 --- /dev/null +++ b/utils/test/reporting/img/weather-few-clouds.png diff --git a/utils/test/reporting/img/weather-overcast.png b/utils/test/reporting/img/weather-overcast.png Binary files differnew file mode 100644 index 000000000..4296246d0 --- /dev/null +++ b/utils/test/reporting/img/weather-overcast.png diff --git a/utils/test/reporting/img/weather-storm.png b/utils/test/reporting/img/weather-storm.png Binary files differnew file mode 100644 index 000000000..956f0e20f --- /dev/null +++ b/utils/test/reporting/img/weather-storm.png diff --git a/utils/test/reporting/images/yardstick.jpg b/utils/test/reporting/img/yardstick.jpg Binary files differindex e0907ca93..e0907ca93 100644 --- a/utils/test/reporting/images/yardstick.jpg +++ b/utils/test/reporting/img/yardstick.jpg diff --git a/utils/test/reporting/reporting.yaml b/utils/test/reporting/reporting.yaml new file mode 100644 index 000000000..447d6e161 --- /dev/null +++ b/utils/test/reporting/reporting.yaml @@ -0,0 +1,49 @@ +general: + installers: + - apex + - compass + - fuel + - joid + + versions: + - master + - colorado + log: + log_file: reporting.log + log_level: ERROR + + period: 10 + + nb_iteration_tests_success_criteria: 4 + + directories: + # Relative to the path where the repo is cloned: + dir_reporting: utils/tests/reporting/ + dir_log: utils/tests/reporting/log/ + dir_conf: utils/tests/reporting/conf/ + dir_utils: utils/tests/reporting/utils/ + dir_templates: utils/tests/reporting/templates/ + dir_display: utils/tests/reporting/display/ + + url: testresults.opnfv.org/reporting/ + +testapi: + url: testresults.opnfv.org/test/api/v1/results + +functest: + blacklist: + - ovno + - security_scan + max_scenario_criteria: 50 + test_conf: https://git.opnfv.org/cgit/functest/plain/functest/ci/testcases.yaml + log_level: ERROR + jenkins_url: https://build.opnfv.org/ci/view/functest/job + + +yardstick: + test_conf: https://git.opnfv.org/cgit/yardstick/plain/tests/ci/report_config.yaml + log_level: ERROR + +qtip: + +bottleneck: diff --git a/utils/test/reporting/run_unit_tests.sh b/utils/test/reporting/run_unit_tests.sh new file mode 100755 index 000000000..6b0e3b2b1 --- /dev/null +++ b/utils/test/reporting/run_unit_tests.sh @@ -0,0 +1,43 @@ +#!/bin/bash +set -o errexit +set -o pipefail + +# ****************************** +# prepare the env for the tests +# ****************************** +# Either Workspace is set (CI) +if [ -z $WORKSPACE ] +then + WORKSPACE="." +fi + +export CONFIG_REPORTING_YAML=./reporting.yaml + +# *************** +# Run unit tests +# *************** +echo "Running unit tests..." + +# start vitual env +virtualenv $WORKSPACE/reporting_venv +source $WORKSPACE/reporting_venv/bin/activate + +# install python packages +easy_install -U setuptools +easy_install -U pip +pip install -r $WORKSPACE/docker/requirements.pip +pip install -e $WORKSPACE + +python $WORKSPACE/setup.py develop + +# unit tests +# TODO: remove cover-erase +# To be deleted when all functest packages will be listed +nosetests --with-xunit \ + --cover-package=utils \ + --with-coverage \ + --cover-xml \ + tests/unit +rc=$? + +deactivate diff --git a/utils/test/reporting/setup.py b/utils/test/reporting/setup.py new file mode 100644 index 000000000..627785eca --- /dev/null +++ b/utils/test/reporting/setup.py @@ -0,0 +1,22 @@ +############################################################################## +# 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 +############################################################################## + +from setuptools import setup, find_packages + + +setup( + name="reporting", + version="master", + packages=find_packages(), + include_package_data=True, + package_data={ + }, + url="https://www.opnfv.org", + install_requires=["coverage==4.1", + "mock==1.3.0", + "nose==1.3.7"], +) diff --git a/utils/test/reporting/tests/__init__.py b/utils/test/reporting/tests/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/utils/test/reporting/tests/__init__.py diff --git a/utils/test/reporting/tests/unit/__init__.py b/utils/test/reporting/tests/unit/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/utils/test/reporting/tests/unit/__init__.py diff --git a/utils/test/reporting/tests/unit/utils/__init__.py b/utils/test/reporting/tests/unit/utils/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/utils/test/reporting/tests/unit/utils/__init__.py diff --git a/utils/test/reporting/tests/unit/utils/test_utils.py b/utils/test/reporting/tests/unit/utils/test_utils.py new file mode 100644 index 000000000..b9c39806c --- /dev/null +++ b/utils/test/reporting/tests/unit/utils/test_utils.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 Orange 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 + +import logging +import unittest + +from utils import reporting_utils + + +class reportingUtilsTesting(unittest.TestCase): + + logging.disable(logging.CRITICAL) + + def setUp(self): + self.test = reporting_utils + + def test_getConfig(self): + self.assertEqual(self.test.get_config("general.period"), 10) +# TODO +# ... + +if __name__ == "__main__": + unittest.main(verbosity=2) diff --git a/utils/test/reporting/utils/__init__.py b/utils/test/reporting/utils/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/utils/test/reporting/utils/__init__.py diff --git a/utils/test/reporting/utils/reporting_utils.py b/utils/test/reporting/utils/reporting_utils.py new file mode 100644 index 000000000..0af60c78a --- /dev/null +++ b/utils/test/reporting/utils/reporting_utils.py @@ -0,0 +1,355 @@ +#!/usr/bin/python +# +# 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 +# +from urllib2 import Request, urlopen, URLError +import logging +import json +import os +import pdfkit +import yaml + + +# ---------------------------------------------------------- +# +# YAML UTILS +# +# ----------------------------------------------------------- +def get_parameter_from_yaml(parameter, file): + """ + Returns the value of a given parameter in file.yaml + parameter must be given in string format with dots + Example: general.openstack.image_name + """ + with open(file) as f: + file_yaml = yaml.safe_load(f) + f.close() + value = file_yaml + for element in parameter.split("."): + value = value.get(element) + if value is None: + raise ValueError("The parameter %s is not defined in" + " reporting.yaml" % parameter) + return value + + +def get_config(parameter): + yaml_ = os.environ["CONFIG_REPORTING_YAML"] + return get_parameter_from_yaml(parameter, yaml_) + + +# ---------------------------------------------------------- +# +# LOGGER UTILS +# +# ----------------------------------------------------------- +def getLogger(module): + logFormatter = logging.Formatter("%(asctime)s [" + + module + + "] [%(levelname)-5.5s] %(message)s") + logger = logging.getLogger() + log_file = get_config('general.log.log_file') + log_level = get_config('general.log.log_level') + + fileHandler = logging.FileHandler("{0}/{1}".format('.', log_file)) + fileHandler.setFormatter(logFormatter) + logger.addHandler(fileHandler) + + consoleHandler = logging.StreamHandler() + consoleHandler.setFormatter(logFormatter) + logger.addHandler(consoleHandler) + logger.setLevel(log_level) + return logger + + +# ---------------------------------------------------------- +# +# REPORTING UTILS +# +# ----------------------------------------------------------- +def getApiResults(case, installer, scenario, version): + results = json.dumps([]) + # to remove proxy (to be removed at the end for local test only) + # proxy_handler = urllib2.ProxyHandler({}) + # opener = urllib2.build_opener(proxy_handler) + # urllib2.install_opener(opener) + # url = "http://127.0.0.1:8000/results?case=" + case + \ + # "&period=30&installer=" + installer + period = get_config('general.period') + url_base = get_config('testapi.url') + nb_tests = get_config('general.nb_iteration_tests_success_criteria') + + url = ("http://" + url_base + "?case=" + case + + "&period=" + str(period) + "&installer=" + installer + + "&scenario=" + scenario + "&version=" + version + + "&last=" + str(nb_tests)) + request = Request(url) + + try: + response = urlopen(request) + k = response.read() + results = json.loads(k) + except URLError, e: + print 'No kittez. Got an error code:', e + + return results + + +def getScenarios(case, installer, version): + + case = case.getName() + period = get_config('general.period') + url_base = get_config('testapi.url') + + url = ("http://" + url_base + "?case=" + case + + "&period=" + str(period) + "&installer=" + installer + + "&version=" + version) + request = Request(url) + + try: + response = urlopen(request) + k = response.read() + results = json.loads(k) + test_results = results['results'] + except URLError, e: + print 'Got an error code:', e + + if test_results is not None: + test_results.reverse() + + scenario_results = {} + + for r in test_results: + # Retrieve all the scenarios per installer + if not r['scenario'] in scenario_results.keys(): + scenario_results[r['scenario']] = [] + scenario_results[r['scenario']].append(r) + + return scenario_results + + +def getScenarioStats(scenario_results): + scenario_stats = {} + for k, v in scenario_results.iteritems(): + scenario_stats[k] = len(v) + + return scenario_stats + + +# TODO convergence with above function getScenarios +def getScenarioStatus(installer, version): + period = get_config('general.period') + url_base = get_config('testapi.url') + + url = ("http://" + url_base + "?case=scenario_status" + + "&installer=" + installer + + "&version=" + version + "&period=" + str(period)) + request = Request(url) + + try: + response = urlopen(request) + k = response.read() + response.close() + results = json.loads(k) + test_results = results['results'] + except URLError, e: + print 'Got an error code:', e + + scenario_results = {} + result_dict = {} + if test_results is not None: + for r in test_results: + if r['stop_date'] != 'None' and r['criteria'] is not None: + if not r['scenario'] in scenario_results.keys(): + scenario_results[r['scenario']] = [] + scenario_results[r['scenario']].append(r) + + for k, v in scenario_results.items(): + # scenario_results[k] = v[:LASTEST_TESTS] + s_list = [] + for element in v: + if element['criteria'] == 'SUCCESS': + s_list.append(1) + else: + s_list.append(0) + result_dict[k] = s_list + + # return scenario_results + return result_dict + + +def getNbtestOk(results): + nb_test_ok = 0 + for r in results: + for k, v in r.iteritems(): + try: + if "PASS" in v: + nb_test_ok += 1 + except: + print "Cannot retrieve test status" + return nb_test_ok + + +def getResult(testCase, installer, scenario, version): + + # retrieve raw results + results = getApiResults(testCase, installer, scenario, version) + # let's concentrate on test results only + test_results = results['results'] + + # if results found, analyze them + if test_results is not None: + test_results.reverse() + + scenario_results = [] + + # print " ---------------- " + # print test_results + # print " ---------------- " + # print "nb of results:" + str(len(test_results)) + + for r in test_results: + # print r["start_date"] + # print r["criteria"] + scenario_results.append({r["start_date"]: r["criteria"]}) + # sort results + scenario_results.sort() + # 4 levels for the results + # 3: 4+ consecutive runs passing the success criteria + # 2: <4 successful consecutive runs but passing the criteria + # 1: close to pass the success criteria + # 0: 0% success, not passing + # -1: no run available + test_result_indicator = 0 + nbTestOk = getNbtestOk(scenario_results) + + # print "Nb test OK (last 10 days):"+ str(nbTestOk) + # check that we have at least 4 runs + if len(scenario_results) < 1: + # No results available + test_result_indicator = -1 + elif nbTestOk < 1: + test_result_indicator = 0 + elif nbTestOk < 2: + test_result_indicator = 1 + else: + # Test the last 4 run + if (len(scenario_results) > 3): + last4runResults = scenario_results[-4:] + nbTestOkLast4 = getNbtestOk(last4runResults) + # print "Nb test OK (last 4 run):"+ str(nbTestOkLast4) + if nbTestOkLast4 > 3: + test_result_indicator = 3 + else: + test_result_indicator = 2 + else: + test_result_indicator = 2 + return test_result_indicator + + +def getJenkinsUrl(build_tag): + # e.g. jenkins-functest-apex-apex-daily-colorado-daily-colorado-246 + # id = 246 + # note it is linked to jenkins format + # if this format changes...function to be adapted.... + url_base = get_config('functest.jenkins_url') + try: + build_id = [int(s) for s in build_tag.split("-") if s.isdigit()] + jenkins_path = filter(lambda c: not c.isdigit(), build_tag) + url_id = jenkins_path[8:-1] + "/" + str(build_id[0]) + jenkins_url = url_base + url_id + "/console" + except: + 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 + + +# ********* +# Yardstick +# ********* +def subfind(given_list, pattern_list): + LASTEST_TESTS = get_config('general.nb_iteration_tests_success_criteria') + for i in range(len(given_list)): + if given_list[i] == pattern_list[0] and \ + given_list[i:i + LASTEST_TESTS] == pattern_list: + return True + return False + + +def _get_percent(status): + + if status * 100 % 6: + return round(float(status) * 100 / 6, 1) + else: + return status * 100 / 6 + + +def get_percent(four_list, ten_list): + four_score = 0 + ten_score = 0 + + for v in four_list: + four_score += v + for v in ten_list: + ten_score += v + + LASTEST_TESTS = get_config('general.nb_iteration_tests_success_criteria') + if four_score == LASTEST_TESTS: + status = 6 + elif subfind(ten_list, [1, 1, 1, 1]): + status = 5 + elif ten_score == 0: + status = 0 + else: + status = four_score + 1 + + return _get_percent(status) + + +def _test(): + status = getScenarioStatus("compass", "master") + print "status:++++++++++++++++++++++++" + print json.dumps(status, indent=4) + + +# ---------------------------------------------------------- +# +# Export +# +# ----------------------------------------------------------- + +def export_csv(scenario_file_name, installer, version): + # csv + # generate sub files based on scenario_history.txt + scenario_installer_file_name = ("./display/" + version + + "/functest/scenario_history_" + + installer + ".csv") + scenario_installer_file = open(scenario_installer_file_name, "a") + with open(scenario_file_name, "r") as f: + scenario_installer_file.write("date,scenario,installer,detail,score\n") + for line in f: + if installer in line: + scenario_installer_file.write(line) + scenario_installer_file.close + + +def export_pdf(pdf_path, pdf_doc_name): + try: + pdfkit.from_file(pdf_path, pdf_doc_name) + except IOError: + print("Error but pdf generated anyway...") + except: + print("impossible to generate PDF") diff --git a/utils/test/reporting/yardstick/reporting-status.py b/utils/test/reporting/yardstick/reporting-status.py index 49809e9d8..338154987 100644 --- a/utils/test/reporting/yardstick/reporting-status.py +++ b/utils/test/reporting/yardstick/reporting-status.py @@ -10,31 +10,36 @@ import datetime import jinja2 import os -import reportingUtils as utils -import reportingConf as conf import scenarioResult as sr from scenarios import config as cf +# manage conf +import utils.reporting_utils as rp_utils + +installers = rp_utils.get_config('general.installers') +versions = rp_utils.get_config('general.versions') +PERIOD = rp_utils.get_config('general.period') + # Logger -logger = utils.getLogger("Yardstick-Status") +logger = rp_utils.getLogger("Yardstick-Status") reportingDate = datetime.datetime.now().strftime("%Y-%m-%d %H:%M") logger.info("*******************************************") logger.info("* Generating reporting scenario status *") -logger.info("* Data retention = %s days *" % conf.PERIOD) +logger.info("* Data retention = %s days *" % PERIOD) logger.info("* *") logger.info("*******************************************") # For all the versions -for version in conf.versions: +for version in versions: # For all the installers - for installer in conf.installers: + for installer in installers: # get scenarios results data - scenario_results = utils.getScenarioStatus(installer, version) + scenario_results = rp_utils.getScenarioStatus(installer, version) if 'colorado' == version: - stable_result = utils.getScenarioStatus(installer, - 'stable/colorado') + stable_result = rp_utils.getScenarioStatus(installer, + 'stable/colorado') for k, v in stable_result.items(): if k not in scenario_results.keys(): scenario_results[k] = [] @@ -48,24 +53,25 @@ for version in conf.versions: # From each scenarios get results list for s, s_result in scenario_results.items(): logger.info("---------------------------------") - logger.info("installer %s, version %s, scenario %s:" % (installer, - version, s)) + logger.info("installer %s, version %s, " + + "scenario %s:" % (installer, version, s)) ten_criteria = len(s_result) ten_score = 0 for v in s_result: ten_score += v - four_result = s_result[:conf.LASTEST_TESTS] + LASTEST_TESTS = rp_utils.get_config('general.nb_iteration_tests_success_criteria') + four_result = s_result[:LASTEST_TESTS] four_criteria = len(four_result) four_score = 0 for v in four_result: four_score += v - s_status = str(utils.get_percent(four_result, s_result)) + s_status = str(rp_utils.get_percent(four_result, s_result)) s_four_score = str(four_score) + '/' + str(four_criteria) s_ten_score = str(ten_score) + '/' + str(ten_criteria) - s_score_percent = utils.get_percent(four_result, s_result) + s_score_percent = rp_utils.get_percent(four_result, s_result) if '100' == s_status: logger.info(">>>>> scenario OK, save the information") @@ -74,9 +80,8 @@ for version in conf.versions: last 10 days = %s" % (s_four_score, s_ten_score)) # Save daily results in a file - path_validation_file = (conf.REPORTING_PATH + - "/release/" + version + - "/scenario_history.txt") + path_validation_file = ("./display/" + version + + "/yardstick/scenario_history.txt") if not os.path.exists(path_validation_file): with open(path_validation_file, 'w') as f: @@ -96,18 +101,19 @@ for version in conf.versions: logger.info("--------------------------") - templateLoader = jinja2.FileSystemLoader(conf.REPORTING_PATH) - templateEnv = jinja2.Environment(loader=templateLoader, autoescape=True) + templateLoader = jinja2.FileSystemLoader(".") + templateEnv = jinja2.Environment(loader=templateLoader, + autoescape=True) - TEMPLATE_FILE = "/template/index-status-tmpl.html" + TEMPLATE_FILE = "./yardstick/template/index-status-tmpl.html" template = templateEnv.get_template(TEMPLATE_FILE) outputText = template.render(scenario_results=scenario_result_criteria, installer=installer, - period=conf.PERIOD, + period=PERIOD, version=version, date=reportingDate) - with open(conf.REPORTING_PATH + "/release/" + version + - "/index-status-" + installer + ".html", "wb") as fh: + with open("./display/" + version + + "/yardstick/status-" + installer + ".html", "wb") as fh: fh.write(outputText) diff --git a/utils/test/reporting/yardstick/reportingConf.py b/utils/test/reporting/yardstick/reportingConf.py deleted file mode 100644 index 2db41f0e1..000000000 --- a/utils/test/reporting/yardstick/reportingConf.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/python -# -# 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 -# -# Reporting: Declaration of the variables -# -# **************************************************** -installers = ["apex", "compass", "fuel", "joid"] - -versions = ["master", "colorado"] - -# get data in the past 10 days -PERIOD = 10 - -# get the lastest 4 test results to determinate the success criteria -LASTEST_TESTS = 4 - -REPORTING_PATH = "." - -URL_BASE = 'http://testresults.opnfv.org/test/api/v1/results' -TEST_CONF = "https://git.opnfv.org/cgit/yardstick/plain/tests/ci/report_config.yaml" - -# LOG_LEVEL = "ERROR" -LOG_LEVEL = "INFO" -LOG_FILE = REPORTING_PATH + "/reporting.log" diff --git a/utils/test/reporting/yardstick/reportingUtils.py b/utils/test/reporting/yardstick/reportingUtils.py deleted file mode 100644 index ec9ed76dc..000000000 --- a/utils/test/reporting/yardstick/reportingUtils.py +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/python -# -# 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 -# -from urllib2 import Request, urlopen, URLError -import logging -import json -import reportingConf as conf - - -def getLogger(module): - logFormatter = logging.Formatter("%(asctime)s [" + - module + - "] [%(levelname)-5.5s] %(message)s") - logger = logging.getLogger() - - fileHandler = logging.FileHandler("{0}/{1}".format('.', conf.LOG_FILE)) - fileHandler.setFormatter(logFormatter) - logger.addHandler(fileHandler) - - consoleHandler = logging.StreamHandler() - consoleHandler.setFormatter(logFormatter) - logger.addHandler(consoleHandler) - logger.setLevel(conf.LOG_LEVEL) - return logger - - -def getScenarioStatus(installer, version): - url = (conf.URL_BASE + "?case=" + "scenario_status" + - "&installer=" + installer + - "&version=" + version + "&period=" + str(conf.PERIOD)) - request = Request(url) - - try: - response = urlopen(request) - k = response.read() - response.close() - results = json.loads(k) - test_results = results['results'] - except URLError, e: - print 'Got an error code:', e - - scenario_results = {} - result_dict = {} - if test_results is not None: - for r in test_results: - if r['stop_date'] != 'None' and r['criteria'] is not None: - if not r['scenario'] in scenario_results.keys(): - scenario_results[r['scenario']] = [] - scenario_results[r['scenario']].append(r) - - for k, v in scenario_results.items(): - # scenario_results[k] = v[:conf.LASTEST_TESTS] - s_list = [] - for element in v: - if element['criteria'] == 'SUCCESS': - s_list.append(1) - else: - s_list.append(0) - result_dict[k] = s_list - - # return scenario_results - return result_dict - - -def subfind(given_list, pattern_list): - - for i in range(len(given_list)): - if given_list[i] == pattern_list[0] and \ - given_list[i:i + conf.LASTEST_TESTS] == pattern_list: - return True - return False - - -def _get_percent(status): - - if status * 100 % 6: - return round(float(status) * 100 / 6, 1) - else: - return status * 100 / 6 - - -def get_percent(four_list, ten_list): - four_score = 0 - ten_score = 0 - - for v in four_list: - four_score += v - for v in ten_list: - ten_score += v - - if four_score == conf.LASTEST_TESTS: - status = 6 - elif subfind(ten_list, [1, 1, 1, 1]): - status = 5 - elif ten_score == 0: - status = 0 - else: - status = four_score + 1 - - return _get_percent(status) - - -def _test(): - status = getScenarioStatus("compass", "master") - print "status:++++++++++++++++++++++++" - print json.dumps(status, indent=4) - - -if __name__ == '__main__': # pragma: no cover - _test() diff --git a/utils/test/reporting/yardstick/scenarios.py b/utils/test/reporting/yardstick/scenarios.py index 590fea2a4..26e8c8bb0 100644 --- a/utils/test/reporting/yardstick/scenarios.py +++ b/utils/test/reporting/yardstick/scenarios.py @@ -1,11 +1,18 @@ -import yaml -import os +#!/usr/bin/python +# +# 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 +# import requests +import yaml -import reportingConf as conf - +import utils.reporting_utils as rp_utils -response = requests.get(conf.TEST_CONF) +yardstick_conf = rp_utils.get_config('yardstick.test_conf') +response = requests.get(yardstick_conf) yaml_file = yaml.safe_load(response.text) reporting = yaml_file.get('reporting') @@ -15,6 +22,6 @@ for element in reporting: name = element['name'] scenarios = element['scenario'] for s in scenarios: - if not config.has_key(name): + if name not in config: config[name] = {} config[name][s] = True diff --git a/utils/test/reporting/yardstick/template/index-status-tmpl.html b/utils/test/reporting/yardstick/template/index-status-tmpl.html index 5a4dc347c..b6f237a1a 100644 --- a/utils/test/reporting/yardstick/template/index-status-tmpl.html +++ b/utils/test/reporting/yardstick/template/index-status-tmpl.html @@ -3,12 +3,12 @@ <meta charset="utf-8"> <!-- Bootstrap core CSS --> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"> - <link href="../../../css/default.css" rel="stylesheet"> + <link href="../../css/default.css" rel="stylesheet"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> <script type="text/javascript" src="http://d3js.org/d3.v2.min.js"></script> - <script type="text/javascript" src="../../../js/gauge.js"></script> - <script type="text/javascript" src="../../../js/trend.js"></script> + <script type="text/javascript" src="../../js/gauge.js"></script> + <script type="text/javascript" src="../../js/trend.js"></script> <script> function onDocumentReady() { // Gauge management @@ -25,8 +25,7 @@ } // trend line management - //d3.csv("./scenario_history.txt", function(data) { - d3.csv("./scenario_history.txt", function(data) { + d3.csv("./scenario_history.csv", function(data) { // *************************************** // Create the trend line {% for scenario in scenario_results.keys() -%} |