summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--jjb/xci/bifrost-verify-jobs.yml8
-rwxr-xr-xjjb/xci/bifrost-verify.sh15
-rw-r--r--utils/test/reporting/reporting/utils/reporting_utils.py7
-rw-r--r--utils/test/testapi/opnfv_testapi/common/check.py13
-rw-r--r--utils/test/testapi/opnfv_testapi/common/message.py4
-rw-r--r--utils/test/testapi/opnfv_testapi/resources/handlers.py1
-rw-r--r--utils/test/testapi/opnfv_testapi/resources/result_handlers.py8
-rw-r--r--utils/test/testapi/opnfv_testapi/tests/unit/resources/test_result.py9
8 files changed, 51 insertions, 14 deletions
diff --git a/jjb/xci/bifrost-verify-jobs.yml b/jjb/xci/bifrost-verify-jobs.yml
index 5f0b6572a..f8d39b2fb 100644
--- a/jjb/xci/bifrost-verify-jobs.yml
+++ b/jjb/xci/bifrost-verify-jobs.yml
@@ -12,19 +12,19 @@
# -------------------------------
distro:
- 'xenial':
- disabled: true
+ disabled: false
dib-os-release: 'xenial'
dib-os-element: 'ubuntu-minimal'
dib-os-packages: 'vlan,vim,less,bridge-utils,language-pack-en,iputils-ping,rsyslog,curl'
extra-dib-elements: 'openssh-server'
- 'centos7':
- disabled: true
+ disabled: false
dib-os-release: '7'
dib-os-element: 'centos-minimal'
dib-os-packages: 'vim,less,bridge-utils,iputils,rsyslog,curl'
extra-dib-elements: 'openssh-server'
- - 'suse':
- disabled: true
+ - 'opensuse423':
+ disabled: false
dib-os-release: '42.3'
dib-os-element: 'opensuse-minimal'
dib-os-packages: 'vim,less,bridge-utils,iputils,rsyslog,curl'
diff --git a/jjb/xci/bifrost-verify.sh b/jjb/xci/bifrost-verify.sh
index ef0730938..a86ba91c3 100755
--- a/jjb/xci/bifrost-verify.sh
+++ b/jjb/xci/bifrost-verify.sh
@@ -25,19 +25,24 @@ cd $WORKSPACE/releng-xci
cat > bifrost_test.sh<<EOF
cd ~/bifrost
# provision 3 VMs; xcimaster, controller, and compute
-cd $WORKSPACE/bifrost
./scripts/bifrost-provision.sh
# list the provisioned VMs
-cd $WORKSPACE/bifrost
source env-vars
ironic node-list
sudo -H -E virsh list
EOF
chmod a+x bifrost_test.sh
-./xci/scripts/vm/start-new-vm.sh $DISTRO
+# Fix up distros
+case ${DISTRO} in
+ xenial) VM_DISTRO=ubuntu ;;
+ centos7) VM_DISTRO=centos ;;
+ *suse*) VM_DISTRO=opensuse ;;
+esac
-rsync -a $WORKSPACE/bifrost ${DISTRO,,}_xci_vm:~/bifrost
+./xci/scripts/vm/start-new-vm.sh $VM_DISTRO
-ssh ${DISTRO,,}_xci_vm "cd ~/bifrost && ./bifrost_test.sh"
+rsync -a $WORKSPACE/releng-xci ${VM_DISTRO}_xci_vm:~/bifrost
+
+ssh -F $HOME/.ssh/xci-vm-config ${VM_DISTRO}_xci_vm "cd ~/bifrost && ./bifrost_test.sh"
diff --git a/utils/test/reporting/reporting/utils/reporting_utils.py b/utils/test/reporting/reporting/utils/reporting_utils.py
index 8dc4f0933..58a0c6233 100644
--- a/utils/test/reporting/reporting/utils/reporting_utils.py
+++ b/utils/test/reporting/reporting/utils/reporting_utils.py
@@ -114,7 +114,8 @@ def getScenarios(project, case, installer, version):
"""
Get the list of Scenarios
"""
-
+ test_results = None
+ scenario_results = None
period = get_config('general.period')
url_base = get_config('testapi.url')
@@ -373,8 +374,8 @@ def getCaseScoreFromBuildTag(testCase, s_results):
test_result_indicator += 1
except:
print "No results found for this case"
- if test_result_indicator > 3:
- test_result_indicator = 3
+ if test_result_indicator > 2:
+ test_result_indicator = test_result_indicator - 1
return test_result_indicator
diff --git a/utils/test/testapi/opnfv_testapi/common/check.py b/utils/test/testapi/opnfv_testapi/common/check.py
index fd30c9b3f..667578fed 100644
--- a/utils/test/testapi/opnfv_testapi/common/check.py
+++ b/utils/test/testapi/opnfv_testapi/common/check.py
@@ -103,6 +103,19 @@ def carriers_exist(xstep):
return wrap
+def values_check(xstep):
+ @functools.wraps(xstep)
+ def wrap(self, *args, **kwargs):
+ checks = kwargs.pop('values_check', {})
+ if checks:
+ for field, check, options in checks:
+ if not check(field, options):
+ raises.BadRequest(message.invalid_value(field, options))
+ ret = yield gen.coroutine(xstep)(self, *args, **kwargs)
+ raise gen.Return(ret)
+ return wrap
+
+
def new_not_exists(xstep):
@functools.wraps(xstep)
def wrap(self, *args, **kwargs):
diff --git a/utils/test/testapi/opnfv_testapi/common/message.py b/utils/test/testapi/opnfv_testapi/common/message.py
index 8b5c3fb7a..3e14f7258 100644
--- a/utils/test/testapi/opnfv_testapi/common/message.py
+++ b/utils/test/testapi/opnfv_testapi/common/message.py
@@ -26,6 +26,10 @@ def missing(name):
return '{} Missing'.format(name)
+def invalid_value(name, options):
+ return '{} must be in {}'.format(name, options)
+
+
def exist(key, value):
return '{} [{}] {}'.format(key, value, exist_base)
diff --git a/utils/test/testapi/opnfv_testapi/resources/handlers.py b/utils/test/testapi/opnfv_testapi/resources/handlers.py
index 8e5dab235..6c7a819c9 100644
--- a/utils/test/testapi/opnfv_testapi/resources/handlers.py
+++ b/utils/test/testapi/opnfv_testapi/resources/handlers.py
@@ -79,6 +79,7 @@ class GenericApiHandler(web.RequestHandler):
@check.valid_token
@check.no_body
@check.miss_fields
+ @check.values_check
@check.carriers_exist
@check.new_not_exists
def _create(self, **kwargs):
diff --git a/utils/test/testapi/opnfv_testapi/resources/result_handlers.py b/utils/test/testapi/opnfv_testapi/resources/result_handlers.py
index e202f5c2c..a25852856 100644
--- a/utils/test/testapi/opnfv_testapi/resources/result_handlers.py
+++ b/utils/test/testapi/opnfv_testapi/resources/result_handlers.py
@@ -215,12 +215,18 @@ class ResultsCLHandler(GenericResultHandler):
return {'project_name': self.json_args.get('project_name'),
'name': self.json_args.get('case_name')}
+ def options_check(field, options):
+ return self.json_args.get(field).upper() in options
+
miss_fields = ['pod_name', 'project_name', 'case_name']
carriers = [('pods', pod_query),
('projects', project_query),
('testcases', testcase_query)]
+ values_check = [('criteria', options_check, ['PASS', 'FAIL'])]
- self._create(miss_fields=miss_fields, carriers=carriers)
+ self._create(miss_fields=miss_fields,
+ carriers=carriers,
+ values_check=values_check)
class ResultsUploadHandler(ResultsCLHandler):
diff --git a/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_result.py b/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_result.py
index 1df31f36c..6c1a07a91 100644
--- a/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_result.py
+++ b/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_result.py
@@ -62,7 +62,7 @@ class TestResultBase(base.TestBase):
self.version = 'C'
self.build_tag = 'v3.0'
self.scenario = 'odl-l2'
- self.criteria = 'passed'
+ self.criteria = 'PASS'
self.trust_indicator = result_models.TI(0.7)
self.start_date = str(datetime.now())
self.stop_date = str(datetime.now() + timedelta(minutes=1))
@@ -170,6 +170,13 @@ class TestResultCreate(TestResultBase):
req.case_name = None
return req
+ @executor.create(httplib.BAD_REQUEST,
+ message.invalid_value('criteria', ['PASS', 'FAIL']))
+ def test_invalid_criteria(self):
+ req = self.req_d
+ req.criteria = 'invalid'
+ return req
+
@executor.create(httplib.FORBIDDEN, message.not_found_base)
def test_noPod(self):
req = self.req_d