diff options
author | Naoto Hanaue <hanaue.naoto@po.ntts.co.jp> | 2015-07-01 16:06:24 +0900 |
---|---|---|
committer | Naoto Hanaue <hanaue.naoto@po.ntts.co.jp> | 2015-07-01 16:25:34 +0900 |
commit | 1adfa485d578af59b653c9b2d141b12a97e89fb7 (patch) | |
tree | 2a6a483317c32fd2b5e8e4670b5df92aa85eac65 /test/scenario_test/gobgp_test.py | |
parent | d045cdf59eb033ac7893bc2d65eab7f305648480 (diff) |
scenario_test: add the test of med actioin
Diffstat (limited to 'test/scenario_test/gobgp_test.py')
-rw-r--r-- | test/scenario_test/gobgp_test.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/scenario_test/gobgp_test.py b/test/scenario_test/gobgp_test.py index 452b7f7a..1333afad 100644 --- a/test/scenario_test/gobgp_test.py +++ b/test/scenario_test/gobgp_test.py @@ -321,6 +321,32 @@ class GoBGPTestBase(unittest.TestCase): return False + # get route information on quagga + def check_med(self, neighbor_address, target_addr, med, retry=3, interval=-1, af=IPv4): + if interval < 0: + interval = self.wait_per_retry + print "check route %s on quagga : %s" % (target_addr, neighbor_address) + retry_count = 0 + + while True: + tn = qaccess.login(neighbor_address) + result = qaccess.check_med(tn, target_addr, med, af) + qaccess.logout(tn) + + if result: + return True + else: + print "target path %s with med %s is none" % (target_addr, med) + + retry_count += 1 + if retry_count > retry: + break + else: + print "wait (" + str(interval) + " seconds)" + time.sleep(interval) + + return False + def compare_rib_with_quagga_configs(self, rib_owner_addr, local_rib): for quagga_config in self.quagga_configs: |