diff options
author | Ole Troan <ot@cisco.com> | 2017-10-20 13:28:20 +0200 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2017-10-25 17:16:56 +0000 |
commit | 895b6e8b4408108a9b5cea99dcb378c3524b18b2 (patch) | |
tree | e9100c39d04dfa65469e8c9895c8e3d1fe44c394 /test/test_nat.py | |
parent | 5f3fcb96296a4769f55f60270e10c6294c604db9 (diff) |
VPP-1033: Python API support arbitrary sized input parameters.
Dynamically calculate the required buffer size to pack into based on
message definition. Also add input parameter length checking.
Change-Id: I7633bec596e4833bb328fbf63a65b866c7985de5
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'test/test_nat.py')
-rw-r--r-- | test/test_nat.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/test/test_nat.py b/test/test_nat.py index 2afa1dd26df..792b21b418f 100644 --- a/test/test_nat.py +++ b/test/test_nat.py @@ -16,6 +16,7 @@ from util import ppp from ipfix import IPFIX, Set, Template, Data, IPFIXDecoder from time import sleep from util import ip4_range +from util import mactobinary class MethodHolder(VppTestCase): @@ -659,7 +660,9 @@ class TestNAT44(MethodHolder): lb_sm.external_port, lb_sm.protocol, lb_sm.vrf_id, - is_add=0) + is_add=0, + local_num=0, + locals=[]) adresses = self.vapi.nat44_address_dump() for addr in adresses: @@ -1885,11 +1888,11 @@ class TestNAT44(MethodHolder): """ NAT44 interfaces without configured IP address """ self.vapi.ip_neighbor_add_del(self.pg7.sw_if_index, - self.pg7.remote_mac, + mactobinary(self.pg7.remote_mac), self.pg7.remote_ip4n, is_static=1) self.vapi.ip_neighbor_add_del(self.pg8.sw_if_index, - self.pg8.remote_mac, + mactobinary(self.pg8.remote_mac), self.pg8.remote_ip4n, is_static=1) @@ -1927,11 +1930,11 @@ class TestNAT44(MethodHolder): """ NAT44 interfaces without configured IP address - 1:1 NAT """ self.vapi.ip_neighbor_add_del(self.pg7.sw_if_index, - self.pg7.remote_mac, + mactobinary(self.pg7.remote_mac), self.pg7.remote_ip4n, is_static=1) self.vapi.ip_neighbor_add_del(self.pg8.sw_if_index, - self.pg8.remote_mac, + mactobinary(self.pg8.remote_mac), self.pg8.remote_ip4n, is_static=1) @@ -1973,11 +1976,11 @@ class TestNAT44(MethodHolder): self.icmp_id_out = 30608 self.vapi.ip_neighbor_add_del(self.pg7.sw_if_index, - self.pg7.remote_mac, + mactobinary(self.pg7.remote_mac), self.pg7.remote_ip4n, is_static=1) self.vapi.ip_neighbor_add_del(self.pg8.sw_if_index, - self.pg8.remote_mac, + mactobinary(self.pg8.remote_mac), self.pg8.remote_ip4n, is_static=1) |