summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/route_server_malformed_test.py
diff options
context:
space:
mode:
authorNaoto Hanaue <hanaue.naoto@po.ntts.co.jp>2015-01-28 15:33:57 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-28 15:40:28 +0900
commit9de96e573df1b15d6fabc5b901467fea74526714 (patch)
treebf526afc571427ecf6108b659966d20974467f39 /test/scenario_test/route_server_malformed_test.py
parent5a6858c0c59393e8e2f464cbc093eb1b3cc820e1 (diff)
scenario_test: fix notification message in test case
Diffstat (limited to 'test/scenario_test/route_server_malformed_test.py')
-rw-r--r--test/scenario_test/route_server_malformed_test.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/scenario_test/route_server_malformed_test.py b/test/scenario_test/route_server_malformed_test.py
index 7bff94d3..4a2d90b6 100644
--- a/test/scenario_test/route_server_malformed_test.py
+++ b/test/scenario_test/route_server_malformed_test.py
@@ -36,8 +36,8 @@ def check_pattern():
"""
pattern = collections.OrderedDict()
pattern["malformed1-exabgp-gobgp-v4-MP_REACH_NLRI.conf"] = "UPDATE message error / Attribute Flags Error / 0x600F0411223344"
- pattern["malformed1-exabgp-gobgp-v4-AS_PATH.conf"] = "UPDATE message error / Malformed AS_PATH"
- pattern["malformed1-exabgp-gobgp-v4-AS4_PATH.conf"] = "UPDATE message error / Malformed AS_PATH"
+ pattern["malformed1-exabgp-gobgp-v4-AS_PATH.conf"] = "UPDATE message error / Attribute Flags Error / 0x60020411223344"
+ pattern["malformed1-exabgp-gobgp-v4-AS4_PATH.conf"] = "UPDATE message error / Attribute Flags Error / 0x60110411223344"
return pattern
@@ -77,12 +77,15 @@ def test_malformed_packet():
def check_em(exabgp_conf, result):
err_msg = fab.get_notification_from_exabgp_log()
- parse_msg = re.search(r'error.*', err_msg).group(0)
- notification_src = parse_msg[5:]
+ # parse_msg = re.search(r'error.*', err_msg).group(0)
+ notification = None
+ parse_msg = re.search(r'error.*', err_msg)
+ if parse_msg is not None:
+ notification_src = parse_msg.group(0)[5:]
+ notification = notification_src[1:-1]
print "notification message : "
- print " >>> " + notification_src
- notification = notification_src[1:-1]
+ print " >>> " + str(notification)
assert notification == result