summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2019-08-02 17:57:08 +0200
committerNeale Ranns <nranns@cisco.com>2019-08-14 07:39:42 +0000
commit6603567785d3aafe6532349ea761d0b93349b7f3 (patch)
treef23293d9eed77b8581f23847ac38f2f568646378 /test
parent1b3ce39809d753689f5eabedc9972898a073597b (diff)
gbp: add local l3out redirect to local SEP unit test
Type: test Change-Id: Ia6dad86d02f6f665a3e6960812b2527eaabb65f1 Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'test')
-rw-r--r--test/test_gbp.py39
1 files changed, 36 insertions, 3 deletions
diff --git a/test/test_gbp.py b/test/test_gbp.py
index 0b15eea78cb..2d7fa459440 100644
--- a/test/test_gbp.py
+++ b/test/test_gbp.py
@@ -3869,7 +3869,7 @@ class TestGBP(VppTestCase):
self.assertEqual(rx[IPv6].dst, "2001:10::88")
#
- # redirect to programmed remote SEP in EPG 320
+ # a programmed remote SEP in EPG 320
#
# gbp vxlan tunnel for the remote SEP
@@ -3891,7 +3891,7 @@ class TestGBP(VppTestCase):
sep5.add_vpp_config()
#
- # redirect from local l3out to remote (known, then unknown) SEP
+ # local l3out redirect tests
#
# add local l3out
@@ -3966,6 +3966,10 @@ class TestGBP(VppTestCase):
VppEnum.vl_api_gbp_subnet_type_t.GBP_API_SUBNET_L3_OUT,
sclass=4221).add_vpp_config()
+ #
+ # l3out redirect to remote (known, then unknown) SEP
+ #
+
# packets from 1 external subnet to the other
p = [(Ether(src=eep1.mac, dst=self.router_mac) /
Dot1Q(vlan=100) /
@@ -4041,7 +4045,36 @@ class TestGBP(VppTestCase):
self.assertEqual(rxip.dst, txip.dst)
#
- # redirect remote EP to remote SEP
+ # l3out redirect to local SEP
+ #
+
+ # change the contract between l3out to redirect to local SEPs
+ # instead of remote SEP
+ VppGbpContract(
+ self, 402, 4220, 4221, acl_index,
+ [VppGbpContractRule(
+ VppEnum.vl_api_gbp_rule_action_t.GBP_API_RULE_REDIRECT,
+ VppEnum.vl_api_gbp_hash_mode_t.GBP_API_HASH_MODE_DST_IP,
+ [VppGbpContractNextHop(sep1.vmac, sep1.epg.bd,
+ sep1.ip4, sep1.epg.rd)]),
+ VppGbpContractRule(
+ VppEnum.vl_api_gbp_rule_action_t.GBP_API_RULE_REDIRECT,
+ VppEnum.vl_api_gbp_hash_mode_t.GBP_API_HASH_MODE_DST_IP,
+ [VppGbpContractNextHop(sep1.vmac, sep1.epg.bd,
+ sep1.ip6, sep1.epg.rd)])],
+ [ETH_P_IP, ETH_P_IPV6]).add_vpp_config()
+
+ rxs = self.send_and_expect(self.pg0, p, sep1.itf)
+ for rx, tx in zip(rxs, p):
+ self.assertEqual(rx[Ether].src, routed_src_mac)
+ self.assertEqual(rx[Ether].dst, sep1.mac)
+ rxip = rx[Ether].payload
+ txip = tx[Ether].payload
+ self.assertEqual(rxip.src, txip.src)
+ self.assertEqual(rxip.dst, txip.dst)
+
+ #
+ # redirect remote EP to remote (known then unknown) SEP
#
# remote SEP known again