aboutsummaryrefslogtreecommitdiffstats
path: root/resources/templates/vat
diff options
context:
space:
mode:
authorselias <samelias@cisco.com>2017-02-28 16:28:25 +0100
committerselias <samelias@cisco.com>2017-02-28 16:28:25 +0100
commit9b9a6e379bfb8a7b99a66fba1940e5d2c31df4e5 (patch)
treee36fb9ebdf2f167a84caa3ebcd6b627033b59003 /resources/templates/vat
parent93f31102f8404b52b58a98e46c9c1c8eea7e2e67 (diff)
HC Test: Add missing VAT template - interface vrf dump
Change-Id: I5bf26d4091b86cb8e4f4efa4eb4a4793c758ebbb Signed-off-by: selias <samelias@cisco.com>
Diffstat (limited to 'resources/templates/vat')
-rw-r--r--resources/templates/vat/interface_vrf_dump.vat1
1 files changed, 1 insertions, 0 deletions
diff --git a/resources/templates/vat/interface_vrf_dump.vat b/resources/templates/vat/interface_vrf_dump.vat
new file mode 100644
index 0000000000..142a259c4e
--- /dev/null
+++ b/resources/templates/vat/interface_vrf_dump.vat
@@ -0,0 +1 @@
+sw_interface_get_table sw_if_index ${sw_if_index} \ No newline at end of file
=0, inet=AF_INET, mac=None): nbrs = test.vapi.ip_neighbor_dump(sw_if_index, is_ipv6=1 if AF_INET6 == inet else 0) if inet == AF_INET: s = 4 else: s = 16 nbr_addr = inet_pton(inet, ip_addr) for n in nbrs: if nbr_addr == n.ip_address[:s] \ and is_static == n.is_static: if mac: if n.mac_address == mactobinary(mac): return True else: return True return False class VppNeighbor(VppObject): """ ARP Entry """ def __init__(self, test, sw_if_index, mac_addr, nbr_addr, af=AF_INET, is_static=False, is_no_fib_entry=0): self._test = test self.sw_if_index = sw_if_index self.mac_addr = mactobinary(mac_addr) self.af = af self.is_static = is_static self.is_no_fib_entry = is_no_fib_entry self.nbr_addr = nbr_addr self.nbr_addr_n = inet_pton(af, nbr_addr) def add_vpp_config(self): r = self._test.vapi.ip_neighbor_add_del( self.sw_if_index, self.mac_addr, self.nbr_addr_n, is_add=1, is_ipv6=1 if AF_INET6 == self.af else 0, is_static=self.is_static, is_no_adj_fib=self.is_no_fib_entry) self.stats_index = r.stats_index self._test.registry.register(self, self._test.logger) def remove_vpp_config(self): self._test.vapi.ip_neighbor_add_del( self.sw_if_index, self.mac_addr, self.nbr_addr_n, is_ipv6=1 if AF_INET6 == self.af else 0, is_add=0, is_static=self.is_static) def query_vpp_config(self): return find_nbr(self._test, self.sw_if_index, self.nbr_addr, self.is_static, self.af) def __str__(self): return self.object_id() def object_id(self): return ("%d:%s" % (self.sw_if_index, self.nbr_addr)) def get_stats(self): c = self._test.statistics.get_counter("/net/adjacency") return c[0][self.stats_index]