The current test was checking if the original related traffic is being correctly translated. Add related traffic in reply direction to ensure that it works both ways, and we don't break that behavior in the future.
Signed-off-by: Ales Musil <[email protected]> --- tests/system-ovn.at | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tests/system-ovn.at b/tests/system-ovn.at index e5b1fd43c..a98fa30a4 100644 --- a/tests/system-ovn.at +++ b/tests/system-ovn.at @@ -9142,15 +9142,19 @@ client_udp=00000000100000000000101008004500001C000040000A11D162C0A80A0AC0A\ 814140001000200080000 server_udp=00000000200000000000201008004500001C000040000A11D16CC0A8140AC0A\ 80A0A0002000100080000 -icmp=000000001000000000001010080045000038011F0000FF011B37C0A80A0AC0A814140\ +client_icmp=000000001000000000001010080045000038011F0000FF011B37C0A80A0AC0A814140\ 304F778000005784500001c000040000911d262c0a81414c0a80a0a0002000100080000 +server_icmp=000000002000000000002010080045000038011F0000FF011B41C0A8140AC0A80A0A0\ +304F778000005784500001C000040000911D26CC0A80A0AC0A8140A0001000200080000 # Define expected packets client_udp_expected=00000000101000000000100008004500001c000040000911d262c0a\ 81414c0a80a0a0002000100080000 server_udp_expected=00000000201000000000200008004500001c000040000911d26cc0a8\ 0a0ac0a8140a0001000200080000 -icmp_expected=000000002010000000002000080045000038011f0000fe011c41c0a80a0ac0\ +client_icmp_expected=000000001010000000001000080045000038011f0000fe011c37c0a81414c0a\ +80a0a0304f778000005784500001c000040000911d262c0a80a0ac0a814140001000200080000 +server_icmp_expected=000000002010000000002000080045000038011f0000fe011c41c0a80a0ac0\ a8140a0304f778000005784500001c000040000911d26cc0a8140ac0a80a0a0002000100080000 test_related_traffic() { @@ -9168,16 +9172,22 @@ test_related_traffic() { # Send UDP client -> server check ovs-ofctl packet-out br-int "in_port=ovs-client,packet=$client_udp,actions=resubmit(,0)" + # Send ICMP "need to frag" server -> client + check ovs-ofctl packet-out br-int "in_port=ovs-server,packet=$server_icmp,actions=resubmit(,0)" + # Send reply server -> client check ovs-ofctl packet-out br-int "in_port=ovs-server,packet=$server_udp,actions=resubmit(,0)" # Send ICMP "need to frag" client -> server - check ovs-ofctl packet-out br-int "in_port=ovs-client,packet=$icmp,actions=resubmit(,0)" + check ovs-ofctl packet-out br-int "in_port=ovs-client,packet=$client_icmp,actions=resubmit(,0)" + + ovs-ofctl dump-flows br-int table=$(ovn-debug lflow-stage-to-oftable lr_in_defrag) # Check if all packets have arrived WAIT_PACKET([server.pcap], [$server_udp_expected]) + WAIT_PACKET([client.pcap], [$client_icmp_expected]) WAIT_PACKET([client.pcap], [$client_udp_expected]) - WAIT_PACKET([server.pcap], [$icmp_expected]) + WAIT_PACKET([server.pcap], [$server_icmp_expected]) kill $(cat tcpdump0.pid) $(cat tcpdump1.pid) kill $(cat nc0.pid) $(cat nc1.pid) @@ -9222,7 +9232,7 @@ udp,orig=(src=192.168.10.10,dst=192.168.20.20,sport=<cleared>,dport=<cleared>),r check ovn-nbctl lr-lb-del lr check ovn-nbctl lb-del lb0 -AS_BOX([ICMP related on switch, LB with port and protocol]) +AS_BOX([ICMP related on router, LB with port and protocol]) check ovn-nbctl lb-add lb0 192.168.20.20:2 192.168.20.10:2 udp check ovn-nbctl lr-lb-add lr lb0 @@ -9245,12 +9255,14 @@ check ovn-nbctl --wait=sb set logical_router lr options:lb_force_snat_ip="router # Change the expected packets on server to be with source IP from router server_udp_expected=00000000201000000000200008004500001c000040000911c875c0a8\ 1401c0a8140a0001000200080000 -icmp_expected=000000002010000000002000080045000038011f0000fe01124ac0a81401c0\ +server_icmp_expected=000000002010000000002000080045000038011f0000fe01124ac0a81401c0\ a8140a0304f778000005784500001c000040000911c875c0a8140ac0a814010002000100080000 # Server should respond to the router IP server_udp=00000000200000000000201008004500001C000040000A11C775C0A8140AC0A8\ 14010002000100080000 +server_icmp=000000002000000000002010080045000038011F0000FF01114AC0A8140AC0A814010\ +304F778000005784500001C000040000911C875C0A81401C0A8140A0001000200080000 test_related_traffic -- 2.47.0 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
