2.96. test_nat44_ed module¶
-
class
test_nat44_ed.
NAT44EDTestCase
(methodName='runTest')¶ Bases:
framework.VppTestCase
-
property
config_flags
¶
-
classmethod
configure_ip4_interface
(i, hosts=0, table_id=None)¶
-
classmethod
create_and_add_ip4_table
(i, table_id=0)¶
-
create_stream_frag
(src_if, dst, sport, dport, data, proto=scapy.data.IP_PROTOS.tcp, echo_reply=False)¶
-
create_stream_in
(in_if, out_if, dst_ip=None, ttl=64)¶
-
create_stream_out
(out_if, dst_ip=None, ttl=64, use_inside_ports=False)¶
-
create_tcp_stream
(in_if, out_if, count)¶
-
frag_in_order
(proto=scapy.data.IP_PROTOS.tcp, dont_translate=False, ignore_port=False)¶
-
frag_in_order_in_plus_out
(in_addr, out_addr, in_port, out_port, proto=scapy.data.IP_PROTOS.tcp)¶
-
frag_out_of_order
(proto=scapy.data.IP_PROTOS.tcp, dont_translate=False, ignore_port=False)¶
-
frag_out_of_order_in_plus_out
(in_addr, out_addr, in_port, out_port, proto=scapy.data.IP_PROTOS.tcp)¶
-
get_err_counter
(path)¶
-
icmp_id_in
= 6305¶
-
icmp_id_out
= 6305¶
-
init_tcp_session
(in_if, out_if, in_port, ext_port)¶
-
max_sessions
= 100¶
-
property
nat44_config_flags
¶
-
nat_add_address
(address, twice_nat=0, vrf_id=4294967295, is_add=1)¶
-
nat_add_inside_interface
(i)¶
-
classmethod
nat_add_interface_address
(i)¶
-
nat_add_outside_interface
(i)¶
-
nat_add_static_mapping
(local_ip, external_ip='0.0.0.0', local_port=0, external_port=0, vrf_id=0, is_add=1, external_sw_if_index=4294967295, proto=0, tag='', flags=0)¶
-
nat_addr
= '10.0.0.3'¶
-
plugin_disable
()¶
-
plugin_enable
()¶
-
static
proto2layer
(proto)¶
-
static
random_port
()¶
-
reass_frags_and_verify
(frags, src, dst)¶
-
reass_hairpinning
(server_addr, server_in_port, server_out_port, host_in_port, proto=scapy.data.IP_PROTOS.tcp, ignore_port=False)¶
-
property
server_addr
¶
-
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
-
property
syslog_severity
¶
-
tcp_external_port
= 80¶
-
tcp_port_in
= 6303¶
-
tcp_port_out
= 6303¶
-
tearDown
()¶ Show various debug prints after each test
-
twice_nat_common
(self_twice_nat=False, same_pg=False, lb=False, client_id=None)¶
-
udp_port_in
= 6304¶
-
udp_port_out
= 6304¶
-
verify_capture_in
(capture, in_if)¶
-
verify_capture_out
(capture, nat_ip=None, same_port=False, dst_ip=None, ignore_port=False)¶
-
verify_syslog_sess
(data, is_add=True, is_ip6=False)¶
-
property
-
class
test_nat44_ed.
TestNAT44ED
(methodName='runTest')¶ Bases:
test_nat44_ed.NAT44EDTestCase
NAT44ED Test Case
-
test_forwarding
()¶ NAT44ED forwarding test
-
test_frag_out_of_order_do_not_translate
()¶ NAT44ED don’t translate fragments arriving out of order
-
test_lb_affinity
()¶ NAT44ED local service load balancing affinity
-
test_multiple_vrf_1
()¶ Multiple VRF - both client & service in VRF1
-
test_multiple_vrf_2
()¶ Multiple VRF - dynamic NAT from VRF1 to VRF0 (output-feature)
-
test_multiple_vrf_3
()¶ Multiple VRF - client in VRF1, service in VRF0
-
test_multiple_vrf_4
()¶ Multiple VRF - client in VRF0, service in VRF1
-
test_multiple_vrf_5
()¶ Multiple VRF - forwarding - no translation
-
test_output_feature
()¶ NAT44ED interface output feature (in2out postrouting)
-
test_output_feature_and_service2
()¶ NAT44ED interface output feature and service host direct access
-
test_outside_address_distribution
()¶ Outside address distribution based on source address
-
test_self_twice_nat_lb_positive
()¶ NAT44ED Self Twice NAT local service load balancing (positive test)
-
test_self_twice_nat_positive
()¶ NAT44ED Self Twice NAT (positive test)
-
test_static_lb
()¶ NAT44ED local service load balancing
-
test_static_lb_2
()¶ NAT44ED local service load balancing (asymmetrical rule)
-
test_static_with_port_out2
()¶ NAT44ED 1:1 NAPT asymmetrical rule
-
test_twice_nat
()¶ NAT44ED Twice NAT
-
test_twice_nat_lb
()¶ NAT44ED Twice NAT local service load balancing
-
test_users_dump
()¶ NAT44ED API test - nat44_user_dump
-
-
class
test_nat44_ed.
TestNAT44EDMW
(methodName='runTest')¶ Bases:
test_nat44_ed.TestNAT44ED
NAT44ED MW Test Case
-
max_sessions
= 5000¶
-
test_dynamic
()¶ NAT44ED dynamic translation test
-
test_dynamic_out_of_ports
()¶ NAT44ED dynamic translation test: out of ports
-
test_dynamic_output_feature_vrf
()¶ NAT44ED dynamic translation test: output-feature, VRF
-
test_dynamic_vrf
()¶ NAT44ED dynamic translation test: different VRF
-
test_forwarding
()¶ NAT44ED forwarding test
-
test_frag_in_order
()¶ NAT44ED translate fragments arriving in order
-
test_frag_in_order_do_not_translate
()¶ NAT44ED don’t translate fragments arriving in order
-
test_frag_in_order_in_plus_out
()¶ NAT44ED in+out interface fragments in order
-
test_frag_out_of_order
()¶ NAT44ED translate fragments arriving out of order
-
test_frag_out_of_order_do_not_translate
()¶ NAT44ED don’t translate fragments arriving out of order
-
test_frag_out_of_order_in_plus_out
()¶ NAT44ED in+out interface fragments out of order
-
test_hairpinning_unknown_proto
()¶ NAT44ED translate packet with unknown protocol - hairpinning
-
test_lb_affinity
()¶ NAT44ED local service load balancing affinity
-
test_lru_cleanup
()¶ NAT44ED LRU cleanup algorithm
-
test_multiple_vrf
()¶ NAT44ED Multiple VRF setup
-
test_next_src_nat
()¶ NAT44ED On way back forward packet to nat44-in2out node.
-
test_one_armed_nat44_static
()¶ NAT44ED One armed NAT and 1:1 NAPT asymmetrical rule
-
test_output_feature
()¶ NAT44ED interface output feature (in2out postrouting)
-
test_output_feature_and_service
()¶ NAT44ED interface output feature and services
-
test_output_feature_and_service2
()¶ NAT44ED interface output feature and service host direct access
-
test_output_feature_and_service3
()¶ NAT44ED interface output feature and DST NAT
-
test_output_feature_stateful_acl
()¶ NAT44ED output feature works with stateful ACL
-
test_reass_hairpinning
()¶ NAT44ED fragments hairpinning
-
test_self_twice_nat_lb_negative
()¶ NAT44ED Self Twice NAT local service load balancing (negative test)
-
test_self_twice_nat_lb_positive
()¶ NAT44ED Self Twice NAT local service load balancing (positive test)
-
test_self_twice_nat_negative
()¶ NAT44ED Self Twice NAT (negative test)
-
test_self_twice_nat_positive
()¶ NAT44ED Self Twice NAT (positive test)
-
test_session_limit_per_vrf
()¶ NAT44ED per vrf session limit
-
test_session_rst_timeout
()¶ NAT44ED session RST timeouts
-
test_show_max_translations
()¶ NAT44ED API test - max translations per thread
-
test_static_lb
()¶ NAT44ED local service load balancing
-
test_static_lb_2
()¶ NAT44ED local service load balancing (asymmetrical rule)
-
test_static_lb_multi_clients
()¶ NAT44ED local service load balancing - multiple clients
-
test_static_with_port_out2
()¶ NAT44ED 1:1 NAPT asymmetrical rule
-
test_syslog_sess
()¶ NAT44ED Test syslog session creation and deletion
-
test_tcp_close
()¶ NAT44ED Close TCP session from inside network - output feature
-
test_tcp_session_close_in
()¶ NAT44ED Close TCP session from inside network
-
test_tcp_session_close_out
()¶ NAT44ED Close TCP session from outside network
-
test_tcp_session_close_simultaneous
()¶ NAT44ED Close TCP session from inside network
-
test_twice_nat
()¶ NAT44ED Twice NAT
-
test_twice_nat_interface_addr
()¶ NAT44ED Acquire twice NAT addresses from interface
-
test_twice_nat_lb
()¶ NAT44ED Twice NAT local service load balancing
-
test_unknown_proto
()¶ NAT44ED translate packet with unknown protocol
-
test_users_dump
()¶ NAT44ED API test - nat44_user_dump
-
vpp_worker_count
= 4¶
-