2.99. test_nat64 module¶
- class test_nat64.TestNAT64(methodName='runTest')¶
Bases:
framework.VppTestCaseNAT64 Test Cases
- property SYSLOG_SEVERITY¶
- clear_nat64()¶
Clear NAT64 configuration.
- compose_ip6(ip4, pref, plen)¶
Compose IPv4-embedded IPv6 addresses
- Parameters
ip4 – IPv4 address
pref – IPv6 prefix
plen – IPv6 prefix length
- Returns
IPv4-embedded IPv6 addresses
- property config_flags¶
- create_stream_frag(src_if, dst, sport, dport, data, proto=6, echo_reply=False)¶
Create fragmented packet stream
- Parameters
src_if – Source interface
dst – Destination IPv4 address
sport – Source port
dport – Destination port
data – Payload data
proto – protocol (TCP, UDP, ICMP)
echo_reply – use echo_reply if protocol is ICMP
- Returns
Fragments
- create_stream_frag_ip6(src_if, dst, sport, dport, data, pref=None, plen=0, frag_size=128)¶
Create fragmented packet stream
- Parameters
src_if – Source interface
dst – Destination IPv4 address
sport – Source TCP port
dport – Destination TCP port
data – Payload data
pref – NAT64 prefix
plen – NAT64 prefix length
fragsize – size of fragments
- Returns
Fragments
- create_stream_in_ip6(in_if, out_if, hlim=64, pref=None, plen=0)¶
Create IPv6 packet stream for inside network
- Parameters
in_if – Inside interface
out_if – Outside interface
ttl – Hop Limit of generated packets
pref – NAT64 prefix
plen – NAT64 prefix length
- create_stream_out(out_if, dst_ip=None, ttl=64, use_inside_ports=False)¶
Create packet stream for outside network
- Parameters
out_if – Outside interface
dst_ip – Destination IP address (Default use global NAT address)
ttl – TTL of generated packets
use_inside_ports – Use inside NAT ports as destination ports instead of outside ports
- nat64_get_ses_num()¶
Return number of active NAT64 sessions.
- reass_frags_and_verify(frags, src, dst)¶
Reassemble and verify fragmented packet
- Parameters
frags – Captured fragments
src – Source IPv4 address to verify
dst – Destination IPv4 address to verify
- Returns
Reassembled IPv4 packet
- reass_frags_and_verify_ip6(frags, src, dst)¶
Reassemble and verify fragmented packet
- Parameters
frags – Captured fragments
src – Source IPv6 address to verify
dst – Destination IPv6 address to verify
- Returns
Reassembled IPv6 packet
- setUp()¶
Clear trace before running each test
- classmethod setUpClass()¶
Perform class setup before running the testcase Remove shared memory files, start vpp and connect the vpp-api
- show_commands_at_teardown()¶
Allow subclass specific teardown logging additions.
- tearDown()¶
Show various debug prints after each test
- classmethod tearDownClass()¶
Perform final cleanup after running all tests in this test-case
- test_dynamic()¶
NAT64 dynamic translation test
- test_frag_in_order()¶
NAT64 translate fragments arriving in order
- test_frag_out_of_order()¶
NAT64 translate fragments arriving out of order
- test_hairpinning()¶
NAT64 hairpinning
- test_hairpinning_unknown_proto()¶
NAT64 translate packet with unknown protocol - hairpinning
- test_icmp_error()¶
NAT64 ICMP Error message translation
- test_interface()¶
Enable/disable NAT64 feature on the interface
- test_interface_addr()¶
Acquire NAT64 pool addresses from interface
- test_ipfix_bib_ses()¶
IPFIX logging NAT64 BIB/session create and delete events
- test_ipfix_max_bibs_sessions()¶
IPFIX logging maximum session and BIB entries exceeded
- test_nat64_inside_interface_handles_neighbor_advertisement()¶
NAT64 inside interface handles Neighbor Advertisement
- test_one_armed_nat64()¶
One armed NAT64
- test_pool()¶
Add/delete address to NAT64 pool
- test_prefix()¶
NAT64 Network-Specific Prefix
- test_reass_hairpinning()¶
NAT64 fragments hairpinning
- test_session_timeout()¶
NAT64 session timeout
- test_set_timeouts()¶
Set NAT64 timeouts
- test_static()¶
NAT64 static translation test
- test_static_bib()¶
Add/delete static BIB entry
- test_syslog_sess()¶
Test syslog session creation and deletion
- test_tags = [<TestCaseTag.FIXME_VPP_WORKERS: 2>]¶
- test_unknown_proto()¶
NAT64 translate packet with unknown protocol
- verify_capture_in_ip6(capture, src_ip, dst_ip)¶
Verify captured IPv6 packets on inside network
- Parameters
capture – Captured packets
src_ip – Source IP
dst_ip – Destination IP address
- verify_capture_out(capture, nat_ip=None, same_port=False, dst_ip=None, is_ip6=False, ignore_port=False)¶
Verify captured packets on outside network
- Parameters
capture – Captured packets
nat_ip – Translated IP address (Default use global NAT address)
same_port – Source port number is not translated (Default False)
dst_ip – Destination IP address (Default do not verify)
is_ip6 – If L3 protocol is IPv6 (Default False)
- verify_ipfix_bib(data, is_create, src_addr)¶
Verify IPFIX NAT64 BIB create and delete events
- Parameters
data – Decoded IPFIX data records
is_create – Create event if nonzero value otherwise delete event
src_addr – IPv6 source address
- verify_ipfix_max_bibs(data, limit)¶
Verify IPFIX maximum BIB entries exceeded event
- Parameters
data – Decoded IPFIX data records
limit – Number of maximum BIB entries that can be created.
- verify_ipfix_max_sessions(data, limit)¶
Verify IPFIX maximum session entries exceeded event
- Parameters
data – Decoded IPFIX data records
limit – Number of maximum session entries that can be created.
- verify_ipfix_nat64_ses(data, is_create, src_addr, dst_addr, dst_port)¶
Verify IPFIX NAT64 session create and delete events
- Parameters
data – Decoded IPFIX data records
is_create – Create event if nonzero value otherwise delete event
src_addr – IPv6 source address
dst_addr – IPv4 destination address
dst_port – destination TCP port
- verify_syslog_sess(data, is_add=True, is_ip6=False)¶