diff options
author | Naoto Hanaue <hanaue.naoto@po.ntts.co.jp> | 2015-01-28 15:33:57 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-28 15:40:28 +0900 |
commit | 9de96e573df1b15d6fabc5b901467fea74526714 (patch) | |
tree | bf526afc571427ecf6108b659966d20974467f39 /test/scenario_test | |
parent | 5a6858c0c59393e8e2f464cbc093eb1b3cc820e1 (diff) |
scenario_test: fix notification message in test case
Diffstat (limited to 'test/scenario_test')
-rw-r--r-- | test/scenario_test/route_server_malformed_test.py | 15 | ||||
-rw-r--r-- | test/scenario_test/route_server_test.py | 3 |
2 files changed, 10 insertions, 8 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 diff --git a/test/scenario_test/route_server_test.py b/test/scenario_test/route_server_test.py index 2d40176c..36bac41a 100644 --- a/test/scenario_test/route_server_test.py +++ b/test/scenario_test/route_server_test.py @@ -139,7 +139,7 @@ class GoBGPTest(unittest.TestCase): if c_path.network.split("/")[0] == q_path['Network'] and c_path.nexthop == q_path['Next Hop']: exist_n += 1 self.assertEqual(exist_n, 1) - """ + # check if quagga that is appended can establish connection with gobgp def test_04_established_with_appended_quagga(self): print "test_established_with_appended_quagga" @@ -323,7 +323,6 @@ class GoBGPTest(unittest.TestCase): if c_path.network.split("/")[0] == q_path['Network'] and c_path.nexthop == q_path['Next Hop']: exist_n += 1 self.assertEqual(exist_n, 1) - """ def test_10_bestpath_selection_of_received_route(self): print "test_bestpath_selection_of_received_route" |