tests: fix pep8
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:

committed by
FUJITA Tomonori

parent
c468fdd126
commit
bd61cd5dd1
@@ -547,7 +547,7 @@ class RunTest(tester.TestFlowBase):
|
|||||||
|
|
||||||
match = dp.ofproto_parser.OFPMatch()
|
match = dp.ofproto_parser.OFPMatch()
|
||||||
match.set_dl_dst('\xff' * 6)
|
match.set_dl_dst('\xff' * 6)
|
||||||
table_id=3
|
table_id = 3
|
||||||
self.mod_flow(dp, command=dp.ofproto.OFPFC_MODIFY,
|
self.mod_flow(dp, command=dp.ofproto.OFPFC_MODIFY,
|
||||||
actions=[action], table_id=table_id, match=match)
|
actions=[action], table_id=table_id, match=match)
|
||||||
|
|
||||||
@@ -567,7 +567,7 @@ class RunTest(tester.TestFlowBase):
|
|||||||
match = dp.ofproto_parser.OFPMatch()
|
match = dp.ofproto_parser.OFPMatch()
|
||||||
match.set_dl_dst('\xee' * 6)
|
match.set_dl_dst('\xee' * 6)
|
||||||
priority = 100
|
priority = 100
|
||||||
table_id=2
|
table_id = 2
|
||||||
self.mod_flow(dp, command=dp.ofproto.OFPFC_MODIFY_STRICT,
|
self.mod_flow(dp, command=dp.ofproto.OFPFC_MODIFY_STRICT,
|
||||||
actions=[action], table_id=table_id,
|
actions=[action], table_id=table_id,
|
||||||
match=match, priority=priority)
|
match=match, priority=priority)
|
||||||
|
@@ -125,7 +125,7 @@ class VRRPCommon(app_manager.RyuApp):
|
|||||||
_PRIMARY_IP_ADDRESS0,
|
_PRIMARY_IP_ADDRESS0,
|
||||||
self._IFNAME0,
|
self._IFNAME0,
|
||||||
vrid)
|
vrid)
|
||||||
assert not rep0.instance_name is None
|
assert rep0.instance_name is not None
|
||||||
l[0] = rep0
|
l[0] = rep0
|
||||||
prio = max(vrrp.VRRP_PRIORITY_BACKUP_MIN,
|
prio = max(vrrp.VRRP_PRIORITY_BACKUP_MIN,
|
||||||
min(vrrp.VRRP_PRIORITY_BACKUP_MAX, 256 - vrid))
|
min(vrrp.VRRP_PRIORITY_BACKUP_MAX, 256 - vrid))
|
||||||
@@ -134,7 +134,7 @@ class VRRPCommon(app_manager.RyuApp):
|
|||||||
_PRIMARY_IP_ADDRESS1,
|
_PRIMARY_IP_ADDRESS1,
|
||||||
self._IFNAME1,
|
self._IFNAME1,
|
||||||
vrid)
|
vrid)
|
||||||
assert not rep1.instance_name is None
|
assert rep1.instance_name is not None
|
||||||
l[1] = rep1
|
l[1] = rep1
|
||||||
instances[vrid] = l
|
instances[vrid] = l
|
||||||
|
|
||||||
@@ -143,12 +143,12 @@ class VRRPCommon(app_manager.RyuApp):
|
|||||||
rep0 = self._configure_vrrp_router(vrrp_version, priority,
|
rep0 = self._configure_vrrp_router(vrrp_version, priority,
|
||||||
_PRIMARY_IP_ADDRESS0,
|
_PRIMARY_IP_ADDRESS0,
|
||||||
self._IFNAME0, _VRID)
|
self._IFNAME0, _VRID)
|
||||||
assert not rep0.instance_name is None
|
assert rep0.instance_name is not None
|
||||||
l[0] = rep0
|
l[0] = rep0
|
||||||
rep1 = self._configure_vrrp_router(
|
rep1 = self._configure_vrrp_router(
|
||||||
vrrp_version, vrrp.VRRP_PRIORITY_BACKUP_DEFAULT,
|
vrrp_version, vrrp.VRRP_PRIORITY_BACKUP_DEFAULT,
|
||||||
_PRIMARY_IP_ADDRESS1, self._IFNAME1, _VRID)
|
_PRIMARY_IP_ADDRESS1, self._IFNAME1, _VRID)
|
||||||
assert not rep1.instance_name is None
|
assert rep1.instance_name is not None
|
||||||
l[1] = rep1
|
l[1] = rep1
|
||||||
instances[_VRID] = l
|
instances[_VRID] = l
|
||||||
|
|
||||||
|
@@ -86,7 +86,7 @@ INTERVAL = 1 # sec
|
|||||||
WAIT_TIMER = 3 # sec
|
WAIT_TIMER = 3 # sec
|
||||||
CONTINUOUS_THREAD_INTVL = float(0.01) # sec
|
CONTINUOUS_THREAD_INTVL = float(0.01) # sec
|
||||||
CONTINUOUS_PROGRESS_SPAN = 3 # sec
|
CONTINUOUS_PROGRESS_SPAN = 3 # sec
|
||||||
THROUGHPUT_PRIORITY = ofproto_v1_3.OFP_DEFAULT_PRIORITY+1
|
THROUGHPUT_PRIORITY = ofproto_v1_3.OFP_DEFAULT_PRIORITY + 1
|
||||||
THROUGHPUT_COOKIE = THROUGHPUT_PRIORITY
|
THROUGHPUT_COOKIE = THROUGHPUT_PRIORITY
|
||||||
THROUGHPUT_THRESHOLD = float(0.10) # expected throughput plus/minus 10 %
|
THROUGHPUT_THRESHOLD = float(0.10) # expected throughput plus/minus 10 %
|
||||||
|
|
||||||
@@ -1224,7 +1224,7 @@ class Test(stringify.StringifyMixin):
|
|||||||
|
|
||||||
# parse 'prerequisite'
|
# parse 'prerequisite'
|
||||||
prerequisite = []
|
prerequisite = []
|
||||||
if not KEY_PREREQ in buf:
|
if KEY_PREREQ not in buf:
|
||||||
raise ValueError('a test requires a "%s" block' % KEY_PREREQ)
|
raise ValueError('a test requires a "%s" block' % KEY_PREREQ)
|
||||||
allowed_mod = [KEY_FLOW, KEY_METER]
|
allowed_mod = [KEY_FLOW, KEY_METER]
|
||||||
for flow in buf[KEY_PREREQ]:
|
for flow in buf[KEY_PREREQ]:
|
||||||
@@ -1242,7 +1242,7 @@ class Test(stringify.StringifyMixin):
|
|||||||
|
|
||||||
# parse 'tests'
|
# parse 'tests'
|
||||||
tests = []
|
tests = []
|
||||||
if not KEY_TESTS in buf:
|
if KEY_TESTS not in buf:
|
||||||
raise ValueError('a test requires a "%s" block.' % KEY_TESTS)
|
raise ValueError('a test requires a "%s" block.' % KEY_TESTS)
|
||||||
|
|
||||||
for test in buf[KEY_TESTS]:
|
for test in buf[KEY_TESTS]:
|
||||||
@@ -1253,7 +1253,7 @@ class Test(stringify.StringifyMixin):
|
|||||||
KEY_PKT_IN, KEY_TBL_MISS))
|
KEY_PKT_IN, KEY_TBL_MISS))
|
||||||
test_pkt = {}
|
test_pkt = {}
|
||||||
# parse 'ingress'
|
# parse 'ingress'
|
||||||
if not KEY_INGRESS in test:
|
if KEY_INGRESS not in test:
|
||||||
raise ValueError('a test requires "%s" field.' % KEY_INGRESS)
|
raise ValueError('a test requires "%s" field.' % KEY_INGRESS)
|
||||||
if isinstance(test[KEY_INGRESS], list):
|
if isinstance(test[KEY_INGRESS], list):
|
||||||
test_pkt[KEY_INGRESS] = __test_pkt_from_json(test[KEY_INGRESS])
|
test_pkt[KEY_INGRESS] = __test_pkt_from_json(test[KEY_INGRESS])
|
||||||
|
@@ -207,9 +207,9 @@ class RyuTestResult(result.TextTestResult):
|
|||||||
if current_case != self._last_case:
|
if current_case != self._last_case:
|
||||||
self.stream.writeln(current_case)
|
self.stream.writeln(current_case)
|
||||||
self._last_case = current_case
|
self._last_case = current_case
|
||||||
#NOTE(salvatore-orlando):
|
# NOTE(salvatore-orlando):
|
||||||
#slightly changed in order to print test case class
|
# slightly changed in order to print test case class
|
||||||
#together with unit test name
|
# together with unit test name
|
||||||
self.stream.write(
|
self.stream.write(
|
||||||
' %s' % str(test.test).ljust(60))
|
' %s' % str(test.test).ljust(60))
|
||||||
self.stream.flush()
|
self.stream.flush()
|
||||||
|
Reference in New Issue
Block a user