summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/gobgp_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/scenario_test/gobgp_test.py')
-rw-r--r--test/scenario_test/gobgp_test.py26
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: