From patchwork Tue Feb 27 10:40:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammad Heib X-Patchwork-Id: 1904984 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=G8tfHkq4; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TkYtc6vZBz23cb for ; Tue, 27 Feb 2024 21:41:12 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id E7638408C4; Tue, 27 Feb 2024 10:41:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wsxHkm0bB-Pk; Tue, 27 Feb 2024 10:41:04 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org A19CA40557 Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=G8tfHkq4 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id A19CA40557; Tue, 27 Feb 2024 10:41:03 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 16F8EC0DD2; Tue, 27 Feb 2024 10:41:03 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 20844C0037 for ; Tue, 27 Feb 2024 10:41:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 10552605BE for ; Tue, 27 Feb 2024 10:41:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2rDD2ysmFsAv for ; Tue, 27 Feb 2024 10:40:58 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=mheib@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 3188D605BD Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 3188D605BD Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=G8tfHkq4 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 3188D605BD for ; Tue, 27 Feb 2024 10:40:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709030456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XQUkMGDUvYHCbkHkdTkb/Acv40kuAHelmZDW0gtkFZI=; b=G8tfHkq49j+jrCrpJcUGWp6ZFRn8sqSpTEPlPOf3JYDWTBBuXK6pxzYZgq6pm/WzmeNMxt 7Zbxm4XIcXNfJ3+bcFzo1us5MM9356UeZ5hk0WmShCVO9gPoEq4qFMvxliFPWyOBfabYEL BSd3OpDl+L8RgTJ/vZU19W/7A7Xf6EE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-655-Mq3H90lSO-GSERZU3cnfJA-1; Tue, 27 Feb 2024 05:40:54 -0500 X-MC-Unique: Mq3H90lSO-GSERZU3cnfJA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 79D5B8A12A3 for ; Tue, 27 Feb 2024 10:40:54 +0000 (UTC) Received: from mheiblap.localdomain.com (unknown [10.47.238.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 716D92BE; Tue, 27 Feb 2024 10:40:52 +0000 (UTC) From: Mohammad Heib To: dev@openvswitch.org Date: Tue, 27 Feb 2024 12:40:48 +0200 Message-Id: <20240227104049.1769578-1-mheib@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 1/2] tests: Move ovn interconnection tests to ovn-ic.at. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Move ovn-ic tests that exist in ovn.at to ovn-ic.at. Signed-off-by: Mohammad Heib --- tests/ovn-ic.at | 687 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/ovn.at | 686 ----------------------------------------------- 2 files changed, 687 insertions(+), 686 deletions(-) diff --git a/tests/ovn-ic.at b/tests/ovn-ic.at index 44dbf8ab1..12267e960 100644 --- a/tests/ovn-ic.at +++ b/tests/ovn-ic.at @@ -1442,3 +1442,690 @@ OVN_CLEANUP_IC([az1], [az2]) AT_CLEANUP ]) + +OVN_FOR_EACH_NORTHD([ +AT_SETUP([interconnection]) +AT_KEYWORDS([slowtest]) + +ovn_init_ic_db +# The number needs to stay relatively low due to high memory consumption +# with address sanitizers enabled. +n_az=3 +n_ts=3 +for i in `seq 1 $n_az`; do + ovn_start az$i +done + +net_add n1 + +# 1 HV and 1 GW per AZ +for az in `seq 1 $n_az`; do + sim_add hv$az + as hv$az + check ovs-vsctl add-br br-phys + ovn_az_attach az$az n1 br-phys 192.168.$az.1 16 + for p in `seq 1 $n_ts`; do + check ovs-vsctl -- add-port br-int vif$p -- \ + set interface vif$p external-ids:iface-id=lsp$az-$p \ + options:tx_pcap=hv$az/vif$p-tx.pcap \ + options:rxq_pcap=hv$az/vif$p-rx.pcap \ + ofport-request=$p + done + + sim_add gw$az + as gw$az + check ovs-vsctl add-br br-phys + ovn_az_attach az$az n1 br-phys 192.168.$az.2 16 + check ovs-vsctl set open . external-ids:ovn-is-interconn=true +done + +for ts in `seq 1 $n_ts`; do + AT_CHECK([ovn-ic-nbctl create Transit_Switch name=ts$ts], [0], [ignore]) + for az in `seq 1 $n_az`; do + echo "az$az: wait for ts$ts..." + check ovn_as az$az ovn-nbctl wait-until logical_switch ts$ts + done +done + +for az in `seq 1 $n_az`; do + ovn_as az$az + check ovn-nbctl set nb_global . options:ic-route-learn=true + check ovn-nbctl set nb_global . options:ic-route-adv=true + + # Each AZ has n_ts LSPi->LSi->LRi connecting to each TSi + echo + echo "az$az" + for i in `seq 1 $n_ts`; do + lsp_mac=00:00:00:0$az:0$i:00 + lrp_ls_mac=00:00:00:0$az:0$i:01 + lrp_ts_mac=00:00:00:0$az:0$i:02 + lsp_ip=10.$az.$i.123 + lrp_ls_ip=10.$az.$i.1 + lrp_ts_ip=169.254.$i.$az + + check ovn-nbctl ls-add ls$az-$i + check ovn-nbctl lsp-add ls$az-$i lsp$az-$i + check ovn-nbctl lsp-set-addresses lsp$az-$i "$lsp_mac $lsp_ip" + + check ovn-nbctl lr-add lr$az-$i + + check ovn-nbctl lrp-add lr$az-$i lrp-lr$az-$i-ls$az-$i $lrp_ls_mac $lrp_ls_ip/24 + check ovn-nbctl lsp-add ls$az-$i lsp-ls$az-$i-lr$az-$i + check ovn-nbctl lsp-set-addresses lsp-ls$az-$i-lr$az-$i router + check ovn-nbctl lsp-set-type lsp-ls$az-$i-lr$az-$i router + check ovn-nbctl lsp-set-options lsp-ls$az-$i-lr$az-$i router-port=lrp-lr$az-$i-ls$az-$i + + check ovn-nbctl lrp-add lr$az-$i lrp-lr$az-$i-ts$i $lrp_ts_mac $lrp_ts_ip/24 + check ovn-nbctl lsp-add ts$i lsp-ts$i-lr$az-$i + check ovn-nbctl lsp-set-addresses lsp-ts$i-lr$az-$i router + check ovn-nbctl lsp-set-type lsp-ts$i-lr$az-$i router + check ovn-nbctl lsp-set-options lsp-ts$i-lr$az-$i router-port=lrp-lr$az-$i-ts$i + check ovn-nbctl lrp-set-gateway-chassis lrp-lr$az-$i-ts$i gw$az + done + check ovn-nbctl --wait=hv sync + ovn-sbctl list Port_Binding > az$az.ports + wait_for_ports_up +done + +# Pre-populate the hypervisors' ARP tables so that we don't lose any +# packets for ARP resolution (native tunneling doesn't queue packets +# for ARP resolution). +OVN_POPULATE_ARP + +for i in `seq 1 $n_az`; do + check ovn_as az$i ovn-nbctl --wait=hv sync + ovn_as az$i ovn-sbctl dump-flows > az$i/sbflows +done + +# Allow some time for ovn-northd and ovn-controller to catch up. +# XXX This should be more systematic. +sleep 2 + +# Populate requested-chassis options for remote lsps +for az in $(seq 1 $n_az); do + ovn_as az${az} + for ts in $(seq 1 $n_ts); do + for i in $(seq 1 $n_ts); do + if [[ $i -eq ${az} ]]; then + continue + fi + check ovn-nbctl lsp-set-options lsp-ts${ts}-lr${i}-${ts} requested-chassis=gw$i + done + done +done + +ovn-ic-nbctl show > ic-nbctl.dump +AT_CAPTURE_FILE([ic-nbctl.dump]) + +(echo "---------ISB dump-----" + ovn-ic-sbctl show + echo "---------------------" + ovn-ic-sbctl list gateway + echo "---------------------" + ovn-ic-sbctl list datapath_binding + echo "---------------------" + ovn-ic-sbctl list port_binding + echo "---------------------" + ovn-ic-sbctl list route + echo "---------------------") > ic-sbctl.dump +AT_CAPTURE_FILE([ic-sbctl.dump]) + +AT_CAPTURE_FILE([expected]) +AT_CAPTURE_FILE([received]) +check_packets() { + > expected + > received + for az in `seq 1 $n_az`; do + for i in `seq 1 $n_ts`; do + pcap=hv$az/vif$i-tx.pcap + echo "--- $pcap" | tee -a expected >> received + if test -e $az-$i.expected; then + sort $az-$i.expected >> expected + fi + if test -e $pcap; then + $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" $pcap | sort >> received + fi + echo | tee -a expected >> received + done + done + + $at_diff expected received >/dev/null +} + +# Send packets between AZs on each TS +for s_az in $(seq 1 $n_az); do + ovn_as az${s_az} + as hv${s_az} + for d_az in $(seq 1 $n_az); do + if test $s_az = $d_az; then + continue + fi + + for i in $(seq 1 $n_ts); do + echo + AS_BOX([packet from az$s_az to az$d_az via ts$i]) + lsp_smac=00:00:00:0${s_az}:0$i:00 + lsp_dmac=00:00:00:0${d_az}:0$i:00 + lrp_ls_smac=00:00:00:0${s_az}:0$i:01 + lrp_ls_dmac=00:00:00:0${d_az}:0$i:01 + lsp_sip=10.${s_az}.$i.123 + lsp_dip=10.${d_az}.$i.123 + + ovn_inport=lsp${s_az}-$i + packet="inport==\"$ovn_inport\" && eth.src==$lsp_smac && eth.dst==$lrp_ls_smac && + ip4 && ip.ttl==64 && ip4.src==$lsp_sip && ip4.dst==$lsp_dip && + udp && udp.src==53 && udp.dst==4369" + echo "sending: $packet" + AT_CHECK([ovn_trace --ovs "$packet" > ${s_az}-${d_az}-$i.ovn-trace]) + OVS_WAIT_UNTIL([ovs-appctl -t ovn-controller inject-pkt "$packet"]) + ovs_inport=$(ovs-vsctl --bare --columns=ofport find Interface external-ids:iface-id="$ovn_inport") + + ovs_packet=$(echo $packet | ovstest test-ovn expr-to-packets) + echo ovs_inport=$ovs_inport ovs_packet=$ovs_packet + AT_CHECK([ovs-appctl ofproto/trace br-int in_port="$ovs_inport" "$ovs_packet" > ${s_az}-${d_az}-$i.ovs-trace]) + + # Packet to Expect + # The TTL should be decremented by 2. + packet="eth.src==$lrp_ls_dmac && eth.dst==$lsp_dmac && + ip4 && ip.ttl==62 && ip4.src==$lsp_sip && ip4.dst==$lsp_dip && + udp && udp.src==53 && udp.dst==4369" + echo $packet | ovstest test-ovn expr-to-packets >> ${d_az}-$i.expected + done + done +done +OVS_WAIT_UNTIL([check_packets], [$at_diff -F'^---' expected received]) + +for az in `seq 1 $n_az`; do + OVN_CLEANUP_SBOX([hv$az]) + OVN_CLEANUP_SBOX([gw$az]) + OVN_CLEANUP_AZ([az$az]) +done + +OVN_CLEANUP_IC + +AT_CLEANUP +]) + +OVN_FOR_EACH_NORTHD([ +AT_SETUP([interconnection - static multicast]) + +# Logical network: +# +# AZ1 | AZ2 +# --------------------------------------------------------------------- +# | +# | +-- LR2 --- LS2 --- LSP2 (sender) +# | | | +# | | +----- LSP4 (receiver) +# | / +# LSP1 --- LS1 --- LR1 --- TS --- +# (receiver) | \ +# | +-- LR3 --- LS3 --- LSP3 (receiver) +# +# LS1, LS2, LS3 configured to flood unregistered IP multicast. +# LR1, LR2, LR3 configured to relay IP multicast. +# LR1-LS1 configured to flood IP multicast traffic unconditionally. +# LR3-LS3 configured to flood IP multicast traffic unconditionally. + +AT_CAPTURE_FILE([exp]) +AT_CAPTURE_FILE([rcv]) +check_packets() { + > exp + > rcv + if test "$1" = --uniq; then + sort="sort -u"; shift + else + sort=sort + fi + for tuple in "$@"; do + set $tuple; pcap=$1 type=$2 + echo "--- $pcap" | tee -a exp >> rcv + $sort "$type" >> exp + $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" $pcap | $sort >> rcv + echo | tee -a exp >> rcv + done + + $at_diff exp rcv >/dev/null +} + +ovn_init_ic_db +ovn_start az1 +ovn_start az2 + +net_add n1 + +sim_add hv1 +as hv1 +check ovs-vsctl add-br br-phys +ovn_az_attach az1 n1 br-phys 192.168.1.1 16 +check ovs-vsctl -- add-port br-int hv1-vif1 \ + -- set interface hv1-vif1 external-ids:iface-id=lsp1 \ + options:tx_pcap=hv1/vif1-tx.pcap \ + options:rxq_pcap=hv1/vif1-rx.pcap +check ovs-vsctl set open . external-ids:ovn-is-interconn=true + +sim_add hv2 +as hv2 +check ovs-vsctl add-br br-phys +ovn_az_attach az2 n1 br-phys 192.168.2.1 16 +check ovs-vsctl -- add-port br-int hv2-vif1 \ + -- set interface hv2-vif1 external-ids:iface-id=lsp2 \ + options:tx_pcap=hv2/vif1-tx.pcap \ + options:rxq_pcap=hv2/vif1-rx.pcap +check ovs-vsctl -- add-port br-int hv2-vif2 \ + -- set interface hv2-vif2 external-ids:iface-id=lsp3 \ + options:tx_pcap=hv2/vif2-tx.pcap \ + options:rxq_pcap=hv2/vif2-rx.pcap +check ovs-vsctl -- add-port br-int hv2-vif3 \ + -- set interface hv2-vif3 external-ids:iface-id=lsp4 \ + options:tx_pcap=hv2/vif3-tx.pcap \ + options:rxq_pcap=hv2/vif3-rx.pcap +check ovs-vsctl set open . external-ids:ovn-is-interconn=true + +AT_CHECK([ovn-ic-nbctl create Transit_Switch name=ts], [0], [ignore]) +check ovn_as az1 ovn-nbctl wait-until logical_switch ts +check ovn_as az2 ovn-nbctl wait-until logical_switch ts + +ovn_as az1 +check ovn-nbctl lr-add lr1 \ + -- lrp-add lr1 lr1-ts 00:00:00:01:00:01 42.42.42.1/24 \ + -- lrp-add lr1 lr1-ls1 00:00:00:01:01:00 43.43.43.1/24 \ + -- lrp-set-gateway-chassis lr1-ts hv1 +check ovn-nbctl ls-add ls1 \ + -- lsp-add ls1 ls1-lr1 \ + -- lsp-set-addresses ls1-lr1 router \ + -- lsp-set-type ls1-lr1 router \ + -- lsp-set-options ls1-lr1 router-port=lr1-ls1 \ + -- lsp-add ls1 lsp1 +check ovn-nbctl lsp-add ts ts-lr1 \ + -- lsp-set-addresses ts-lr1 router \ + -- lsp-set-type ts-lr1 router \ + -- lsp-set-options ts-lr1 router-port=lr1-ts +wait_for_ports_up + +ovn_as az2 +check ovn-nbctl lr-add lr2 \ + -- lrp-add lr2 lr2-ts 00:00:00:02:00:01 42.42.42.2/24 \ + -- lrp-add lr2 lr2-ls2 00:00:00:02:01:00 44.44.44.1/24 \ + -- lrp-set-gateway-chassis lr2-ts hv2 +check ovn-nbctl ls-add ls2 \ + -- lsp-add ls2 ls2-lr2 \ + -- lsp-set-addresses ls2-lr2 router \ + -- lsp-set-type ls2-lr2 router \ + -- lsp-set-options ls2-lr2 router-port=lr2-ls2 \ + -- lsp-add ls2 lsp2 \ + -- lsp-add ls2 lsp4 +check ovn-nbctl lsp-add ts ts-lr2 \ + -- lsp-set-addresses ts-lr2 router \ + -- lsp-set-type ts-lr2 router \ + -- lsp-set-options ts-lr2 router-port=lr2-ts + +check ovn-nbctl lr-add lr3 \ + -- lrp-add lr3 lr3-ts 00:00:00:02:00:02 42.42.42.3/24 \ + -- lrp-add lr3 lr3-ls3 00:00:00:02:02:00 44.44.45.1/24 \ + -- lrp-set-gateway-chassis lr3-ts hv2 +check ovn-nbctl ls-add ls3 \ + -- lsp-add ls3 ls3-lr3 \ + -- lsp-set-addresses ls3-lr3 router \ + -- lsp-set-type ls3-lr3 router \ + -- lsp-set-options ls3-lr3 router-port=lr3-ls3 \ + -- lsp-add ls3 lsp3 +check ovn-nbctl lsp-add ts ts-lr3 \ + -- lsp-set-addresses ts-lr3 router \ + -- lsp-set-type ts-lr3 router \ + -- lsp-set-options ts-lr3 router-port=lr3-ts + +wait_for_ports_up + +ovn_as az1 +OVS_WAIT_UNTIL([ovn-nbctl show | grep ts-lr2]) +check ovn-nbctl lsp-set-options ts-lr2 requested-chassis=hv2 +OVS_WAIT_UNTIL([ovn-nbctl show | grep ts-lr3]) +check ovn-nbctl lsp-set-options ts-lr3 requested-chassis=hv2 + +ovn_as az2 +OVS_WAIT_UNTIL([ovn-nbctl show | grep ts-lr1]) +check ovn-nbctl lsp-set-options ts-lr1 requested-chassis=hv1 + +dnl Enable unregistered IP multicast flooding and IP multicast relay. +ovn_as az1 +check ovn-nbctl set logical_switch ls1 other_config:mcast_snoop="true" \ + other_config:mcast_flood_unregistered="true" +check ovn-nbctl set logical_router lr1 options:mcast_relay="true" +check ovn-nbctl set logical_router_port lr1-ls1 options:mcast_flood="true" + +ovn_as az2 +check ovn-nbctl set logical_switch ls2 other_config:mcast_snoop="true" \ + other_config:mcast_flood_unregistered="true" +check ovn-nbctl set logical_router lr2 options:mcast_relay="true" +check ovn-nbctl set logical_router_port lr2-ts options:mcast_flood="true" +check ovn-nbctl set logical_switch ls3 other_config:mcast_snoop="true" \ + other_config:mcast_flood_unregistered="true" +check ovn-nbctl set logical_router lr3 options:mcast_relay="true" +check ovn-nbctl set logical_router_port lr3-ls3 options:mcast_flood="true" + +check ovn_as az1 ovn-nbctl --wait=hv sync +check ovn_as az2 ovn-nbctl --wait=hv sync + +# Pre-populate the hypervisors' ARP tables so that we don't lose any +# packets for ARP resolution (native tunneling doesn't queue packets +# for ARP resolution). +OVN_POPULATE_ARP + +# Send an IP multicast packet from lsp2, it should be forwarded +# statically to lsp1, lsp3 and lsp4. +> expected_az1 +> expected_az2 +> expected_az2_switched +send_ip_multicast_pkt hv2-vif1 hv2 \ + 000000000001 01005e000144 \ + $(ip_to_hex 44 44 44 2) $(ip_to_hex 239 0 1 68) 1e 20 7c6b 11 \ + e518e518000aed350000 +store_ip_multicast_pkt \ + 000000010100 01005e000144 \ + $(ip_to_hex 44 44 44 2) $(ip_to_hex 239 0 1 68) 1e 1e 7e6b 11 \ + e518e518000aed350000 expected_az1 +store_ip_multicast_pkt \ + 000000020200 01005e000144 \ + $(ip_to_hex 44 44 44 2) $(ip_to_hex 239 0 1 68) 1e 1e 7e6b 11 \ + e518e518000aed350000 expected_az2 +store_ip_multicast_pkt \ + 000000000001 01005e000144 \ + $(ip_to_hex 44 44 44 2) $(ip_to_hex 239 0 1 68) 1e 20 7c6b 11 \ + e518e518000aed350000 expected_az2_switched + +OVS_WAIT_UNTIL( + [check_packets 'hv1/vif1-tx.pcap expected_az1' \ + 'hv2/vif2-tx.pcap expected_az2' \ + 'hv2/vif3-tx.pcap expected_az2_switched'], + [$at_diff -F'^---' exp rcv]) + +# Send an IP multicast packet from lsp2 towards 224.0.0.x, it should be +# forwarded statically only to lsp3. +as hv1 reset_pcap_file hv1-vif1 hv1/vif1 +as hv2 reset_pcap_file hv2-vif2 hv2/vif2 +as hv2 reset_pcap_file hv2-vif3 hv2/vif3 +> expected_az1 +> expected_az2 +> expected_az2_switched +send_ip_multicast_pkt hv2-vif1 hv2 \ + 000000000001 01005e000144 \ + $(ip_to_hex 44 44 44 2) $(ip_to_hex 224 0 0 1) 1e 20 8cae 11 \ + e518e518000aed350000 +store_ip_multicast_pkt \ + 000000000001 01005e000144 \ + $(ip_to_hex 44 44 44 2) $(ip_to_hex 224 0 0 1) 1e 20 8cae 11 \ + e518e518000aed350000 expected_az2_switched + +OVS_WAIT_UNTIL( + [check_packets 'hv1/vif1-tx.pcap expected_az1' \ + 'hv2/vif2-tx.pcap expected_az2' \ + 'hv2/vif3-tx.pcap expected_az2_switched'], + [$at_diff -F'^---' exp rcv]) + +OVN_CLEANUP_SBOX([hv1],["/IGMP Querier enabled without a valid IPv4 or IPv6 address/d +/IGMP Querier enabled with invalid ETH src address/d"]) + +OVN_CLEANUP_SBOX([hv2],["/IGMP Querier enabled without a valid IPv4 or IPv6 address/d +/IGMP Querier enabled with invalid ETH src address/d"]) + +OVN_CLEANUP_IC([az1],[az2]) +AT_CLEANUP +]) + +OVN_FOR_EACH_NORTHD([ +AT_SETUP([interconnection - IGMP/MLD multicast]) +AT_KEYWORDS([IP-multicast]) + +# Logical network: +# +# AZ1 | AZ2 +# --------------------------------------------------------------------- +# | +# | +-- LR2 --- LS2 --- LSP2 (sender) +# | / +# LSP1 --- LS1 --- LR1 --- TS --- +# (receiver) | \ +# | +-- LR3 --- LS3 --- LSP3 (receiver) +# +# LS1, LS2, LS3, TS configured to snoop IP multicast. +# LR1, LR2, LR3 configured to relay IP multicast. +# LR1-TS configured to flood IP multicast traffic unconditionally. +# LR2-TS configured to flood IP multicast traffic unconditionally. +# LR3-TS configured to flood IP multicast traffic unconditionally. + +AT_CAPTURE_FILE([exp]) +AT_CAPTURE_FILE([rcv]) +check_packets() { + > exp + > rcv + if test "$1" = --uniq; then + sort="sort -u"; shift + else + sort=sort + fi + for tuple in "$@"; do + set $tuple; pcap=$1 type=$2 + echo "--- $pcap" | tee -a exp >> rcv + $sort "$type" >> exp + $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" $pcap | $sort >> rcv + echo | tee -a exp >> rcv + done + + $at_diff exp rcv >/dev/null +} + +ovn_init_ic_db +ovn_start az1 +ovn_start az2 + +net_add n1 + +sim_add hv1 +as hv1 +check ovs-vsctl add-br br-phys +ovn_az_attach az1 n1 br-phys 192.168.1.1 16 +check ovs-vsctl -- add-port br-int hv1-vif1 \ + -- set interface hv1-vif1 external-ids:iface-id=lsp1 \ + options:tx_pcap=hv1/vif1-tx.pcap \ + options:rxq_pcap=hv1/vif1-rx.pcap +check ovs-vsctl set open . external-ids:ovn-is-interconn=true + +sim_add hv2 +as hv2 +check ovs-vsctl add-br br-phys +ovn_az_attach az2 n1 br-phys 192.168.2.1 16 +check ovs-vsctl -- add-port br-int hv2-vif1 \ + -- set interface hv2-vif1 external-ids:iface-id=lsp2 \ + options:tx_pcap=hv2/vif1-tx.pcap \ + options:rxq_pcap=hv2/vif1-rx.pcap +check ovs-vsctl -- add-port br-int hv2-vif2 \ + -- set interface hv2-vif2 external-ids:iface-id=lsp3 \ + options:tx_pcap=hv2/vif2-tx.pcap \ + options:rxq_pcap=hv2/vif2-rx.pcap +check ovs-vsctl set open . external-ids:ovn-is-interconn=true + +AT_CHECK([ovn-ic-nbctl create Transit_Switch name=ts], [0], [ignore]) +check ovn_as az1 ovn-nbctl wait-until logical_switch ts +check ovn_as az2 ovn-nbctl wait-until logical_switch ts + +ovn_as az1 +check ovn-nbctl lr-add lr1 \ + -- lrp-add lr1 lr1-ts 00:00:00:01:00:01 42.42.42.1/24 4242::1/64 \ + -- lrp-add lr1 lr1-ls1 00:00:00:01:01:00 43.43.43.1/24 4343::1/64\ + -- lrp-set-gateway-chassis lr1-ts hv1 +check ovn-nbctl ls-add ls1 \ + -- lsp-add ls1 ls1-lr1 \ + -- lsp-set-addresses ls1-lr1 router \ + -- lsp-set-type ls1-lr1 router \ + -- lsp-set-options ls1-lr1 router-port=lr1-ls1 \ + -- lsp-add ls1 lsp1 +check ovn-nbctl lsp-add ts ts-lr1 \ + -- lsp-set-addresses ts-lr1 router \ + -- lsp-set-type ts-lr1 router \ + -- lsp-set-options ts-lr1 router-port=lr1-ts +wait_for_ports_up + +ovn_as az2 +check ovn-nbctl lr-add lr2 \ + -- lrp-add lr2 lr2-ts 00:00:00:02:00:01 42.42.42.2/24 4242::2/64 \ + -- lrp-add lr2 lr2-ls2 00:00:00:02:01:00 44.44.44.1/24 4444::1/64 \ + -- lrp-set-gateway-chassis lr2-ts hv2 +check ovn-nbctl ls-add ls2 \ + -- lsp-add ls2 ls2-lr2 \ + -- lsp-set-addresses ls2-lr2 router \ + -- lsp-set-type ls2-lr2 router \ + -- lsp-set-options ls2-lr2 router-port=lr2-ls2 \ + -- lsp-add ls2 lsp2 +check ovn-nbctl lsp-add ts ts-lr2 \ + -- lsp-set-addresses ts-lr2 router \ + -- lsp-set-type ts-lr2 router \ + -- lsp-set-options ts-lr2 router-port=lr2-ts + +check ovn-nbctl lr-add lr3 \ + -- lrp-add lr3 lr3-ts 00:00:00:02:00:02 42.42.42.3/24 4242::3/64 \ + -- lrp-add lr3 lr3-ls3 00:00:00:02:02:00 44.44.45.1/24 4445::1/64 \ + -- lrp-set-gateway-chassis lr3-ts hv2 +check ovn-nbctl ls-add ls3 \ + -- lsp-add ls3 ls3-lr3 \ + -- lsp-set-addresses ls3-lr3 router \ + -- lsp-set-type ls3-lr3 router \ + -- lsp-set-options ls3-lr3 router-port=lr3-ls3 \ + -- lsp-add ls3 lsp3 +check ovn-nbctl lsp-add ts ts-lr3 \ + -- lsp-set-addresses ts-lr3 router \ + -- lsp-set-type ts-lr3 router \ + -- lsp-set-options ts-lr3 router-port=lr3-ts + +wait_for_ports_up + +ovn_as az1 +OVS_WAIT_UNTIL([ovn-nbctl show | grep ts-lr2]) +check ovn-nbctl lsp-set-options ts-lr2 requested-chassis=hv2 +OVS_WAIT_UNTIL([ovn-nbctl show | grep ts-lr3]) +check ovn-nbctl lsp-set-options ts-lr3 requested-chassis=hv2 + +ovn_as az2 +OVS_WAIT_UNTIL([ovn-nbctl show | grep ts-lr1]) +check ovn-nbctl lsp-set-options ts-lr1 requested-chassis=hv1 + +dnl Enable IP multicast snooping and IP multicast relay. Reports are +dnl forwarded statically. +ovn_as az1 +check ovn-nbctl set logical_switch ls1 other_config:mcast_snoop="true" +check ovn-nbctl set Logical_Switch_Port ls1-lr1 options:mcast_flood_reports="true" +check ovn-nbctl set logical_router lr1 options:mcast_relay="true" +check ovn-nbctl set logical_router_port lr1-ts options:mcast_flood="true" +check ovn-nbctl set logical_switch ts other_config:mcast_snoop="true" +check ovn-nbctl set logical_switch_port ts-lr1 options:mcast_flood_reports="true" +check ovn-nbctl set logical_switch_port ts-lr2 options:mcast_flood_reports="true" +check ovn-nbctl set logical_switch_port ts-lr3 options:mcast_flood_reports="true" + +ovn_as az2 +check ovn-nbctl set logical_switch ls2 other_config:mcast_snoop="true" +check ovn-nbctl set Logical_Switch_Port ls2-lr2 options:mcast_flood_reports="true" +check ovn-nbctl set logical_router lr2 options:mcast_relay="true" +check ovn-nbctl set logical_router_port lr2-ts options:mcast_flood="true" +check ovn-nbctl set logical_switch ls3 other_config:mcast_snoop="true" +check ovn-nbctl set Logical_Switch_Port ls3-lr3 options:mcast_flood_reports="true" +check ovn-nbctl set logical_router lr3 options:mcast_relay="true" +check ovn-nbctl set logical_router_port lr3-ts options:mcast_flood="true" +check ovn-nbctl set logical_switch ts other_config:mcast_snoop="true" +check ovn-nbctl set logical_switch_port ts-lr1 options:mcast_flood_reports="true" +check ovn-nbctl set logical_switch_port ts-lr2 options:mcast_flood_reports="true" +check ovn-nbctl set logical_switch_port ts-lr3 options:mcast_flood_reports="true" + +check ovn_as az1 ovn-nbctl --wait=hv sync +check ovn_as az2 ovn-nbctl --wait=hv sync + +# Pre-populate the hypervisors' ARP tables so that we don't lose any +# packets for ARP resolution (native tunneling doesn't queue packets +# for ARP resolution). +OVN_POPULATE_ARP + +# Inject IGMP Join for 239.0.1.68 on LSP1. +send_igmp_v3_report hv1-vif1 hv1 \ + 000000000001 $(ip_to_hex 10 0 0 1) f9f8 \ + $(ip_to_hex 239 0 1 68) 04 e9b9 \ + /dev/null + +# Inject MLD Join for ff0a:dead:beef::1 on LSP1. +send_mld_v2_report hv1-vif1 hv1 \ + 000000000001 10000000000000000000000000000001 \ + ff0adeadbeef00000000000000000001 04 c0e4 \ + /dev/null + +# Inject IGMP Join for 239.0.1.68 on LSP3. +send_igmp_v3_report hv2-vif2 hv2 \ + 000000000001 $(ip_to_hex 10 0 0 1) f9f8 \ + $(ip_to_hex 239 0 1 68) 04 e9b9 \ + /dev/null + +# Inject MLD Join for ff0a:dead:beef::1 on LSP3. +send_mld_v2_report hv2-vif2 hv2 \ + 000000000001 10000000000000000000000000000001 \ + ff0adeadbeef00000000000000000001 04 c0e4 \ + /dev/null + +# Check that the IGMP and MLD groups are learned on both AZs (on the LS +# and TS). +ovn_as az1 +wait_row_count IGMP_Group 2 address=239.0.1.68 +wait_row_count IGMP_Group 2 address='"ff0a:dead:beef::1"' +check ovn-nbctl --wait=hv sync + +ovn_as az2 +wait_row_count IGMP_Group 2 address=239.0.1.68 +wait_row_count IGMP_Group 2 address='"ff0a:dead:beef::1"' +check ovn-nbctl --wait=hv sync + +# Send an IP multicast packet from LSP2, it should be forwarded +# to lsp1 and lsp3. +> expected_az1 +> expected_az2 +send_ip_multicast_pkt hv2-vif1 hv2 \ + 000000000001 01005e000144 \ + $(ip_to_hex 44 44 44 2) $(ip_to_hex 239 0 1 68) 1e 20 7c6b 11 \ + e518e518000aed350000 +store_ip_multicast_pkt \ + 000000010100 01005e000144 \ + $(ip_to_hex 44 44 44 2) $(ip_to_hex 239 0 1 68) 1e 1e 7e6b 11 \ + e518e518000aed350000 expected_az1 +store_ip_multicast_pkt \ + 000000020200 01005e000144 \ + $(ip_to_hex 44 44 44 2) $(ip_to_hex 239 0 1 68) 1e 1e 7e6b 11 \ + e518e518000aed350000 expected_az2 + +send_ip6_multicast_pkt hv2-vif1 hv2 \ + 000000000001 333300000001 \ + 00100000000000000000000000000042 ff0adeadbeef00000000000000000001 \ + 000e 40 11 \ + 93407a69000e2b4e61736461640a +store_ip6_multicast_pkt \ + 000000010100 333300000001 \ + 00100000000000000000000000000042 ff0adeadbeef00000000000000000001 \ + 000e 3e 11 \ + 93407a69000e2b4e61736461640a \ + expected_az1 +store_ip6_multicast_pkt \ + 000000020200 333300000001 \ + 00100000000000000000000000000042 ff0adeadbeef00000000000000000001 \ + 000e 3e 11 \ + 93407a69000e2b4e61736461640a \ + expected_az2 + +OVS_WAIT_UNTIL( + [check_packets 'hv1/vif1-tx.pcap expected_az1' \ + 'hv2/vif2-tx.pcap expected_az2'], + [$at_diff -F'^---' exp rcv]) + +OVN_CLEANUP_SBOX([hv1], ["/IGMP Querier enabled without a valid IPv4/d +/IGMP Querier enabled with invalid ETH src/d"]) + +OVN_CLEANUP_SBOX([hv2], ["/IGMP Querier enabled without a valid IPv4/d +/IGMP Querier enabled with invalid ETH src/d"]) + +OVN_CLEANUP_IC([az1],[az2]) +AT_CLEANUP +]) + diff --git a/tests/ovn.at b/tests/ovn.at index d26c95054..b98f8d487 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -26272,692 +26272,6 @@ OVN_CLEANUP([hv1]) AT_CLEANUP ]) -OVN_FOR_EACH_NORTHD([ -AT_SETUP([interconnection]) -AT_KEYWORDS([slowtest]) - -ovn_init_ic_db -# The number needs to stay relatively low due to high memory consumption -# with address sanitizers enabled. -n_az=3 -n_ts=3 -for i in `seq 1 $n_az`; do - ovn_start az$i -done - -net_add n1 - -# 1 HV and 1 GW per AZ -for az in `seq 1 $n_az`; do - sim_add hv$az - as hv$az - check ovs-vsctl add-br br-phys - ovn_az_attach az$az n1 br-phys 192.168.$az.1 16 - for p in `seq 1 $n_ts`; do - check ovs-vsctl -- add-port br-int vif$p -- \ - set interface vif$p external-ids:iface-id=lsp$az-$p \ - options:tx_pcap=hv$az/vif$p-tx.pcap \ - options:rxq_pcap=hv$az/vif$p-rx.pcap \ - ofport-request=$p - done - - sim_add gw$az - as gw$az - check ovs-vsctl add-br br-phys - ovn_az_attach az$az n1 br-phys 192.168.$az.2 16 - check ovs-vsctl set open . external-ids:ovn-is-interconn=true -done - -for ts in `seq 1 $n_ts`; do - AT_CHECK([ovn-ic-nbctl create Transit_Switch name=ts$ts], [0], [ignore]) - for az in `seq 1 $n_az`; do - echo "az$az: wait for ts$ts..." - check ovn_as az$az ovn-nbctl wait-until logical_switch ts$ts - done -done - -for az in `seq 1 $n_az`; do - ovn_as az$az - check ovn-nbctl set nb_global . options:ic-route-learn=true - check ovn-nbctl set nb_global . options:ic-route-adv=true - - # Each AZ has n_ts LSPi->LSi->LRi connecting to each TSi - echo - echo "az$az" - for i in `seq 1 $n_ts`; do - lsp_mac=00:00:00:0$az:0$i:00 - lrp_ls_mac=00:00:00:0$az:0$i:01 - lrp_ts_mac=00:00:00:0$az:0$i:02 - lsp_ip=10.$az.$i.123 - lrp_ls_ip=10.$az.$i.1 - lrp_ts_ip=169.254.$i.$az - - check ovn-nbctl ls-add ls$az-$i - check ovn-nbctl lsp-add ls$az-$i lsp$az-$i - check ovn-nbctl lsp-set-addresses lsp$az-$i "$lsp_mac $lsp_ip" - - check ovn-nbctl lr-add lr$az-$i - - check ovn-nbctl lrp-add lr$az-$i lrp-lr$az-$i-ls$az-$i $lrp_ls_mac $lrp_ls_ip/24 - check ovn-nbctl lsp-add ls$az-$i lsp-ls$az-$i-lr$az-$i - check ovn-nbctl lsp-set-addresses lsp-ls$az-$i-lr$az-$i router - check ovn-nbctl lsp-set-type lsp-ls$az-$i-lr$az-$i router - check ovn-nbctl lsp-set-options lsp-ls$az-$i-lr$az-$i router-port=lrp-lr$az-$i-ls$az-$i - - check ovn-nbctl lrp-add lr$az-$i lrp-lr$az-$i-ts$i $lrp_ts_mac $lrp_ts_ip/24 - check ovn-nbctl lsp-add ts$i lsp-ts$i-lr$az-$i - check ovn-nbctl lsp-set-addresses lsp-ts$i-lr$az-$i router - check ovn-nbctl lsp-set-type lsp-ts$i-lr$az-$i router - check ovn-nbctl lsp-set-options lsp-ts$i-lr$az-$i router-port=lrp-lr$az-$i-ts$i - check ovn-nbctl lrp-set-gateway-chassis lrp-lr$az-$i-ts$i gw$az - done - check ovn-nbctl --wait=hv sync - ovn-sbctl list Port_Binding > az$az.ports - wait_for_ports_up -done - -# Pre-populate the hypervisors' ARP tables so that we don't lose any -# packets for ARP resolution (native tunneling doesn't queue packets -# for ARP resolution). -OVN_POPULATE_ARP - -for i in `seq 1 $n_az`; do - check ovn_as az$i ovn-nbctl --wait=hv sync - ovn_as az$i ovn-sbctl dump-flows > az$i/sbflows -done - -# Allow some time for ovn-northd and ovn-controller to catch up. -# XXX This should be more systematic. -sleep 2 - -# Populate requested-chassis options for remote lsps -for az in $(seq 1 $n_az); do - ovn_as az${az} - for ts in $(seq 1 $n_ts); do - for i in $(seq 1 $n_ts); do - if [[ $i -eq ${az} ]]; then - continue - fi - check ovn-nbctl lsp-set-options lsp-ts${ts}-lr${i}-${ts} requested-chassis=gw$i - done - done -done - -ovn-ic-nbctl show > ic-nbctl.dump -AT_CAPTURE_FILE([ic-nbctl.dump]) - -(echo "---------ISB dump-----" - ovn-ic-sbctl show - echo "---------------------" - ovn-ic-sbctl list gateway - echo "---------------------" - ovn-ic-sbctl list datapath_binding - echo "---------------------" - ovn-ic-sbctl list port_binding - echo "---------------------" - ovn-ic-sbctl list route - echo "---------------------") > ic-sbctl.dump -AT_CAPTURE_FILE([ic-sbctl.dump]) - -AT_CAPTURE_FILE([expected]) -AT_CAPTURE_FILE([received]) -check_packets() { - > expected - > received - for az in `seq 1 $n_az`; do - for i in `seq 1 $n_ts`; do - pcap=hv$az/vif$i-tx.pcap - echo "--- $pcap" | tee -a expected >> received - if test -e $az-$i.expected; then - sort $az-$i.expected >> expected - fi - if test -e $pcap; then - $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" $pcap | sort >> received - fi - echo | tee -a expected >> received - done - done - - $at_diff expected received >/dev/null -} - -# Send packets between AZs on each TS -for s_az in $(seq 1 $n_az); do - ovn_as az${s_az} - as hv${s_az} - for d_az in $(seq 1 $n_az); do - if test $s_az = $d_az; then - continue - fi - - for i in $(seq 1 $n_ts); do - echo - AS_BOX([packet from az$s_az to az$d_az via ts$i]) - lsp_smac=00:00:00:0${s_az}:0$i:00 - lsp_dmac=00:00:00:0${d_az}:0$i:00 - lrp_ls_smac=00:00:00:0${s_az}:0$i:01 - lrp_ls_dmac=00:00:00:0${d_az}:0$i:01 - lsp_sip=10.${s_az}.$i.123 - lsp_dip=10.${d_az}.$i.123 - - ovn_inport=lsp${s_az}-$i - packet="inport==\"$ovn_inport\" && eth.src==$lsp_smac && eth.dst==$lrp_ls_smac && - ip4 && ip.ttl==64 && ip4.src==$lsp_sip && ip4.dst==$lsp_dip && - udp && udp.src==53 && udp.dst==4369" - echo "sending: $packet" - AT_CHECK([ovn_trace --ovs "$packet" > ${s_az}-${d_az}-$i.ovn-trace]) - OVS_WAIT_UNTIL([ovs-appctl -t ovn-controller inject-pkt "$packet"]) - ovs_inport=$(ovs-vsctl --bare --columns=ofport find Interface external-ids:iface-id="$ovn_inport") - - ovs_packet=$(echo $packet | ovstest test-ovn expr-to-packets) - echo ovs_inport=$ovs_inport ovs_packet=$ovs_packet - AT_CHECK([ovs-appctl ofproto/trace br-int in_port="$ovs_inport" "$ovs_packet" > ${s_az}-${d_az}-$i.ovs-trace]) - - # Packet to Expect - # The TTL should be decremented by 2. - packet="eth.src==$lrp_ls_dmac && eth.dst==$lsp_dmac && - ip4 && ip.ttl==62 && ip4.src==$lsp_sip && ip4.dst==$lsp_dip && - udp && udp.src==53 && udp.dst==4369" - echo $packet | ovstest test-ovn expr-to-packets >> ${d_az}-$i.expected - done - done -done -OVS_WAIT_UNTIL([check_packets], [$at_diff -F'^---' expected received]) - -for az in `seq 1 $n_az`; do - OVN_CLEANUP_SBOX([hv$az]) - OVN_CLEANUP_SBOX([gw$az]) - OVN_CLEANUP_AZ([az$az]) -done - -OVN_CLEANUP_IC - -AT_CLEANUP -]) - -OVN_FOR_EACH_NORTHD([ -AT_SETUP([interconnection - static multicast]) - -# Logical network: -# -# AZ1 | AZ2 -# --------------------------------------------------------------------- -# | -# | +-- LR2 --- LS2 --- LSP2 (sender) -# | | | -# | | +----- LSP4 (receiver) -# | / -# LSP1 --- LS1 --- LR1 --- TS --- -# (receiver) | \ -# | +-- LR3 --- LS3 --- LSP3 (receiver) -# -# LS1, LS2, LS3 configured to flood unregistered IP multicast. -# LR1, LR2, LR3 configured to relay IP multicast. -# LR1-LS1 configured to flood IP multicast traffic unconditionally. -# LR3-LS3 configured to flood IP multicast traffic unconditionally. - -AT_CAPTURE_FILE([exp]) -AT_CAPTURE_FILE([rcv]) -check_packets() { - > exp - > rcv - if test "$1" = --uniq; then - sort="sort -u"; shift - else - sort=sort - fi - for tuple in "$@"; do - set $tuple; pcap=$1 type=$2 - echo "--- $pcap" | tee -a exp >> rcv - $sort "$type" >> exp - $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" $pcap | $sort >> rcv - echo | tee -a exp >> rcv - done - - $at_diff exp rcv >/dev/null -} - -ovn_init_ic_db -ovn_start az1 -ovn_start az2 - -net_add n1 - -sim_add hv1 -as hv1 -check ovs-vsctl add-br br-phys -ovn_az_attach az1 n1 br-phys 192.168.1.1 16 -check ovs-vsctl -- add-port br-int hv1-vif1 \ - -- set interface hv1-vif1 external-ids:iface-id=lsp1 \ - options:tx_pcap=hv1/vif1-tx.pcap \ - options:rxq_pcap=hv1/vif1-rx.pcap -check ovs-vsctl set open . external-ids:ovn-is-interconn=true - -sim_add hv2 -as hv2 -check ovs-vsctl add-br br-phys -ovn_az_attach az2 n1 br-phys 192.168.2.1 16 -check ovs-vsctl -- add-port br-int hv2-vif1 \ - -- set interface hv2-vif1 external-ids:iface-id=lsp2 \ - options:tx_pcap=hv2/vif1-tx.pcap \ - options:rxq_pcap=hv2/vif1-rx.pcap -check ovs-vsctl -- add-port br-int hv2-vif2 \ - -- set interface hv2-vif2 external-ids:iface-id=lsp3 \ - options:tx_pcap=hv2/vif2-tx.pcap \ - options:rxq_pcap=hv2/vif2-rx.pcap -check ovs-vsctl -- add-port br-int hv2-vif3 \ - -- set interface hv2-vif3 external-ids:iface-id=lsp4 \ - options:tx_pcap=hv2/vif3-tx.pcap \ - options:rxq_pcap=hv2/vif3-rx.pcap -check ovs-vsctl set open . external-ids:ovn-is-interconn=true - -AT_CHECK([ovn-ic-nbctl create Transit_Switch name=ts], [0], [ignore]) -check ovn_as az1 ovn-nbctl wait-until logical_switch ts -check ovn_as az2 ovn-nbctl wait-until logical_switch ts - -ovn_as az1 -check ovn-nbctl lr-add lr1 \ - -- lrp-add lr1 lr1-ts 00:00:00:01:00:01 42.42.42.1/24 \ - -- lrp-add lr1 lr1-ls1 00:00:00:01:01:00 43.43.43.1/24 \ - -- lrp-set-gateway-chassis lr1-ts hv1 -check ovn-nbctl ls-add ls1 \ - -- lsp-add ls1 ls1-lr1 \ - -- lsp-set-addresses ls1-lr1 router \ - -- lsp-set-type ls1-lr1 router \ - -- lsp-set-options ls1-lr1 router-port=lr1-ls1 \ - -- lsp-add ls1 lsp1 -check ovn-nbctl lsp-add ts ts-lr1 \ - -- lsp-set-addresses ts-lr1 router \ - -- lsp-set-type ts-lr1 router \ - -- lsp-set-options ts-lr1 router-port=lr1-ts -wait_for_ports_up - -ovn_as az2 -check ovn-nbctl lr-add lr2 \ - -- lrp-add lr2 lr2-ts 00:00:00:02:00:01 42.42.42.2/24 \ - -- lrp-add lr2 lr2-ls2 00:00:00:02:01:00 44.44.44.1/24 \ - -- lrp-set-gateway-chassis lr2-ts hv2 -check ovn-nbctl ls-add ls2 \ - -- lsp-add ls2 ls2-lr2 \ - -- lsp-set-addresses ls2-lr2 router \ - -- lsp-set-type ls2-lr2 router \ - -- lsp-set-options ls2-lr2 router-port=lr2-ls2 \ - -- lsp-add ls2 lsp2 \ - -- lsp-add ls2 lsp4 -check ovn-nbctl lsp-add ts ts-lr2 \ - -- lsp-set-addresses ts-lr2 router \ - -- lsp-set-type ts-lr2 router \ - -- lsp-set-options ts-lr2 router-port=lr2-ts - -check ovn-nbctl lr-add lr3 \ - -- lrp-add lr3 lr3-ts 00:00:00:02:00:02 42.42.42.3/24 \ - -- lrp-add lr3 lr3-ls3 00:00:00:02:02:00 44.44.45.1/24 \ - -- lrp-set-gateway-chassis lr3-ts hv2 -check ovn-nbctl ls-add ls3 \ - -- lsp-add ls3 ls3-lr3 \ - -- lsp-set-addresses ls3-lr3 router \ - -- lsp-set-type ls3-lr3 router \ - -- lsp-set-options ls3-lr3 router-port=lr3-ls3 \ - -- lsp-add ls3 lsp3 -check ovn-nbctl lsp-add ts ts-lr3 \ - -- lsp-set-addresses ts-lr3 router \ - -- lsp-set-type ts-lr3 router \ - -- lsp-set-options ts-lr3 router-port=lr3-ts - -wait_for_ports_up - -ovn_as az1 -OVS_WAIT_UNTIL([ovn-nbctl show | grep ts-lr2]) -check ovn-nbctl lsp-set-options ts-lr2 requested-chassis=hv2 -OVS_WAIT_UNTIL([ovn-nbctl show | grep ts-lr3]) -check ovn-nbctl lsp-set-options ts-lr3 requested-chassis=hv2 - -ovn_as az2 -OVS_WAIT_UNTIL([ovn-nbctl show | grep ts-lr1]) -check ovn-nbctl lsp-set-options ts-lr1 requested-chassis=hv1 - -dnl Enable unregistered IP multicast flooding and IP multicast relay. -ovn_as az1 -check ovn-nbctl set logical_switch ls1 other_config:mcast_snoop="true" \ - other_config:mcast_flood_unregistered="true" -check ovn-nbctl set logical_router lr1 options:mcast_relay="true" -check ovn-nbctl set logical_router_port lr1-ls1 options:mcast_flood="true" - -ovn_as az2 -check ovn-nbctl set logical_switch ls2 other_config:mcast_snoop="true" \ - other_config:mcast_flood_unregistered="true" -check ovn-nbctl set logical_router lr2 options:mcast_relay="true" -check ovn-nbctl set logical_router_port lr2-ts options:mcast_flood="true" -check ovn-nbctl set logical_switch ls3 other_config:mcast_snoop="true" \ - other_config:mcast_flood_unregistered="true" -check ovn-nbctl set logical_router lr3 options:mcast_relay="true" -check ovn-nbctl set logical_router_port lr3-ls3 options:mcast_flood="true" - -check ovn_as az1 ovn-nbctl --wait=hv sync -check ovn_as az2 ovn-nbctl --wait=hv sync - -# Pre-populate the hypervisors' ARP tables so that we don't lose any -# packets for ARP resolution (native tunneling doesn't queue packets -# for ARP resolution). -OVN_POPULATE_ARP - -# Send an IP multicast packet from lsp2, it should be forwarded -# statically to lsp1, lsp3 and lsp4. -> expected_az1 -> expected_az2 -> expected_az2_switched -send_ip_multicast_pkt hv2-vif1 hv2 \ - 000000000001 01005e000144 \ - $(ip_to_hex 44 44 44 2) $(ip_to_hex 239 0 1 68) 1e 20 7c6b 11 \ - e518e518000aed350000 -store_ip_multicast_pkt \ - 000000010100 01005e000144 \ - $(ip_to_hex 44 44 44 2) $(ip_to_hex 239 0 1 68) 1e 1e 7e6b 11 \ - e518e518000aed350000 expected_az1 -store_ip_multicast_pkt \ - 000000020200 01005e000144 \ - $(ip_to_hex 44 44 44 2) $(ip_to_hex 239 0 1 68) 1e 1e 7e6b 11 \ - e518e518000aed350000 expected_az2 -store_ip_multicast_pkt \ - 000000000001 01005e000144 \ - $(ip_to_hex 44 44 44 2) $(ip_to_hex 239 0 1 68) 1e 20 7c6b 11 \ - e518e518000aed350000 expected_az2_switched - -OVS_WAIT_UNTIL( - [check_packets 'hv1/vif1-tx.pcap expected_az1' \ - 'hv2/vif2-tx.pcap expected_az2' \ - 'hv2/vif3-tx.pcap expected_az2_switched'], - [$at_diff -F'^---' exp rcv]) - -# Send an IP multicast packet from lsp2 towards 224.0.0.x, it should be -# forwarded statically only to lsp3. -as hv1 reset_pcap_file hv1-vif1 hv1/vif1 -as hv2 reset_pcap_file hv2-vif2 hv2/vif2 -as hv2 reset_pcap_file hv2-vif3 hv2/vif3 -> expected_az1 -> expected_az2 -> expected_az2_switched -send_ip_multicast_pkt hv2-vif1 hv2 \ - 000000000001 01005e000144 \ - $(ip_to_hex 44 44 44 2) $(ip_to_hex 224 0 0 1) 1e 20 8cae 11 \ - e518e518000aed350000 -store_ip_multicast_pkt \ - 000000000001 01005e000144 \ - $(ip_to_hex 44 44 44 2) $(ip_to_hex 224 0 0 1) 1e 20 8cae 11 \ - e518e518000aed350000 expected_az2_switched - -OVS_WAIT_UNTIL( - [check_packets 'hv1/vif1-tx.pcap expected_az1' \ - 'hv2/vif2-tx.pcap expected_az2' \ - 'hv2/vif3-tx.pcap expected_az2_switched'], - [$at_diff -F'^---' exp rcv]) - -OVN_CLEANUP_SBOX([hv1],["/IGMP Querier enabled without a valid IPv4 or IPv6 address/d -/IGMP Querier enabled with invalid ETH src address/d"]) - -OVN_CLEANUP_SBOX([hv2],["/IGMP Querier enabled without a valid IPv4 or IPv6 address/d -/IGMP Querier enabled with invalid ETH src address/d"]) - -OVN_CLEANUP_IC([az1],[az2]) -AT_CLEANUP -]) - -OVN_FOR_EACH_NORTHD([ -AT_SETUP([interconnection - IGMP/MLD multicast]) -AT_KEYWORDS([IP-multicast]) - -# Logical network: -# -# AZ1 | AZ2 -# --------------------------------------------------------------------- -# | -# | +-- LR2 --- LS2 --- LSP2 (sender) -# | / -# LSP1 --- LS1 --- LR1 --- TS --- -# (receiver) | \ -# | +-- LR3 --- LS3 --- LSP3 (receiver) -# -# LS1, LS2, LS3, TS configured to snoop IP multicast. -# LR1, LR2, LR3 configured to relay IP multicast. -# LR1-TS configured to flood IP multicast traffic unconditionally. -# LR2-TS configured to flood IP multicast traffic unconditionally. -# LR3-TS configured to flood IP multicast traffic unconditionally. - -AT_CAPTURE_FILE([exp]) -AT_CAPTURE_FILE([rcv]) -check_packets() { - > exp - > rcv - if test "$1" = --uniq; then - sort="sort -u"; shift - else - sort=sort - fi - for tuple in "$@"; do - set $tuple; pcap=$1 type=$2 - echo "--- $pcap" | tee -a exp >> rcv - $sort "$type" >> exp - $PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" $pcap | $sort >> rcv - echo | tee -a exp >> rcv - done - - $at_diff exp rcv >/dev/null -} - -ovn_init_ic_db -ovn_start az1 -ovn_start az2 - -net_add n1 - -sim_add hv1 -as hv1 -check ovs-vsctl add-br br-phys -ovn_az_attach az1 n1 br-phys 192.168.1.1 16 -check ovs-vsctl -- add-port br-int hv1-vif1 \ - -- set interface hv1-vif1 external-ids:iface-id=lsp1 \ - options:tx_pcap=hv1/vif1-tx.pcap \ - options:rxq_pcap=hv1/vif1-rx.pcap -check ovs-vsctl set open . external-ids:ovn-is-interconn=true - -sim_add hv2 -as hv2 -check ovs-vsctl add-br br-phys -ovn_az_attach az2 n1 br-phys 192.168.2.1 16 -check ovs-vsctl -- add-port br-int hv2-vif1 \ - -- set interface hv2-vif1 external-ids:iface-id=lsp2 \ - options:tx_pcap=hv2/vif1-tx.pcap \ - options:rxq_pcap=hv2/vif1-rx.pcap -check ovs-vsctl -- add-port br-int hv2-vif2 \ - -- set interface hv2-vif2 external-ids:iface-id=lsp3 \ - options:tx_pcap=hv2/vif2-tx.pcap \ - options:rxq_pcap=hv2/vif2-rx.pcap -check ovs-vsctl set open . external-ids:ovn-is-interconn=true - -AT_CHECK([ovn-ic-nbctl create Transit_Switch name=ts], [0], [ignore]) -check ovn_as az1 ovn-nbctl wait-until logical_switch ts -check ovn_as az2 ovn-nbctl wait-until logical_switch ts - -ovn_as az1 -check ovn-nbctl lr-add lr1 \ - -- lrp-add lr1 lr1-ts 00:00:00:01:00:01 42.42.42.1/24 4242::1/64 \ - -- lrp-add lr1 lr1-ls1 00:00:00:01:01:00 43.43.43.1/24 4343::1/64\ - -- lrp-set-gateway-chassis lr1-ts hv1 -check ovn-nbctl ls-add ls1 \ - -- lsp-add ls1 ls1-lr1 \ - -- lsp-set-addresses ls1-lr1 router \ - -- lsp-set-type ls1-lr1 router \ - -- lsp-set-options ls1-lr1 router-port=lr1-ls1 \ - -- lsp-add ls1 lsp1 -check ovn-nbctl lsp-add ts ts-lr1 \ - -- lsp-set-addresses ts-lr1 router \ - -- lsp-set-type ts-lr1 router \ - -- lsp-set-options ts-lr1 router-port=lr1-ts -wait_for_ports_up - -ovn_as az2 -check ovn-nbctl lr-add lr2 \ - -- lrp-add lr2 lr2-ts 00:00:00:02:00:01 42.42.42.2/24 4242::2/64 \ - -- lrp-add lr2 lr2-ls2 00:00:00:02:01:00 44.44.44.1/24 4444::1/64 \ - -- lrp-set-gateway-chassis lr2-ts hv2 -check ovn-nbctl ls-add ls2 \ - -- lsp-add ls2 ls2-lr2 \ - -- lsp-set-addresses ls2-lr2 router \ - -- lsp-set-type ls2-lr2 router \ - -- lsp-set-options ls2-lr2 router-port=lr2-ls2 \ - -- lsp-add ls2 lsp2 -check ovn-nbctl lsp-add ts ts-lr2 \ - -- lsp-set-addresses ts-lr2 router \ - -- lsp-set-type ts-lr2 router \ - -- lsp-set-options ts-lr2 router-port=lr2-ts - -check ovn-nbctl lr-add lr3 \ - -- lrp-add lr3 lr3-ts 00:00:00:02:00:02 42.42.42.3/24 4242::3/64 \ - -- lrp-add lr3 lr3-ls3 00:00:00:02:02:00 44.44.45.1/24 4445::1/64 \ - -- lrp-set-gateway-chassis lr3-ts hv2 -check ovn-nbctl ls-add ls3 \ - -- lsp-add ls3 ls3-lr3 \ - -- lsp-set-addresses ls3-lr3 router \ - -- lsp-set-type ls3-lr3 router \ - -- lsp-set-options ls3-lr3 router-port=lr3-ls3 \ - -- lsp-add ls3 lsp3 -check ovn-nbctl lsp-add ts ts-lr3 \ - -- lsp-set-addresses ts-lr3 router \ - -- lsp-set-type ts-lr3 router \ - -- lsp-set-options ts-lr3 router-port=lr3-ts - -wait_for_ports_up - -ovn_as az1 -OVS_WAIT_UNTIL([ovn-nbctl show | grep ts-lr2]) -check ovn-nbctl lsp-set-options ts-lr2 requested-chassis=hv2 -OVS_WAIT_UNTIL([ovn-nbctl show | grep ts-lr3]) -check ovn-nbctl lsp-set-options ts-lr3 requested-chassis=hv2 - -ovn_as az2 -OVS_WAIT_UNTIL([ovn-nbctl show | grep ts-lr1]) -check ovn-nbctl lsp-set-options ts-lr1 requested-chassis=hv1 - -dnl Enable IP multicast snooping and IP multicast relay. Reports are -dnl forwarded statically. -ovn_as az1 -check ovn-nbctl set logical_switch ls1 other_config:mcast_snoop="true" -check ovn-nbctl set Logical_Switch_Port ls1-lr1 options:mcast_flood_reports="true" -check ovn-nbctl set logical_router lr1 options:mcast_relay="true" -check ovn-nbctl set logical_router_port lr1-ts options:mcast_flood="true" -check ovn-nbctl set logical_switch ts other_config:mcast_snoop="true" -check ovn-nbctl set logical_switch_port ts-lr1 options:mcast_flood_reports="true" -check ovn-nbctl set logical_switch_port ts-lr2 options:mcast_flood_reports="true" -check ovn-nbctl set logical_switch_port ts-lr3 options:mcast_flood_reports="true" - -ovn_as az2 -check ovn-nbctl set logical_switch ls2 other_config:mcast_snoop="true" -check ovn-nbctl set Logical_Switch_Port ls2-lr2 options:mcast_flood_reports="true" -check ovn-nbctl set logical_router lr2 options:mcast_relay="true" -check ovn-nbctl set logical_router_port lr2-ts options:mcast_flood="true" -check ovn-nbctl set logical_switch ls3 other_config:mcast_snoop="true" -check ovn-nbctl set Logical_Switch_Port ls3-lr3 options:mcast_flood_reports="true" -check ovn-nbctl set logical_router lr3 options:mcast_relay="true" -check ovn-nbctl set logical_router_port lr3-ts options:mcast_flood="true" -check ovn-nbctl set logical_switch ts other_config:mcast_snoop="true" -check ovn-nbctl set logical_switch_port ts-lr1 options:mcast_flood_reports="true" -check ovn-nbctl set logical_switch_port ts-lr2 options:mcast_flood_reports="true" -check ovn-nbctl set logical_switch_port ts-lr3 options:mcast_flood_reports="true" - -check ovn_as az1 ovn-nbctl --wait=hv sync -check ovn_as az2 ovn-nbctl --wait=hv sync - -# Pre-populate the hypervisors' ARP tables so that we don't lose any -# packets for ARP resolution (native tunneling doesn't queue packets -# for ARP resolution). -OVN_POPULATE_ARP - -# Inject IGMP Join for 239.0.1.68 on LSP1. -send_igmp_v3_report hv1-vif1 hv1 \ - 000000000001 $(ip_to_hex 10 0 0 1) f9f8 \ - $(ip_to_hex 239 0 1 68) 04 e9b9 \ - /dev/null - -# Inject MLD Join for ff0a:dead:beef::1 on LSP1. -send_mld_v2_report hv1-vif1 hv1 \ - 000000000001 10000000000000000000000000000001 \ - ff0adeadbeef00000000000000000001 04 c0e4 \ - /dev/null - -# Inject IGMP Join for 239.0.1.68 on LSP3. -send_igmp_v3_report hv2-vif2 hv2 \ - 000000000001 $(ip_to_hex 10 0 0 1) f9f8 \ - $(ip_to_hex 239 0 1 68) 04 e9b9 \ - /dev/null - -# Inject MLD Join for ff0a:dead:beef::1 on LSP3. -send_mld_v2_report hv2-vif2 hv2 \ - 000000000001 10000000000000000000000000000001 \ - ff0adeadbeef00000000000000000001 04 c0e4 \ - /dev/null - -# Check that the IGMP and MLD groups are learned on both AZs (on the LS -# and TS). -ovn_as az1 -wait_row_count IGMP_Group 2 address=239.0.1.68 -wait_row_count IGMP_Group 2 address='"ff0a:dead:beef::1"' -check ovn-nbctl --wait=hv sync - -ovn_as az2 -wait_row_count IGMP_Group 2 address=239.0.1.68 -wait_row_count IGMP_Group 2 address='"ff0a:dead:beef::1"' -check ovn-nbctl --wait=hv sync - -# Send an IP multicast packet from LSP2, it should be forwarded -# to lsp1 and lsp3. -> expected_az1 -> expected_az2 -send_ip_multicast_pkt hv2-vif1 hv2 \ - 000000000001 01005e000144 \ - $(ip_to_hex 44 44 44 2) $(ip_to_hex 239 0 1 68) 1e 20 7c6b 11 \ - e518e518000aed350000 -store_ip_multicast_pkt \ - 000000010100 01005e000144 \ - $(ip_to_hex 44 44 44 2) $(ip_to_hex 239 0 1 68) 1e 1e 7e6b 11 \ - e518e518000aed350000 expected_az1 -store_ip_multicast_pkt \ - 000000020200 01005e000144 \ - $(ip_to_hex 44 44 44 2) $(ip_to_hex 239 0 1 68) 1e 1e 7e6b 11 \ - e518e518000aed350000 expected_az2 - -send_ip6_multicast_pkt hv2-vif1 hv2 \ - 000000000001 333300000001 \ - 00100000000000000000000000000042 ff0adeadbeef00000000000000000001 \ - 000e 40 11 \ - 93407a69000e2b4e61736461640a -store_ip6_multicast_pkt \ - 000000010100 333300000001 \ - 00100000000000000000000000000042 ff0adeadbeef00000000000000000001 \ - 000e 3e 11 \ - 93407a69000e2b4e61736461640a \ - expected_az1 -store_ip6_multicast_pkt \ - 000000020200 333300000001 \ - 00100000000000000000000000000042 ff0adeadbeef00000000000000000001 \ - 000e 3e 11 \ - 93407a69000e2b4e61736461640a \ - expected_az2 - -OVS_WAIT_UNTIL( - [check_packets 'hv1/vif1-tx.pcap expected_az1' \ - 'hv2/vif2-tx.pcap expected_az2'], - [$at_diff -F'^---' exp rcv]) - -OVN_CLEANUP_SBOX([hv1], ["/IGMP Querier enabled without a valid IPv4/d -/IGMP Querier enabled with invalid ETH src/d"]) - -OVN_CLEANUP_SBOX([hv2], ["/IGMP Querier enabled without a valid IPv4/d -/IGMP Querier enabled with invalid ETH src/d"]) - -OVN_CLEANUP_IC([az1],[az2]) -AT_CLEANUP -]) - OVN_FOR_EACH_NORTHD([ AT_SETUP([ECMP static routes]) ovn_start From patchwork Tue Feb 27 10:40:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammad Heib X-Patchwork-Id: 1904983 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=HyuRWjJU; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TkYtW0f5Sz23cb for ; Tue, 27 Feb 2024 21:41:06 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 9FDCC40894; Tue, 27 Feb 2024 10:41:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c_8Qdi3x-mn6; Tue, 27 Feb 2024 10:41:02 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 730C540533 Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=HyuRWjJU Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 730C540533; Tue, 27 Feb 2024 10:41:02 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 33BE6C0077; Tue, 27 Feb 2024 10:41:02 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id CA833C0037 for ; Tue, 27 Feb 2024 10:41:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id B431481441 for ; Tue, 27 Feb 2024 10:41:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BSn2gmT-VopK for ; Tue, 27 Feb 2024 10:40:59 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=mheib@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 0C8E98143B Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 0C8E98143B Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=HyuRWjJU Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 0C8E98143B for ; Tue, 27 Feb 2024 10:40:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709030457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LLI1wEOWFyDrXwonaU/qBazhvI3Dgt/ZGvYtcKzQLNQ=; b=HyuRWjJU5ykg0WuDxONNeOPSAEbkUW5/0tnJRDwYKgb/cKPzaTVAEVGGtAJsRXKfpfAW3V 4BDdg1pn1RUjNlsyu7sC4HAvOQ7/5BAelWgm6hTzhmf53sanGkqSMrD8Ge7krX1O2K8EFi yITqlhRf4ytbgo8uh0pVlCR7sZhIdA8= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-663-MOvnNHwHO9GgtpY2LnBetA-1; Tue, 27 Feb 2024 05:40:56 -0500 X-MC-Unique: MOvnNHwHO9GgtpY2LnBetA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0633A1C29EA2 for ; Tue, 27 Feb 2024 10:40:56 +0000 (UTC) Received: from mheiblap.localdomain.com (unknown [10.47.238.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E7342BE; Tue, 27 Feb 2024 10:40:54 +0000 (UTC) From: Mohammad Heib To: dev@openvswitch.org Date: Tue, 27 Feb 2024 12:40:49 +0200 Message-Id: <20240227104049.1769578-2-mheib@redhat.com> In-Reply-To: <20240227104049.1769578-1-mheib@redhat.com> References: <20240227104049.1769578-1-mheib@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 2/2] tests: Use sync command in ovn-ic tests. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Use the sync commands in the ovn-ic unit tests and remove lines that wait for IC-SB to sync with IC-NB. Signed-off-by: Mohammad Heib --- tests/ovn-ic.at | 178 ++++++++++++++++++++---------------------------- 1 file changed, 72 insertions(+), 106 deletions(-) diff --git a/tests/ovn-ic.at b/tests/ovn-ic.at index 12267e960..4a24e171b 100644 --- a/tests/ovn-ic.at +++ b/tests/ovn-ic.at @@ -6,7 +6,7 @@ ovn_init_ic_db ovn_start az1 ovn_start az2 -wait_row_count ic-sb:Availability_Zone 2 +check ovn-ic-nbctl --wait=sb sync AT_CHECK([ovn-ic-sbctl show], [0], [dnl availability-zone az1 availability-zone az2 @@ -31,7 +31,6 @@ OVN_CLEANUP_IC([az1], [az2]) AT_CLEANUP ]) - OVN_FOR_EACH_NORTHD([ AT_SETUP([ovn-ic -- AZ update in GW]) ovn_init_ic_db @@ -47,10 +46,12 @@ check ovs-vsctl set open . external-ids:ovn-is-interconn=true az_uuid=$(fetch_column ic-sb:availability-zone _uuid name="az1") ovn_as az1 ovn-nbctl set NB_Global . name="az2" -wait_column "$az_uuid" ic-sb:availability-zone _uuid name="az2" + +check ovn-ic-nbctl --wait=sb sync +check_column "$az_uuid" ic-sb:availability-zone _uuid name="az2" # make sure that gateway still point to the same AZ with new name -wait_column "$az_uuid" ic-sb:gateway availability_zone name="gw-az1" +check_column "$az_uuid" ic-sb:gateway availability_zone name="gw-az1" OVN_CLEANUP_IC([az1]) AT_CLEANUP @@ -66,11 +67,11 @@ ovn_start az1 ovn-sbctl chassis-add fakechassis vxlan 192.168.0.2 AT_CHECK([ovn-ic-nbctl ts-add ts1]) -AT_CHECK([ovn-ic-nbctl ts-add ts2]) +AT_CHECK([ovn-ic-nbctl --wait=sb ts-add ts2]) # Check ISB -wait_row_count ic-sb:Datapath_Binding 1 transit_switch=ts1 -wait_row_count ic-sb:Datapath_Binding 1 transit_switch=ts2 +check_row_count ic-sb:Datapath_Binding 1 transit_switch=ts1 +check_row_count ic-sb:Datapath_Binding 1 transit_switch=ts2 check_column "ts1 ts2" ic-sb:Datapath_Binding transit_switch check_column "ts1 ts2" nb:Logical_Switch name @@ -81,8 +82,8 @@ ts1_key=$(fetch_column ic-sb:Datapath_Binding tunnel_key transit_switch=ts1) check_column "$ts1_key" Datapath_Binding tunnel_key external_ids:interconn-ts=ts1 # Test delete -AT_CHECK([ovn-ic-nbctl ts-del ts1]) -wait_row_count ic-sb:Datapath_Binding 0 transit_switch=ts1 +AT_CHECK([ovn-ic-nbctl --wait=sb ts-del ts1]) +check_row_count ic-sb:Datapath_Binding 0 transit_switch=ts1 check_column ts2 ic-sb:Datapath_Binding transit_switch check_column ts2 nb:Logical_Switch name @@ -111,12 +112,11 @@ done ovn_as az1 # create transit switch and connect to LR -check ovn-ic-nbctl ts-add ts1 +check ovn-ic-nbctl --wait=sb ts-add ts1 check ovn-nbctl lr-add lr1 check ovn-nbctl lrp-add lr1 lrp1 00:00:00:00:00:01 10.0.0.1/24 check ovn-nbctl lrp-set-gateway-chassis lrp1 gw-az1 -OVS_WAIT_UNTIL([ovn-nbctl show | grep switch | grep ts1]) check ovn-nbctl lsp-add ts1 lsp1 -- \ lsp-set-addresses lsp1 router -- \ lsp-set-type lsp1 router -- \ @@ -124,8 +124,8 @@ check ovn-nbctl lsp-add ts1 lsp1 -- \ wait_row_count Datapath_Binding 1 external_ids:interconn-ts=ts1 -# check port binding appeared -OVS_WAIT_UNTIL([ovn-ic-sbctl show | grep lsp1]) +# Sync ic-sb DB to see the TS changes. +check ovn-ic-nbctl --wait=sb sync AT_CHECK([ovn-ic-sbctl show | grep -A2 lsp1], [0], [dnl port lsp1 @@ -134,8 +134,8 @@ AT_CHECK([ovn-ic-sbctl show | grep -A2 lsp1], [0], [dnl ]) # remove transit switch and check if port_binding is deleted -check ovn-ic-nbctl ts-del ts1 -wait_row_count ic-sb:Port_Binding 0 logical_port=lsp1 +check ovn-ic-nbctl --wait=sb ts-del ts1 +check_row_count ic-sb:Port_Binding 0 logical_port=lsp1 for i in 1 2; do az=az$i ovn_as $az @@ -180,8 +180,7 @@ create_ic_infra() { ovn_as $az - check ovn-ic-nbctl ts-add $ts - OVS_WAIT_UNTIL([ovn-nbctl show | grep switch | grep $ts]) + check ovn-ic-nbctl --wait=sb ts-add $ts check ovn-nbctl lr-add $lr check ovn-nbctl lrp-add $lr $lrp 00:00:00:00:00:0$az_id 10.0.$az_id.1/24 check ovn-nbctl lrp-set-gateway-chassis $lrp gw-$az @@ -197,18 +196,18 @@ create_ic_infra() { create_ic_infra 1 1 create_ic_infra 1 2 create_ic_infra 2 1 +check ovn-ic-nbctl --wait=sb sync ovn_as az1 -wait_row_count ic-sb:Route 3 ip_prefix=192.168.0.0/16 +check_row_count ic-sb:Route 3 ip_prefix=192.168.0.0/16 # remove transit switch 1 (from az1) and check if its route is deleted # same route from another AZ and ts should remain, as -check ovn-ic-nbctl ts-del ts1-1 -sleep 2 +check ovn-ic-nbctl --wait=sb ts-del ts1-1 ovn-ic-sbctl list route ovn-ic-nbctl list transit_switch -wait_row_count ic-sb:route 2 ip_prefix=192.168.0.0/16 +checl_row_count ic-sb:route 2 ip_prefix=192.168.0.0/16 ovn-ic-sbctl list route for i in 1 2; do @@ -246,7 +245,7 @@ done ovn_as az1 # create transit switch and connect to LR -check ovn-ic-nbctl ts-add ts1 +check ovn-ic-nbctl --wait=sb ts-add ts1 for i in 1 2; do ovn_as az$i @@ -254,7 +253,6 @@ for i in 1 2; do check ovn-nbctl lrp-add lr1 lrp$i 00:00:00:00:0$i:01 10.0.$i.1/24 check ovn-nbctl lrp-set-gateway-chassis lrp$i gw-az$i - OVS_WAIT_UNTIL([ovn-nbctl show | grep switch | grep ts1]) check ovn-nbctl lsp-add ts1 lsp$i -- \ lsp-set-addresses lsp$i router -- \ lsp-set-type lsp$i router -- \ @@ -270,7 +268,8 @@ ovn-nbctl \ --id=@id create logical-router-static-route ip_prefix=1.1.1.1/32 nexthop=10.0.1.10 -- \ add logical-router lr1 static_routes @id -wait_row_count ic-sb:route 1 ip_prefix=1.1.1.1/32 +check ovn-ic-nbctl --wait=sb sync +check_row_count ic-sb:route 1 ip_prefix=1.1.1.1/32 for i in 1 2; do az=az$i @@ -348,6 +347,8 @@ ovn-ic-nbctl ts-add ts1 net_add n1 ovn_start az1 ovn_start az2 +# sync IC-NB to IC-SB and AZs after AZs creation. +check ovn-ic-nbctl --wait=sb sync sim_add gw1 as gw1 ovs-vsctl add-br br-phys @@ -355,8 +356,6 @@ ovn_az_attach az1 n1 br-phys 192.168.0.1 ovs-vsctl set open . external-ids:ovn-is-interconn=true ovn_as az1 -OVS_WAIT_UNTIL([ovn-sbctl list datapath_binding | grep interconn-ts | grep ts1]) - # Create LRP and connect to TS ovn-nbctl lr-add lr1 ovn-nbctl lrp-add lr1 lrp-lr1-ts1 aa:aa:aa:aa:aa:01 169.254.100.1/24 @@ -418,13 +417,12 @@ ovn-ic-nbctl ts-add ts1 for i in 1 2; do ovn_start az$i ovn_as az$i - + check ovn-ic-nbctl --wait=sb sync # Enable route learning at AZ level ovn-nbctl set nb_global . options:ic-route-learn=true # Enable route advertising at AZ level ovn-nbctl set nb_global . options:ic-route-adv=true - OVS_WAIT_UNTIL([ovn-nbctl show | grep ts1]) # Create LRP and connect to TS ovn-nbctl lr-add lr$i ovn-nbctl lrp-add lr$i lrp-lr$i-ts1 aa:aa:aa:aa:aa:0$i 169.254.100.$i/24 @@ -454,15 +452,21 @@ Route Table
: # Delete route in AZ1, AZ2's learned route should be deleted. ovn_as az1 ovn-nbctl lr-route-del lr1 10.11.1.0/24 -OVS_WAIT_WHILE([ovn_as az2 ovn-nbctl lr-route-list lr2 | grep learned]) +ovn-ic-nbctl --wait=sb sync +AT_CHECK([ovn_as az2 ovn-nbctl lr-route-list lr2 | grep -c learned], [1], [dnl +0 +]) # Add the route back ovn_as az1 ovn-nbctl lr-route-add lr1 10.11.1.0/24 169.254.0.1 -OVS_WAIT_UNTIL([ovn_as az2 ovn-nbctl lr-route-list lr2 | grep learned]) +ovn-ic-nbctl --wait=sb sync +AT_CHECK([ovn_as az2 ovn-nbctl lr-route-list lr2 | grep -c learned], [0], [dnl +1 +]) # Disable route-learning for AZ1 ovn_as az1 ovn-nbctl set nb_global . options:ic-route-learn=false -OVS_WAIT_WHILE([ovn_as az1 ovn-nbctl lr-route-list lr1 | grep learned]) +ovn-ic-nbctl --wait=sb sync AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr1], [0], [dnl IPv4 Routes Route Table
: @@ -478,7 +482,7 @@ ovn_as az1 ovn-nbctl set nb_global . options:ic-route-adv=false # AZ2 shouldn't have the route learned, because AZ1 should have stopped # advertising. -OVS_WAIT_WHILE([ovn_as az2 ovn-nbctl lr-route-list lr2 | grep learned]) +check ovn-ic-nbctl --wait=sb sync AT_CHECK([ovn_as az2 ovn-nbctl lr-route-list lr2], [0], [dnl IPv4 Routes Route Table
: @@ -492,10 +496,7 @@ ovn_as az1 ovn-nbctl lr-route-add lr1 0.0.0.0/0 169.254.0.3 # Re-enable router-advertising & learn for AZ1 ovn_as az1 ovn-nbctl set nb_global . options:ic-route-adv=true ovn_as az1 ovn-nbctl set nb_global . options:ic-route-learn=true - -for i in 1 2; do - OVS_WAIT_UNTIL([ovn_as az$i ovn-nbctl lr-route-list lr$i | grep learned]) -done +check ovn-ic-nbctl --wait=sb sync # Default route should NOT get advertised or learned, by default. AT_CHECK([ovn_as az2 ovn-nbctl lr-route-list lr2], [0], [dnl @@ -558,8 +559,7 @@ for i in 1 2; do for j in 1 2; do ts=ts$j$j - ovn-ic-nbctl --may-exist ts-add $ts - OVS_WAIT_UNTIL([ovn-nbctl show | grep switch | grep $ts]) + ovn-ic-nbctl --wait=sb --may-exist ts-add $ts # Create LRP and connect to TS lr=lr$j$i @@ -582,9 +582,7 @@ echo az1 ovn_as az1 ovn-nbctl show echo az2 ovn_as az2 ovn-nbctl show - -OVS_WAIT_UNTIL([ovn_as az1 ovn-nbctl lr-route-list lr11 | grep learned | grep 192.168]) -OVS_WAIT_UNTIL([ovn_as az1 ovn-nbctl lr-route-list lr11 | grep learned | grep 10.10.10]) +check ovn-ic-nbctl --wait=sb sync # Test routes from lr12 were learned to lr11 AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr11 | @@ -606,7 +604,7 @@ ovn_as az2 ovn-nbctl lr-del lr22 # check routes origin advertisement and learning # setup topology with connected, static and source routes -ovn-ic-nbctl ts-add ts1 +ovn-ic-nbctl --wait=sb ts-add ts1 for i in 1 2; do ovn_as az$i @@ -618,7 +616,6 @@ for i in 1 2; do # Create LRP and connect to TS ovn-nbctl lr-add lr$i ovn-nbctl lrp-add lr$i lrp-lr$i-ts1 aa:aa:aa:aa:aa:0$i 169.254.100.$i/24 - OVS_WAIT_UNTIL([ovn-nbctl show | grep switch | grep ts1]) ovn-nbctl lsp-add ts1 lsp-ts1-lr$i \ -- lsp-set-addresses lsp-ts1-lr$i router \ -- lsp-set-type lsp-ts1-lr$i router \ @@ -633,10 +630,7 @@ for i in 1 2; do ovn-nbctl --policy=src-ip lr-route-add lr$i 10.22.$i.0/24 169.254.0.2 done -for i in 1 2; do - OVS_WAIT_UNTIL([ovn_as az$i ovn-nbctl lr-route-list lr$i | grep learned]) -done - +check ovn-ic-nbctl --wait=sb sync # check that advertised routes in ic-sb have correct origin ovn-ic-sbctl list route wait_row_count ic-sb:Route 1 ip_prefix=10.11.1.0/24 origin=static @@ -674,8 +668,7 @@ for i in 1 2; do ovn-nbctl set nb_global . options:ic-route-learn=true # Enable route advertising at AZ level ovn-nbctl set nb_global . options:ic-route-adv=true - - OVS_WAIT_UNTIL([ovn-nbctl show | grep ts1]) + check ovn-ic-nbctl --wait=sb sync # Create LRP and connect to TS ovn-nbctl lr-add lr$i @@ -688,10 +681,7 @@ for i in 1 2; do ovn-nbctl lrp-add lr$i lrp-lr$i-p$i 00:00:00:00:00:0$i 2002:db8:1::$i/64 done -for i in 1 2; do - OVS_WAIT_UNTIL([ovn_as az$i ovn-nbctl lr-route-list lr$i | grep learned]) -done - +check ovn-ic-nbctl --wait=sb sync AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr1 | awk '/learned/{print $1, $2}'], [0], [dnl 2002:db8:1::/64 2001:db8:1::2 ]) @@ -720,14 +710,12 @@ ovn-ic-nbctl ts-add ts1 for i in 1 2; do ovn_start az$i ovn_as az$i - + check ovn-ic-nbctl --wait=sb sync # Enable route learning at AZ level ovn-nbctl set nb_global . options:ic-route-learn=true # Enable route advertising at AZ level ovn-nbctl set nb_global . options:ic-route-adv=true - OVS_WAIT_UNTIL([ovn-nbctl show | grep ts1]) - # Create LRP and connect to TS ovn-nbctl lr-add lr$i ovn-nbctl lrp-add lr$i lrp-lr$i-ts1 aa:aa:aa:aa:aa:0$i 169.254.100.$i/24 @@ -743,10 +731,7 @@ for i in 1 2; do ovn-nbctl --policy=src-ip --route-table=rtb1 lr-route-add lr$i 10.22.$i.0/24 169.254.0.2 done -for i in 1 2; do - OVS_WAIT_UNTIL([ovn_as az$i ovn-nbctl lr-route-list lr$i | grep learned]) -done - +check ovn-ic-nbctl --wait=sb sync AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr1], [0], [dnl IPv4 Routes Route Table
: @@ -763,10 +748,7 @@ for i in 1 2; do ovn_as az$i ovn-nbctl --route-table=rtb1 lr-route-add lr$i 10.11.$i.0/24 169.254.0.1 done -for i in 1 2; do - OVS_WAIT_WHILE([ovn_as az$i ovn-nbctl lr-route-list lr$i | grep learned]) -done - +check ovn-ic-nbctl --wait=sb sync # ensure route from rtb1 is not learned to any route table as route table is # not set to TS port AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr1], [0], [dnl @@ -778,7 +760,7 @@ Route Table rtb1: # assign route table rtb1 to TS port on AZ2 and check routes are advertised to IC SB DB check ovn_as az2 ovn-nbctl lrp-set-options lrp-lr2-ts1 route_table=rtb1 -OVS_WAIT_UNTIL([ovn-ic-sbctl find route route_table=rtb1 | grep 10.11.2.0/24]) +check ovn-ic-nbctl --wait=sb sync # ensure route was not learned as on AZ1 TS port's LRP was not set to route table rtb1 AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr1], [0], [dnl @@ -790,8 +772,8 @@ Route Table rtb1: # set TS port's LRP to route table rtb1 to learn routes from AZ2 from rtb1 check ovn_as az1 ovn-nbctl lrp-set-options lrp-lr1-ts1 route_table=rtb1 +check ovn-ic-nbctl --wait=sb sync -OVS_WAIT_UNTIL([ovn_as az1 ovn-nbctl --route-table=rtb1 lr-route-list lr1 | grep learned]) AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr1], [0], [dnl IPv4 Routes Route Table rtb1: @@ -943,8 +925,7 @@ for i in 1 2; do for j in 1 2 3; do ts=ts1$j - ovn-ic-nbctl --may-exist ts-add $ts - OVS_WAIT_UNTIL([ovn-nbctl show | grep switch | grep $ts]) + ovn-ic-nbctl --wait=sb --may-exist ts-add $ts lrp=lrp-$lr-$ts lsp=lsp-$ts-$lr @@ -969,8 +950,7 @@ for i in 1 2; do for j in 1 2; do ts=ts2$j - ovn-ic-nbctl --may-exist ts-add $ts - OVS_WAIT_UNTIL([ovn-nbctl show | grep switch | grep $ts]) + ovn-ic-nbctl --wait=sb --may-exist ts-add $ts lrp=lrp-$lr-$ts lsp=lsp-$ts-$lr @@ -992,7 +972,7 @@ ovn_as az2 ovn-nbctl --route-table=rtb3 lr-route-add lr12 10.10.10.0/24 192.168. # Create directly-connected route in VPC2 ovn_as az2 ovn-nbctl --wait=sb lrp-add lr22 lrp-lr22 aa:aa:aa:aa:bb:01 "192.168.0.1/24" - +check ovn-ic-nbctl --wait=sb sync # Test direct routes from lr12 were learned to lr11 OVS_WAIT_FOR_OUTPUT([ovn_as az1 ovn-nbctl lr-route-list lr11 | grep 192.168 | grep learned | awk '{print $1, $2, $5}' | sort ], [0], [dnl @@ -1071,8 +1051,7 @@ for i in 1 2; do for j in 1 2 3; do ts=ts1$j - ovn-ic-nbctl --may-exist ts-add $ts - OVS_WAIT_UNTIL([ovn-nbctl show | grep switch | grep $ts]) + ovn-ic-nbctl --wait=sb --may-exist ts-add $ts lrp=lrp-$lr-$ts lsp=lsp-$ts-$lr @@ -1097,8 +1076,7 @@ for i in 1 2; do for j in 1 2; do ts=ts2$j - ovn-ic-nbctl --may-exist ts-add $ts - OVS_WAIT_UNTIL([ovn-nbctl show | grep switch | grep $ts]) + ovn-ic-nbctl --wait=sb --may-exist ts-add $ts lrp=lrp-$lr-$ts lsp=lsp-$ts-$lr @@ -1122,7 +1100,7 @@ ovn_as az2 ovn-nbctl --route-table=rtb3 lr-route-add lr12 2001:db8:aaaa::/64 200 ovn_as az2 ovn-nbctl --wait=sb lrp-add lr22 lrp-lr22 aa:aa:aa:aa:bb:01 "2001:db8:200::1/64" # Test direct routes from lr12 were learned to lr11 -OVS_WAIT_UNTIL([ovn_as az1 ovn-nbctl lr-route-list lr11 | grep 2001:db8:3::2]) +check ovn-ic-nbctl --wait=sb sync AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr11 | grep 2001:db8:200 | grep learned | awk '{print $1, $2, $5}' | sort], [0], [dnl 2001:db8:200::/64 2001:db8:1::2 ecmp @@ -1171,7 +1149,7 @@ ovn-ic-nbctl ts-add ts1 for i in 1 2; do ovn_start az$i ovn_as az$i - OVS_WAIT_UNTIL([ovn-nbctl show | grep switch | grep ts1]) + check ovn-ic-nbctl --wait=sb sync # Enable route learning at AZ level ovn-nbctl set nb_global . options:ic-route-learn=true @@ -1197,13 +1175,14 @@ for i in 1 2; do check ovn-nbctl --wait=sb lr-route-add $lr 0.0.0.0/0 192.168.$i.11 done -OVS_WAIT_FOR_OUTPUT([ovn_as az1 ovn-nbctl lr-route-list lr11 | grep dst-ip | sort] , [0], [dnl +check ovn-ic-nbctl --wait=sb sync +AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr11 | grep dst-ip | sort] , [0], [dnl 0.0.0.0/0 192.168.1.11 dst-ip 10.0.0.0/24 192.168.1.10 dst-ip 192.168.2.0/24 169.254.100.2 dst-ip (learned) ]) -OVS_WAIT_FOR_OUTPUT([ovn_as az2 ovn-nbctl lr-route-list lr12 | grep dst-ip | sort], [0], [dnl +AT_CHECK([ovn_as az2 ovn-nbctl lr-route-list lr12 | grep dst-ip | sort], [0], [dnl 0.0.0.0/0 192.168.2.11 dst-ip 10.0.0.0/24 192.168.2.10 dst-ip 192.168.1.0/24 169.254.100.1 dst-ip (learned) @@ -1239,7 +1218,7 @@ done # create lr11, lr21, lr22 and connect them ovn_as az1 -OVS_WAIT_UNTIL([ovn-nbctl show | grep switch | grep ts1]) +check ovn-ic-nbctl --wait=sb sync lr=lr11 ovn-nbctl lr-add $lr @@ -1254,7 +1233,6 @@ ovn-nbctl lsp-add ts1 $lsp \ -- lsp-set-options $lsp router-port=$lrp ovn_as az2 -OVS_WAIT_UNTIL([ovn-nbctl show | grep switch | grep ts1]) for i in 1 2; do lr=lr2$i ovn-nbctl lr-add $lr @@ -1276,7 +1254,8 @@ ovn_as az2 ovn-nbctl lrp-add lr21 lrp-lr21 aa:aa:aa:aa:bc:01 "192.168.1.1/24" ovn_as az2 ovn-nbctl lrp-add lr22 lrp-lr22 aa:aa:aa:aa:bc:02 "192.168.2.1/24" # Test direct routes from lr21 and lr22 were learned to lr11 -OVS_WAIT_FOR_OUTPUT([ovn_as az1 ovn-nbctl lr-route-list lr11 | grep 192.168 | +check ovn-ic-nbctl --wait=sb sync +AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr11 | grep 192.168 | grep learned | awk '{print $1, $2}' | sort ], [0], [dnl 192.168.1.0/24 169.254.10.21 192.168.2.0/24 169.254.10.22 @@ -1363,8 +1342,7 @@ for i in 1 2; do check ovn-nbctl set nb_global . options:ic-route-blacklist=" \ 2003:db8:1::/64,2004:aaaa::/32,2005:1234::/21" - OVS_WAIT_UNTIL([ovn-nbctl show | grep ts1]) - + check ovn-ic-nbctl --wait=sb sync # Create LRP and connect to TS check ovn-nbctl lr-add lr$i check ovn-nbctl lrp-add lr$i lrp-lr$i-ts1 aa:aa:aa:aa:aa:0$i \ @@ -1393,10 +1371,7 @@ for i in 1 2; do 44:44:44:44:44:4$i 2005:1834:5678::$i/50 done -for i in 1 2; do - OVS_WAIT_UNTIL([ovn_as az$i ovn-nbctl lr-route-list lr$i | grep learned]) -done - +check ovn-ic-nbctl --wait=sb sync AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr1 | awk '/learned/{print $1, $2}' ], [0], [dnl 2002:db8:1::/64 2001:db8:1::2 @@ -1410,7 +1385,8 @@ for i in 1 2; do check ovn-nbctl remove nb_global . options ic-route-blacklist done -OVS_WAIT_FOR_OUTPUT([ovn_as az1 ovn-nbctl lr-route-list lr1 | +check ovn-ic-nbctl --wait=sb sync +AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr1 | awk '/learned/{print $1, $2}' | sort ], [0], [dnl 2002:db8:1::/64 2001:db8:1::2 2003:db8:1::/64 2001:db8:1::2 @@ -1430,7 +1406,8 @@ for i in 1 2; do 55:55:55:55:55:5$i 2004:db8:1::$i/64 done -OVS_WAIT_FOR_OUTPUT([ovn_as az1 ovn-nbctl lr-route-list lr1 | +check ovn-ic-nbctl --wait=sb sync +AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr1 | awk '/learned/{print $1, $2}' | sort ], [0], [dnl 2002:db8:1::/64 2001:db8:1::2 2004:aaaa:bbb::/48 2001:db8:1::2 @@ -1480,11 +1457,7 @@ for az in `seq 1 $n_az`; do done for ts in `seq 1 $n_ts`; do - AT_CHECK([ovn-ic-nbctl create Transit_Switch name=ts$ts], [0], [ignore]) - for az in `seq 1 $n_az`; do - echo "az$az: wait for ts$ts..." - check ovn_as az$az ovn-nbctl wait-until logical_switch ts$ts - done + AT_CHECK([ovn-ic-nbctl --wait=sb create Transit_Switch name=ts$ts], [0], [ignore]) done for az in `seq 1 $n_az`; do @@ -1722,9 +1695,7 @@ check ovs-vsctl -- add-port br-int hv2-vif3 \ options:rxq_pcap=hv2/vif3-rx.pcap check ovs-vsctl set open . external-ids:ovn-is-interconn=true -AT_CHECK([ovn-ic-nbctl create Transit_Switch name=ts], [0], [ignore]) -check ovn_as az1 ovn-nbctl wait-until logical_switch ts -check ovn_as az2 ovn-nbctl wait-until logical_switch ts +AT_CHECK([ovn-ic-nbctl --wait=sb create Transit_Switch name=ts], [0], [ignore]) ovn_as az1 check ovn-nbctl lr-add lr1 \ @@ -1776,15 +1747,13 @@ check ovn-nbctl lsp-add ts ts-lr3 \ -- lsp-set-options ts-lr3 router-port=lr3-ts wait_for_ports_up +check ovn-ic-nbctl --wait=sb sync ovn_as az1 -OVS_WAIT_UNTIL([ovn-nbctl show | grep ts-lr2]) check ovn-nbctl lsp-set-options ts-lr2 requested-chassis=hv2 -OVS_WAIT_UNTIL([ovn-nbctl show | grep ts-lr3]) check ovn-nbctl lsp-set-options ts-lr3 requested-chassis=hv2 ovn_as az2 -OVS_WAIT_UNTIL([ovn-nbctl show | grep ts-lr1]) check ovn-nbctl lsp-set-options ts-lr1 requested-chassis=hv1 dnl Enable unregistered IP multicast flooding and IP multicast relay. @@ -1945,7 +1914,7 @@ check ovs-vsctl -- add-port br-int hv2-vif2 \ options:rxq_pcap=hv2/vif2-rx.pcap check ovs-vsctl set open . external-ids:ovn-is-interconn=true -AT_CHECK([ovn-ic-nbctl create Transit_Switch name=ts], [0], [ignore]) +AT_CHECK([ovn-ic-nbctl --wait=sb create Transit_Switch name=ts], [0], [ignore]) check ovn_as az1 ovn-nbctl wait-until logical_switch ts check ovn_as az2 ovn-nbctl wait-until logical_switch ts @@ -1998,15 +1967,12 @@ check ovn-nbctl lsp-add ts ts-lr3 \ -- lsp-set-options ts-lr3 router-port=lr3-ts wait_for_ports_up - +check ovn-ic-nbctl --wait=sb sync ovn_as az1 -OVS_WAIT_UNTIL([ovn-nbctl show | grep ts-lr2]) check ovn-nbctl lsp-set-options ts-lr2 requested-chassis=hv2 -OVS_WAIT_UNTIL([ovn-nbctl show | grep ts-lr3]) check ovn-nbctl lsp-set-options ts-lr3 requested-chassis=hv2 ovn_as az2 -OVS_WAIT_UNTIL([ovn-nbctl show | grep ts-lr1]) check ovn-nbctl lsp-set-options ts-lr1 requested-chassis=hv1 dnl Enable IP multicast snooping and IP multicast relay. Reports are