diff options
author | Neale Ranns <nranns@cisco.com> | 2019-03-28 07:56:23 -0700 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-04-08 21:55:07 +0000 |
commit | 796c84b25130c99cfd92cc9281416d377d41d2a3 (patch) | |
tree | ee90f93e3cbb2e0a78ae62ea3a181239e4b36324 /test | |
parent | f324dec0a371431f9326f67e920630579741da3c (diff) |
GBP: drop and contract counters
Change-Id: Ib436512a26e53f70f7b5e47bf34224ab73e5244e
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/test_gbp.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/test/test_gbp.py b/test/test_gbp.py index ee842b33052..df529c6c880 100644 --- a/test/test_gbp.py +++ b/test/test_gbp.py @@ -447,13 +447,14 @@ class VppGbpContract(VppObject): rules = [] for r in self.rules: rules.append(r.encode()) - self._test.vapi.gbp_contract_add_del( + r = self._test.vapi.gbp_contract_add_del( 1, self.sclass, self.dclass, self.acl_index, rules, self.allowed_ethertypes) + self.stats_index = r.stats_index self._test.registry.register(self, self._test.logger) def remove_vpp_config(self): @@ -478,6 +479,14 @@ class VppGbpContract(VppObject): return True return False + def get_drop_stats(self): + c = self._test.statistics.get_counter("/net/gbp/contract/drop") + return c[0][self.stats_index] + + def get_permit_stats(self): + c = self._test.statistics.get_counter("/net/gbp/contract/permit") + return c[0][self.stats_index] + class VppGbpVxlanTunnel(VppInterface): """ @@ -1154,6 +1163,11 @@ class TestGBP(VppTestCase): pkt_inter_epg_221_to_220 * 65, eps[0].itf) + ds = c2.get_drop_stats() + self.assertEqual(ds['packets'], 0) + ps = c2.get_permit_stats() + self.assertEqual(ps['packets'], 65) + # # the contract does not allow non-IP # @@ -1425,6 +1439,8 @@ class TestGBP(VppTestCase): def test_gbp_learn_l2(self): """ GBP L2 Endpoint Learning """ + self.vapi.cli("clear errors") + ep_flags = VppEnum.vl_api_gbp_endpoint_flags_t learnt = [{'mac': '00:00:11:11:11:01', 'ip': '10.0.0.1', @@ -1533,6 +1549,10 @@ class TestGBP(VppTestCase): self.send_and_assert_no_replies(self.pg2, p) + self.logger.info(self.vapi.cli("sh error")) + # self.assert_packet_counter_equal( + # '/err/gbp-policy-port/drop-no-contract', 1) + # # we should not have learnt a new tunnel endpoint, since # the EPG was not learnt. @@ -1584,6 +1604,9 @@ class TestGBP(VppTestCase): vx_tun_l2_1.sw_if_index, ip=l['ip'])) + # self.assert_packet_counter_equal( + # '/err/gbp-policy-port/allow-intra-sclass', 2) + self.logger.info(self.vapi.cli("show gbp endpoint")) self.logger.info(self.vapi.cli("show gbp vxlan")) self.logger.info(self.vapi.cli("show ip mfib")) |