diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-08-10 02:10:59 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-08-12 08:04:31 +0900 |
commit | 5099fbe54de38f09d874e078caaaf4a5adaa66dc (patch) | |
tree | 8a258835a8077a34bb9b23586138f1d2ce3dfb10 /test/scenario_test/lib/quagga.py | |
parent | 5c066cc6a64b03126a737fb41954a62bae762806 (diff) |
test: add flowspec scenario test
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/scenario_test/lib/quagga.py')
-rw-r--r-- | test/scenario_test/lib/quagga.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/scenario_test/lib/quagga.py b/test/scenario_test/lib/quagga.py index 1099866a..e4de3ef1 100644 --- a/test/scenario_test/lib/quagga.py +++ b/test/scenario_test/lib/quagga.py @@ -161,14 +161,16 @@ class QuaggaBGPContainer(BGPContainer): c << 'neighbor {0} activate'.format(n_addr) c << 'exit-address-family' - for route in self.routes.iterkeys(): - version = netaddr.IPNetwork(route).version - if version == 4: - c << 'network {0}'.format(route) - elif version == 6: + for route in self.routes.itervalues(): + if route['rf'] == 'ipv4': + c << 'network {0}'.format(route['prefix']) + elif route['rf'] == 'ipv6': c << 'address-family ipv6 unicast' - c << 'network {0}'.format(route) + c << 'network {0}'.format(route['prefix']) c << 'exit-address-family' + else: + raise Exception('unsupported route faily: {0}'.format(route['rf'])) + for name, policy in self.policies.iteritems(): c << 'access-list {0} {1} {2}'.format(name, policy['type'], |