summaryrefslogtreecommitdiffstats
path: root/test/test_snat.py
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2017-02-14 23:33:43 -0800
committerOle Trøan <otroan@employees.org>2017-02-15 13:24:37 +0000
commite22e546f6c907e8e86d2c4cb82200ed627c7c4e5 (patch)
tree489a80241cc2828a17188fb366588c6c0e3e5a35 /test/test_snat.py
parentaeeac3bf4429235c952ce54abad7d3729be6a2f5 (diff)
SNAT: add static mappings with unresolved external interface address to snat_static_mapping_dump
Change-Id: Ib560b397700fe058ad1e2970989d98e3debf54aa Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'test/test_snat.py')
-rw-r--r--test/test_snat.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/test_snat.py b/test/test_snat.py
index 967d4b37c71..9d2070a078c 100644
--- a/test/test_snat.py
+++ b/test/test_snat.py
@@ -790,9 +790,11 @@ class TestSNAT(VppTestCase):
self.snat_add_static_mapping('1.2.3.4',
external_sw_if_index=self.pg7.sw_if_index)
- # no static mappings
+ # static mappings with external interface
static_mappings = self.vapi.snat_static_mapping_dump()
- self.assertEqual(0, len(static_mappings))
+ self.assertEqual(1, len(static_mappings))
+ self.assertEqual(self.pg7.sw_if_index,
+ static_mappings[0].external_sw_if_index)
# configure interface address and check static mappings
self.pg7.config_ip4()
@@ -800,6 +802,7 @@ class TestSNAT(VppTestCase):
self.assertEqual(1, len(static_mappings))
self.assertEqual(static_mappings[0].external_ip_address[0:4],
self.pg7.local_ip4n)
+ self.assertEqual(0xFFFFFFFF, static_mappings[0].external_sw_if_index)
# remove interface address and check static mappings
self.pg7.unconfig_ip4()