summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/gobgp_test.py
diff options
context:
space:
mode:
authorHiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>2015-05-25 11:33:21 +0900
committerHiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>2015-05-27 21:04:43 +0900
commit497412e120d80844e55c79fbe47ce62fbec26edc (patch)
treee0cdfc6061454ae87aecee30d5d659a267cbdedb /test/scenario_test/gobgp_test.py
parent637b5f9ba663b739de54069d91b1d87ddd3b4855 (diff)
scenario_test: add policy test cases for new action and conditions
Diffstat (limited to 'test/scenario_test/gobgp_test.py')
-rw-r--r--test/scenario_test/gobgp_test.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/scenario_test/gobgp_test.py b/test/scenario_test/gobgp_test.py
index 4fc39ffc..030bf9c4 100644
--- a/test/scenario_test/gobgp_test.py
+++ b/test/scenario_test/gobgp_test.py
@@ -297,6 +297,34 @@ class GoBGPTestBase(unittest.TestCase):
print "route : %s is none" % target_prefix
return None
+
+ # get route information on quagga
+ def check_community(self, neighbor_address, target_addr, community, 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_community(tn, target_addr, community, af)
+ qaccess.logout(tn)
+
+ if result:
+ return True
+ else:
+ print "target path %s with community %s is none" % (target_addr, community)
+
+ 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: