diff options
-rwxr-xr-x | nsb_setup.sh | 2 | ||||
-rw-r--r-- | tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-ha_daily.yaml | 32 | ||||
-rw-r--r-- | tests/unit/benchmark/scenarios/availability/test_scenario_general.py | 6 | ||||
-rwxr-xr-x | yardstick/benchmark/runners/base.py | 7 | ||||
-rw-r--r-- | yardstick/benchmark/scenarios/availability/scenario_general.py | 14 | ||||
-rwxr-xr-x | yardstick/benchmark/scenarios/availability/serviceha.py | 7 | ||||
-rw-r--r-- | yardstick/dispatcher/http.py | 7 |
7 files changed, 54 insertions, 21 deletions
diff --git a/nsb_setup.sh b/nsb_setup.sh index 332c0345c..05d1fd6db 100755 --- a/nsb_setup.sh +++ b/nsb_setup.sh @@ -241,5 +241,5 @@ else clear echo "Installation completed..." echo "Virtual Environment : $INSTALL_BIN_PATH/yardstick_venv" -echo "Please Refer README.NSB.rst document on how to get started on VNF testing." +echo "Please refer to Chapter 13 of the Yardstick User Guide for how to get started with VNF testing." fi diff --git a/tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-ha_daily.yaml index 97c234e45..d18a4e6d5 100644 --- a/tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-ha_daily.yaml +++ b/tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-ha_daily.yaml @@ -37,9 +37,21 @@ test_cases: huawei-pod1: '{"pod_info": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml", "host": "node4.LF","target": "node5.LF"}' - + file_name: opnfv_yardstick_tc019.yaml + constraint: + installer: compass,fuel + pod: huawei-pod2,ericsson-pod1 + task_args: + huawei-pod2: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml"}' + ericsson-pod1: '{"file": "etc/yardstick/nodes/fuel_baremetal/pod.yaml"}' +- file_name: opnfv_yardstick_tc045.yaml constraint: - installer: fuel + installer: compass,fuel + pod: huawei-pod2,ericsson-pod1 + task_args: + huawei-pod2: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml"}' + ericsson-pod1: '{"file": "etc/yardstick/nodes/fuel_baremetal/pod.yaml"}' - file_name: opnfv_yardstick_tc046.yaml constraint: @@ -47,11 +59,19 @@ test_cases: - file_name: opnfv_yardstick_tc047.yaml constraint: - installer: fuel + installer: compass,fuel + pod: huawei-pod2,ericsson-pod1 + task_args: + huawei-pod2: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml"}' + ericsson-pod1: '{"file": "etc/yardstick/nodes/fuel_baremetal/pod.yaml"}' - file_name: opnfv_yardstick_tc048.yaml constraint: - installer: fuel + installer: compass,fuel + pod: huawei-pod2,ericsson-pod1 + task_args: + huawei-pod2: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml"}' + ericsson-pod1: '{"file": "etc/yardstick/nodes/fuel_baremetal/pod.yaml"}' - file_name: opnfv_yardstick_tc049.yaml constraint: @@ -63,7 +83,11 @@ test_cases: - file_name: opnfv_yardstick_tc051.yaml constraint: - installer: fuel + installer: compass,fuel + pod: huawei-pod2,ericsson-pod1 + task_args: + huawei-pod2: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml"}' + ericsson-pod1: '{"file": "etc/yardstick/nodes/fuel_baremetal/pod.yaml"}' - file_name: opnfv_yardstick_tc052.yaml constraint: diff --git a/tests/unit/benchmark/scenarios/availability/test_scenario_general.py b/tests/unit/benchmark/scenarios/availability/test_scenario_general.py index 593fc77b3..ea54fbb9b 100644 --- a/tests/unit/benchmark/scenarios/availability/test_scenario_general.py +++ b/tests/unit/benchmark/scenarios/availability/test_scenario_general.py @@ -48,7 +48,7 @@ class ScenarioGeneralTestCase(unittest.TestCase): def test_scenario_general_all_successful(self, mock_director): ins = ScenarioGeneral(self.scenario_cfg, None) ins.setup() - ins.run(None) + ins.run({}) ins.teardown() def test_scenario_general_exception(self, mock_director): @@ -56,7 +56,7 @@ class ScenarioGeneralTestCase(unittest.TestCase): mock_obj = mock.Mock() mock_obj.createActionPlayer.side_effect = KeyError('Wrong') ins.director = mock_obj - ins.run(None) + ins.run({}) ins.teardown() def test_scenario_general_case_fail(self, mock_director): @@ -64,5 +64,5 @@ class ScenarioGeneralTestCase(unittest.TestCase): mock_obj = mock.Mock() mock_obj.verify.return_value = False ins.director = mock_obj - ins.run(None) + ins.run({}) ins.teardown() diff --git a/yardstick/benchmark/runners/base.py b/yardstick/benchmark/runners/base.py index 7c76e42df..b48ed973a 100755 --- a/yardstick/benchmark/runners/base.py +++ b/yardstick/benchmark/runners/base.py @@ -22,6 +22,7 @@ import logging import multiprocessing import subprocess import time +import os import traceback from oslo_config import cfg @@ -40,7 +41,11 @@ def _output_serializer_main(filename, queue, config): Use of this process enables multiple instances of a scenario without messing up the output file. """ - out_type = config['yardstick'].get('DEFAULT', {}).get('dispatcher', 'file') + try: + out_type = config['yardstick'].get('DEFAULT', {})['dispatcher'] + except KeyError: + out_type = os.environ.get('DISPATCHER', 'file') + conf = { 'type': out_type.capitalize(), 'file_path': filename diff --git a/yardstick/benchmark/scenarios/availability/scenario_general.py b/yardstick/benchmark/scenarios/availability/scenario_general.py index a950ef933..689d33a34 100644 --- a/yardstick/benchmark/scenarios/availability/scenario_general.py +++ b/yardstick/benchmark/scenarios/availability/scenario_general.py @@ -29,7 +29,7 @@ class ScenarioGeneral(base.Scenario): def setup(self): self.director = Director(self.scenario_cfg, self.context_cfg) - def run(self, args): + def run(self, result): steps = self.scenario_cfg["options"]["steps"] orderedSteps = sorted(steps, key=lambda x: x['index']) for step in orderedSteps: @@ -55,12 +55,14 @@ class ScenarioGeneral(base.Scenario): self.director.stopMonitors() if self.director.verify(): - LOG.debug( - "\033[92m congratulations, " - "the test cases scenario is pass! \033[0m") + result['sla_pass'] = 1 + LOG.info( + "\033[92m Congratulations, " + "the HA test case PASS! \033[0m") else: - LOG.debug( - "\033[91m aoh,the test cases scenario failed," + result['sla_pass'] = 0 + LOG.info( + "\033[91m Aoh, the HA test case FAIL," "please check the detail debug information! \033[0m") def teardown(self): diff --git a/yardstick/benchmark/scenarios/availability/serviceha.py b/yardstick/benchmark/scenarios/availability/serviceha.py index e82e69b7d..69727de2b 100755 --- a/yardstick/benchmark/scenarios/availability/serviceha.py +++ b/yardstick/benchmark/scenarios/availability/serviceha.py @@ -59,20 +59,21 @@ class ServiceHA(base.Scenario): return self.monitorMgr.start_monitors() - LOG.info("monitor start!") + LOG.info("HA monitor start!") for attacker in self.attackers: attacker.inject_fault() self.monitorMgr.wait_monitors() - LOG.info("monitor stop!") + LOG.info("HA monitor stop!") sla_pass = self.monitorMgr.verify_SLA() if sla_pass: result['sla_pass'] = 1 + LOG.info("The HA test case PASS the SLA") else: result['sla_pass'] = 0 - assert sla_pass is True, "the test cases is not pass the SLA" + assert sla_pass is True, "The HA test case NOT pass the SLA" return diff --git a/yardstick/dispatcher/http.py b/yardstick/dispatcher/http.py index e3bcbc89b..0d8d2a346 100644 --- a/yardstick/dispatcher/http.py +++ b/yardstick/dispatcher/http.py @@ -32,7 +32,7 @@ LOG = logging.getLogger(__name__) CONF = cfg.CONF http_dispatcher_opts = [ cfg.StrOpt('target', - default='http://127.0.0.1:8000/results', + default=os.getenv('TARGET', 'http://127.0.0.1:8000/results'), help='The target where the http request will be sent. ' 'If this is not set, no data will be posted. For ' 'example: target = http://hostname:1234/path'), @@ -62,7 +62,8 @@ class HttpDispatcher(DispatchBase): "description": "yardstick test cases result", "pod_name": os.environ.get('NODE_NAME', 'unknown'), "installer": os.environ.get('INSTALLER_TYPE', 'unknown'), - "version": os.environ.get('YARDSTICK_VERSION', 'unknown') + "version": os.environ.get('YARDSTICK_VERSION', 'unknown'), + "build_tag": os.environ.get('BUILD_TAG') } def record_result_data(self, data): @@ -75,7 +76,7 @@ class HttpDispatcher(DispatchBase): 'be posted.') return - self.result["details"] = self.raw_result + self.result["details"] = {'results': self.raw_result} case_name = "" for v in self.raw_result: |