On Mon, Jul 15, 2024 at 3:08 PM Naveen Yerramneni
<naveen.yerramn...@nutanix.com> wrote:
>
> 1. Test to validate traffic that needs ARP resolution
> when SB is disconnected.
> 2. Test to validate MAC binding buffer limit when SB
> is disconnected.
>
> Signed-off-by: Naveen Yerramneni <naveen.yerramn...@nutanix.com>

Thanks Naveen for adding the system tests.  Looks like the added
system test is failing in the CI -
https://github.com/ovsrobot/ovn/actions/runs/9945348439/job/27473539138

Can you please fix it?

Thanks
Numan

> ---
>  tests/system-ovn.at | 223 ++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 223 insertions(+)
>
> diff --git a/tests/system-ovn.at b/tests/system-ovn.at
> index c24ede7c5..5f8778a97 100644
> --- a/tests/system-ovn.at
> +++ b/tests/system-ovn.at
> @@ -13027,3 +13027,226 @@ OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port 
> patch-.*/d
>  /connection dropped.*/d"])
>  AT_CLEANUP
>  ])
> +
> +OVN_FOR_EACH_NORTHD([
> +AT_SETUP([SB Disconnect - MAC_Binding])
> +ovn_start
> +OVS_TRAFFIC_VSWITCHD_START()
> +
> +ADD_BR([br-int])
> +ADD_BR([br-ext])
> +
> +SB_PATH="unix:$ovs_base/ovn-sb/ovn-sb.sock"
> +ovs-ofctl add-flow br-ext action=normal
> +# Set external-ids in br-int needed for ovn-controller
> +ovs-vsctl \
> +        -- set Open_vSwitch . external-ids:system-id=hv1 \
> +        -- set Open_vSwitch . external-ids:ovn-remote=$SB_PATH \
> +        -- set Open_vSwitch . external-ids:ovn-encap-type=geneve \
> +        -- set Open_vSwitch . external-ids:ovn-encap-ip=169.0.0.1 \
> +        -- set bridge br-int fail-mode=secure 
> other-config:disable-in-band=true
> +
> +# Start ovn-controller
> +start_daemon ovn-controller
> +
> +ADD_NAMESPACES(sw01)
> +ADD_VETH(sw01, sw01, br-int, "192.168.1.10/24", "f0:00:00:01:02:03", \
> +        "192.168.1.1")
> +ADD_NAMESPACES(server)
> +ADD_VETH(s1, server, br-ext, "172.16.1.1/24", "f0:00:00:01:02:05", \
> +         "172.16.1.254")
> +NS_CHECK_EXEC([server], [ip addr add 172.16.1.2 dev s1])
> +check ovn-nbctl lr-add R1
> +
> +check ovn-nbctl ls-add sw0
> +check ovn-nbctl ls-add sw-ext
> +
> +check ovn-nbctl lrp-add R1 rp-sw0 00:00:01:01:02:03 192.168.1.1/24
> +check ovn-nbctl lrp-add R1 rp-ext 00:00:02:01:02:03 172.16.1.254/16
> +
> +check ovn-nbctl lrp-set-gateway-chassis rp-ext hv1
> +
> +check ovn-nbctl lsp-add sw0 sw0-rp -- set Logical_Switch_Port sw0-rp \
> +    type=router options:router-port=rp-sw0 \
> +    -- lsp-set-addresses sw0-rp router
> +
> +check ovn-nbctl set Logical_Switch sw0 other_config:dhcp_relay_port=sw0-rp
> +
> +check ovn-nbctl lsp-add sw-ext ext-rp -- set Logical_Switch_Port ext-rp \
> +    type=router options:router-port=rp-ext \
> +    -- lsp-set-addresses ext-rp router
> +check ovn-nbctl lsp-add sw-ext lnet \
> +        -- lsp-set-addresses lnet unknown \
> +        -- lsp-set-type lnet localnet \
> +        -- lsp-set-options lnet network_name=phynet
> +
> +check ovn-nbctl lsp-add sw0 sw01 \
> +    -- lsp-set-addresses sw01 "f0:00:00:01:02:03 192.168.1.10"
> +
> +AT_CHECK([ovs-vsctl set Open_vSwitch . 
> external-ids:ovn-bridge-mappings=phynet:br-ext])
> +AT_CHECK([ovs-vsctl set Open_vSwitch . 
> external-ids:ovn-remote-probe-interval=100])
> +
> +OVN_POPULATE_ARP
> +
> +check ovn-nbctl --wait=hv sync
> +
> +AS_BOX([Verify ARP resolution is working when SB is in connected state])
> +
> +AT_CHECK([ovn-appctl connection-status], [0], [dnl
> +connected
> +])
> +
> +NS_CHECK_EXEC([server], [tcpdump -l -nvv -i s1  icmp > pkt.pcap 
> 2>tcpdump_err &])
> +OVS_WAIT_UNTIL([grep "listening" tcpdump_err])
> +on_exit 'kill $(pidof tcpdump)'
> +
> +NS_CHECK_EXEC([sw01], [ping -q -c 2 -i 0.2 -w 2 172.16.1.1 | FORMAT_PING],
> +[0], [dnl
> +2 packets transmitted, 2 received, 0% packet loss, time 0ms
> +])
> +
> +OVS_WAIT_UNTIL([
> +    total_pkts=$(cat pkt.pcap | wc -l)
> +    test ${total_pkts} -ge 2
> +])
> +
> +AS_BOX([Disconnect SB and test ping that generates new ARP])
> +
> +AT_CHECK([ovs-vsctl set Open_vSwitch . 
> external-ids:ovn-remote=tcp:127.0.0.1:1234])
> +
> +sleep 1
> +AT_CHECK([ovn-appctl connection-status], [0], [dnl
> +not connected
> +])
> +
> +NS_CHECK_EXEC([sw01], [ping -q -c 2 -i 0.5 -w 1 172.16.1.2 | FORMAT_PING | 
> sed 's/.* packets/n packets/'],
> +[0], [dnl
> +n packets transmitted, 0 received, 100% packet loss, time 0ms
> +])
> +
> +ovn-sbctl list fdb
> +AS_BOX([Test traffic for which ARP entry existed in MAC_Binding table])
> +NS_CHECK_EXEC([sw01], [ping -q -c 2 -i 0.2 -w 2 172.16.1.1 | FORMAT_PING],
> +[0], [dnl
> +2 packets transmitted, 2 received, 0% packet loss, time 0ms
> +])
> +
> +AT_CHECK([ovs-vsctl set Open_vSwitch . external-ids:ovn-remote=$SB_PATH])
> +OVS_APP_EXIT_AND_WAIT([ovn-controller])
> +
> +as ovn-sb
> +OVS_APP_EXIT_AND_WAIT([ovsdb-server])
> +
> +as ovn-nb
> +OVS_APP_EXIT_AND_WAIT([ovsdb-server])
> +
> +as northd
> +OVS_APP_EXIT_AND_WAIT([ovn-northd])
> +
> +as
> +OVS_TRAFFIC_VSWITCHD_STOP(["/.*error receiving.*/d
> +/failed to query port patch-.*/d
> +/.*terminating with signal 15.*/d"])
> +AT_CLEANUP
> +])
> +
> +OVN_FOR_EACH_NORTHD([
> +AT_SETUP([SB Disconnect - MAC_Binding buffer limit])
> +ovn_start
> +OVS_TRAFFIC_VSWITCHD_START()
> +
> +ADD_BR([br-int])
> +ADD_BR([br-ext])
> +
> +SB_PATH="unix:$ovs_base/ovn-sb/ovn-sb.sock"
> +ovs-ofctl add-flow br-ext action=normal
> +# Set external-ids in br-int needed for ovn-controller
> +ovs-vsctl \
> +        -- set Open_vSwitch . external-ids:system-id=hv1 \
> +        -- set Open_vSwitch . external-ids:ovn-remote=$SB_PATH \
> +        -- set Open_vSwitch . external-ids:ovn-encap-type=geneve \
> +        -- set Open_vSwitch . external-ids:ovn-encap-ip=169.0.0.1 \
> +        -- set bridge br-int fail-mode=secure 
> other-config:disable-in-band=true
> +
> +# Start ovn-controller
> +start_daemon ovn-controller
> +
> +ADD_NAMESPACES(sw01)
> +ADD_VETH(sw01, sw01, br-int, "192.168.1.10/24", "f0:00:00:01:02:03", \
> +        "192.168.1.1")
> +ADD_NAMESPACES(server)
> +ADD_VETH(s1, server, br-ext, "172.16.1.1/24", "f0:00:00:01:02:05", \
> +         "172.16.1.254")
> +
> +check ovn-nbctl lr-add R1
> +
> +check ovn-nbctl ls-add sw0
> +check ovn-nbctl ls-add sw1
> +check ovn-nbctl ls-add sw-ext
> +
> +check ovn-nbctl lrp-add R1 rp-sw0 00:00:01:01:02:03 192.168.1.1/24
> +check ovn-nbctl lrp-add R1 rp-ext 00:00:02:01:02:03 172.16.1.254/16
> +
> +check ovn-nbctl lrp-set-gateway-chassis rp-ext hv1
> +
> +check ovn-nbctl lsp-add sw0 sw0-rp -- set Logical_Switch_Port sw0-rp \
> +    type=router options:router-port=rp-sw0 \
> +    -- lsp-set-addresses sw0-rp router
> +
> +check ovn-nbctl set Logical_Switch sw0 other_config:dhcp_relay_port=sw0-rp
> +
> +check ovn-nbctl lsp-add sw-ext ext-rp -- set Logical_Switch_Port ext-rp \
> +    type=router options:router-port=rp-ext \
> +    -- lsp-set-addresses ext-rp router
> +check ovn-nbctl lsp-add sw-ext lnet \
> +        -- lsp-set-addresses lnet unknown \
> +        -- lsp-set-type lnet localnet \
> +        -- lsp-set-options lnet network_name=phynet
> +
> +check ovn-nbctl lsp-add sw0 sw01 \
> +    -- lsp-set-addresses sw01 "f0:00:00:01:02:03 192.168.1.10"
> +
> +AT_CHECK([ovs-vsctl set Open_vSwitch . 
> external-ids:ovn-bridge-mappings=phynet:br-ext])
> +
> +OVN_POPULATE_ARP
> +
> +check ovn-nbctl --wait=hv sync
> +
> +AS_BOX([Disconnect SB and send ping to generate multiple ARPs (>1000)])
> +AT_CHECK([ovs-vsctl set Open_vSwitch . 
> external-ids:ovn-remote=tcp:127.0.0.1:1234])
> +AT_CHECK([ovs-vsctl set Open_vSwitch . 
> external-ids:ovn-remote-probe-interval=100])
> +
> +sleep 1
> +AT_CHECK([ovn-appctl connection-status], [0], [dnl
> +not connected
> +])
> +
> +for i in {1..11}; do
> +  for j in {1..100}; do
> +    NS_EXEC([sw01], [ping -q -c 1 -w 0.1 172.16.$i.$j >/dev/null 2>&1 &])
> +  done
> +done
> +
> +AS_BOX([Verify pinctrl_drop_buffered_packets_map counter])
> +ovn-appctl  coverage/show >ovn_counters
> +AT_CHECK([grep -q "pinctrl_drop_buffered_packets_map" ovn_counters], [0])
> +
> +AT_CHECK([ovs-vsctl set Open_vSwitch . external-ids:ovn-remote=$SB_PATH])
> +
> +OVS_APP_EXIT_AND_WAIT([ovn-controller])
> +
> +as ovn-sb
> +OVS_APP_EXIT_AND_WAIT([ovsdb-server])
> +
> +as ovn-nb
> +OVS_APP_EXIT_AND_WAIT([ovsdb-server])
> +
> +as northd
> +OVS_APP_EXIT_AND_WAIT([ovn-northd])
> +
> +as
> +OVS_TRAFFIC_VSWITCHD_STOP(["/.*error receiving.*/d
> +/failed to query port patch-.*/d
> +/.*terminating with signal 15.*/d"])
> +AT_CLEANUP
> +])
> --
> 2.36.6
>
> _______________________________________________
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to