summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/quagga_access.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/quagga_access.py
parent637b5f9ba663b739de54069d91b1d87ddd3b4855 (diff)
scenario_test: add policy test cases for new action and conditions
Diffstat (limited to 'test/scenario_test/quagga_access.py')
-rw-r--r--test/scenario_test/quagga_access.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/scenario_test/quagga_access.py b/test/scenario_test/quagga_access.py
index f29cb301..634dc439 100644
--- a/test/scenario_test/quagga_access.py
+++ b/test/scenario_test/quagga_access.py
@@ -142,4 +142,19 @@ def lookup_prefix(tn, prefix, af):
path['Next Hop'] = nexthop
paths.append(path)
- return paths \ No newline at end of file
+ return paths
+
+def check_community(tn, addr, community, af=IPv4):
+ if af == IPv4:
+ tn.write("show ip bgp community " + community + "\n")
+ elif af == IPv6:
+ tn.write("show bgp ipv6 community " + community + "\n")
+ else:
+ print "invalid af: ", af
+ return
+ result = tn.read_until("bgpd#")
+ for line in result.split("\n"):
+ if addr in line:
+ return True
+
+ return False \ No newline at end of file