diff options
author | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-08-19 11:39:46 +0900 |
---|---|---|
committer | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-08-19 17:31:29 +0900 |
commit | fb91965dd47045339a78f2231169a9d32be52985 (patch) | |
tree | 91e6785c25bb3d1c753352615884d529b077ff5c /test/scenario_test/quagga_access.py | |
parent | 34c10c943f9b581285316f529a982d69bf9d8fd5 (diff) |
scenario_test: add ext-community action test
Diffstat (limited to 'test/scenario_test/quagga_access.py')
-rw-r--r-- | test/scenario_test/quagga_access.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/scenario_test/quagga_access.py b/test/scenario_test/quagga_access.py index 8e011398..51008b02 100644 --- a/test/scenario_test/quagga_access.py +++ b/test/scenario_test/quagga_access.py @@ -172,6 +172,25 @@ def check_community(tn, addr, community, af=IPv4): return False +def check_ext_community(tn, addr, community, af=IPv4): + if af == IPv4: + tn.write("show ip bgp " + addr + "\n") + elif af == IPv6: + tn.write("show bgp ipv6 " + addr + "\n") + else: + print "invalid af: ", af + return + result = tn.read_until("bgpd#") + for line in result.split("\n"): + if "Extended Community:" in line: + extcomms = line.split()[2:] + for e in extcomms: + if community == e: + return True + + return False + + def check_med(tn, addr, med, af=IPv4): if af == IPv4: tn.write("show ip bgp " + addr[0] + "\n") |