X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Fbenchmark%2Fscenarios%2Favailability%2Fserviceha.py;h=b981c8cd8f4c63760f024efd50f4ea915b8a367d;hb=f036e9898a69f5041f9cde02e3652c29e2de1643;hp=aee94ee09d17138e20c77868d63eb62b5e54dc2a;hpb=ea99867bd2a0618aff12ed977330d69467544dfd;p=yardstick.git diff --git a/yardstick/benchmark/scenarios/availability/serviceha.py b/yardstick/benchmark/scenarios/availability/serviceha.py index aee94ee09..b981c8cd8 100755 --- a/yardstick/benchmark/scenarios/availability/serviceha.py +++ b/yardstick/benchmark/scenarios/availability/serviceha.py @@ -6,6 +6,8 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +from __future__ import print_function +from __future__ import absolute_import import logging from yardstick.benchmark.scenarios import base from yardstick.benchmark.scenarios.availability.monitor import basemonitor @@ -21,8 +23,8 @@ class ServiceHA(base.Scenario): def __init__(self, scenario_cfg, context_cfg): LOG.debug( - "scenario_cfg:%s context_cfg:%s" % - (scenario_cfg, context_cfg)) + "scenario_cfg:%s context_cfg:%s", + scenario_cfg, context_cfg) self.scenario_cfg = scenario_cfg self.context_cfg = context_cfg self.setup_done = False @@ -66,6 +68,10 @@ class ServiceHA(base.Scenario): LOG.info("monitor stop!") sla_pass = self.monitorMgr.verify_SLA() + if sla_pass: + result['sla_pass'] = 1 + else: + result['sla_pass'] = 0 assert sla_pass is True, "the test cases is not pass the SLA" return @@ -105,15 +111,16 @@ def _test(): # pragma: no cover sla = {"outage_time": 5} args = {"options": options, "sla": sla} - print "create instance" + print("create instance") terstInstance = ServiceHA(args, ctx) terstInstance.setup() result = {} terstInstance.run(result) - print result + print(result) terstInstance.teardown() + if __name__ == '__main__': # pragma: no cover _test()