From patchwork Wed Sep 25 15:39:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiago Pires X-Patchwork-Id: 1989461 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=luizalabs.com header.i=@luizalabs.com header.a=rsa-sha256 header.s=google header.b=KbH70XxO; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 4XDLX02RxRz1xt0 for ; Thu, 26 Sep 2024 01:40:00 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id AF3EA61156; Wed, 25 Sep 2024 15:39:57 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 5DqQ11pYDoKs; Wed, 25 Sep 2024 15:39:54 +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 smtp3.osuosl.org BE8BA606E7 Authentication-Results: smtp3.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=luizalabs.com header.i=@luizalabs.com header.a=rsa-sha256 header.s=google header.b=KbH70XxO Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id BE8BA606E7; Wed, 25 Sep 2024 15:39:54 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 58C32C0012; Wed, 25 Sep 2024 15:39:54 +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 1947DC0011 for ; Wed, 25 Sep 2024 15:39:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id EF65A8498C for ; Wed, 25 Sep 2024 15:39:51 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 4pWqMImoyWLB for ; Wed, 25 Sep 2024 15:39:50 +0000 (UTC) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::329; helo=mail-ot1-x329.google.com; envelope-from=tiago.pires@luizalabs.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 96D2B84986 Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=luizalabs.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 96D2B84986 Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=luizalabs.com header.i=@luizalabs.com header.a=rsa-sha256 header.s=google header.b=KbH70XxO Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) by smtp1.osuosl.org (Postfix) with ESMTPS id 96D2B84986 for ; Wed, 25 Sep 2024 15:39:50 +0000 (UTC) Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-7138acdfb49so3570333a34.3 for ; Wed, 25 Sep 2024 08:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=luizalabs.com; s=google; t=1727278789; x=1727883589; darn=openvswitch.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=U4o4k0D2sP5p1b2FCyUXmx9ogCMQvzYoglNAWYfbqmQ=; b=KbH70XxO9+nubPLJpr58M28BOhh9CLJJPdzduRyzti+phEoArLAMEcUDQWXtHge80p 7Kp6VdPK/HAVnhebxWdj981fKQp3NbfCODA+rQM9Gc6TPQfNJLFKJDZdr3rvsLWZb5IJ x8hxANrufLpDwmt6NOg125C0tvn7oFz0zgunk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727278789; x=1727883589; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=U4o4k0D2sP5p1b2FCyUXmx9ogCMQvzYoglNAWYfbqmQ=; b=KcLXyMqdMkA9ZWOYdqSs+ZR0+EKw44cyCo/xgKMZq6J627w2fnlx1SVARjzM/HPQJ6 IIcD4gXBNSzrBcr84btWzltl4tZbRRWqoCUVo1y5n+5oKezhoJz6r1cES+tIuUcDfA+K CadUSpIrps5p+I9BUGwyGFHuPNh9wTcxj7PNwCOclLz+E+iG/kH66c9y5DvSuN6vXpWq 6hzg4YiQRuzWMoI0MlZU+7qQuuJBNTDFBQismpP8lSgfKXLrJzdSBfsQfIrHdJt7MOwC zxkOl4iyr7swN+jI5pmrsfhmetqAI7k7G0yxSR/YY3rjHNslX5W3cHM72SWltN6+sMNj jkAw== X-Gm-Message-State: AOJu0Yz3vyhW60mFxQG18blFfR4ZFp1/0N1Fu+zIuUxKMRtTjtL3thZc s5iT/C015x/rPC0dWQaJ4lkkhzr7S6dsgpB/qbiaX1H0qN2pQ4wbdxRGSQFSUk9J/005RBlaBHV 6ME3DCM0dvdCnnsF7uHwyI69MATEQQHtxl21x6+9VdiVyQH0sNVw7sdCM X-Google-Smtp-Source: AGHT+IFeFm9yaB3dsxt7Q+KQNz4kwugxOPkewNCstbEJe0mUP0sakcFuNpp+RBl/VNoVW+DKWXBGQQ== X-Received: by 2002:a05:6830:65c2:b0:713:7e02:f20 with SMTP id 46e09a7af769-713c7e3dd0emr2794057a34.31.1727278788721; Wed, 25 Sep 2024 08:39:48 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:7a:92e9:1d74:1edb:254f:6749]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-84e73be413dsm1904781241.24.2024.09.25.08.39.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2024 08:39:48 -0700 (PDT) To: dev@openvswitch.org Date: Wed, 25 Sep 2024 12:39:35 -0300 Message-Id: <20240925153935.3682928-1-tiago.pires@luizalabs.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [ovs-dev] [PATCH ovn v0] multinode: Adding multinode ovn-ic test. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tiago Pires via dev From: Tiago Pires Reply-To: Tiago Pires Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" This commit add a new ovn-ic test for the ovn-fake-multinode with 3 AZs testing IPv4/IPv6 connectivity between them. --- tests/multinode-macros.at | 82 ++++++++++++++++++++++ tests/multinode.at | 141 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 223 insertions(+) diff --git a/tests/multinode-macros.at b/tests/multinode-macros.at index 5b171885e..13323420d 100644 --- a/tests/multinode-macros.at +++ b/tests/multinode-macros.at @@ -54,6 +54,7 @@ m_central_as () { } check_fake_multinode_setup() { + skip_fake_node_multi_az_setup check m_as ovn-central-az1-1 ovn-nbctl --wait=sb sync AT_CHECK([m_as ovn-chassis-1 ovn-appctl -t ovn-controller version], [0], [ignore]) AT_CHECK([m_as ovn-chassis-2 ovn-appctl -t ovn-controller version], [0], [ignore]) @@ -189,4 +190,85 @@ m_wait_for_ports_up() { fi } +skip_fake_node_multi_az_setup() { + m_as ovn-central-az3-1 ovn-nbctl --wait=sb sync + if [[ $? == 0 ]] ; then + AT_CHECK([exit 77]) + fi +} + +check_fake_node_multi_az_setup() { + m_as ovn-central-az3-1 ovn-nbctl --wait=sb sync + if [[ $? != 0 ]] ; then + AT_CHECK([exit 77]) + fi + + # Check if the fake multinode setup is using SSL, it will + # skip if it is enabled. The cleanup will break the setup, + # so it is recommended to use without SSL in order to + # test the OVN IC with fake multinode setup. + m_as ovn-chassis-1 ovs-vsctl list open | grep "ssl:" + if [[ $? == 0 ]] ; then + AT_CHECK([exit 77]) + fi +} + +check_fake_multinode_setup_by_az() { + check_fake_node_multi_az_setup + + m_as ovn-central-az1-1 ovn-nbctl --wait=sb sync + m_as ovn-central-az2-1 ovn-nbctl --wait=sb sync + m_as ovn-central-az2-1 ovn-nbctl --wait=sb sync + + for c in $1 + do + m_as $c ovn-appctl -t ovn-controller version + done +} + +cleanup_multinode_resources_by_az() { + check_fake_node_multi_az_setup + + m_as ovn-central-az1-1 rm -f /etc/ovn/ovnnb_db.db + m_as ovn-central-az1-1 /usr/share/ovn/scripts/ovn-ctl restart_northd + m_as ovn-central-az2-1 rm -f /etc/ovn/ovnnb_db.db + m_as ovn-central-az2-1 /usr/share/ovn/scripts/ovn-ctl restart_northd + m_as ovn-central-az3-1 rm -f /etc/ovn/ovnnb_db.db + m_as ovn-central-az3-1 /usr/share/ovn/scripts/ovn-ctl restart_northd + + check m_as ovn-central-az1-1 ovn-nbctl --wait=sb sync + check m_as ovn-central-az2-1 ovn-nbctl --wait=sb sync + check m_as ovn-central-az3-1 ovn-nbctl --wait=sb sync + + for c in $1 + do + m_as $c ovs-vsctl del-br br-int + m_as $c ip --all netns delete + done +} + +configure_multinode_az() { + # Configure OVN IC by AZ + check m_as ovn-central-az1-1 ovn-nbctl set-connection ptcp:6641 + check m_as ovn-central-az1-1 ovn-sbctl set-connection ptcp:6642 + check m_as ovn-central-az1-1 ovn-nbctl set NB_Global . name=ovn-central-az1-1 + check m_as ovn-central-az1-1 ovn-nbctl set NB_Global . options:ic-route-adv=true \ + options:ic-route-learn=true + check m_as ovn-central-az2-1 ovn-nbctl set-connection ptcp:6641 + check m_as ovn-central-az2-1 ovn-sbctl set-connection ptcp:6642 + check m_as ovn-central-az2-1 ovn-nbctl set NB_Global . name=ovn-central-az2-1 + check m_as ovn-central-az2-1 ovn-nbctl set NB_Global . options:ic-route-adv=true \ + options:ic-route-learn=true + check m_as ovn-central-az3-1 ovn-nbctl set-connection ptcp:6641 + check m_as ovn-central-az3-1 ovn-sbctl set-connection ptcp:6642 + check m_as ovn-central-az3-1 ovn-nbctl set NB_Global . name=ovn-central-az3-1 + check m_as ovn-central-az3-1 ovn-nbctl set NB_Global . options:ic-route-adv=true \ + options:ic-route-learn=true + + # Configure OVN IC Gateway + check m_as ovn-gw-1 ovs-vsctl set open . external-ids:ovn-is-interconn=true + check m_as ovn-gw-2 ovs-vsctl set open . external-ids:ovn-is-interconn=true + check m_as ovn-gw-3 ovs-vsctl set open . external-ids:ovn-is-interconn=true +} + OVS_END_SHELL_HELPERS diff --git a/tests/multinode.at b/tests/multinode.at index 408e1118d..850942ca6 100644 --- a/tests/multinode.at +++ b/tests/multinode.at @@ -1591,3 +1591,144 @@ AT_CHECK([cat ch1_eth2.tcpdump], [0], [dnl ]) AT_CLEANUP + +AT_SETUP([ovn multinode - ovn-ic - inter-AZ IPv4/IPv6]) + +# Check that ovn-fake-multinode setup is up and running - requires additional nodes +check_fake_multinode_setup_by_az 'ovn-chassis-1 ovn-chassis-2 ovn-chassis-3 ovn-gw-1 ovn-gw-2 ovn-gw-3' + +# Delete the multinode NB and OVS resources before starting the test. +cleanup_multinode_resources_by_az 'ovn-chassis-1 ovn-chassis-2 ovn-chassis-3 ovn-gw-1 ovn-gw-2 ovn-gw-3' + +# Configure OVN IC by AZ +configure_multinode_az + +# Test Inter-AZ routing + +# Create the Transit Switch +m_as ovn-central-az1-1 ovn-ic-nbctl ts-add ts-1 + +# AZ1 - Create one logical switch with one port +check m_as ovn-central-az1-1 ovn-nbctl ls-add sw1-az1 +check m_as ovn-central-az1-1 ovn-nbctl lsp-add sw1-az1 sw1-az1-port1 +check m_as ovn-central-az1-1 ovn-nbctl lsp-set-addresses sw1-az1-port1 "40:54:00:00:01:01 10.0.1.3 2001::3" + +# AZ1 - Create a logical router and attach the logical switch +check m_as ovn-central-az1-1 ovn-nbctl lr-add lr1 +check m_as ovn-central-az1-1 ovn-nbctl lrp-add lr1 lr1-sw1-az1 00:00:00:00:ff:01 10.0.1.1/24 2001::1/64 +check m_as ovn-central-az1-1 ovn-nbctl lsp-add sw1-az1 sw1-az1-lr1 +check m_as ovn-central-az1-1 ovn-nbctl lsp-set-type sw1-az1-lr1 router +check m_as ovn-central-az1-1 ovn-nbctl lsp-set-addresses sw1-az1-lr1 router +check m_as ovn-central-az1-1 ovn-nbctl lsp-set-options sw1-az1-lr1 router-port=lr1-sw1-az1 + +# AZ1 - Create the LRP, LSP and interconnect to the Transit Switch +check m_as ovn-central-az1-1 ovn-nbctl lrp-add lr1 lr1-ts-1 00:00:00:00:00:01 169.254.251.1/24 fe80:10::1/64 +check m_as ovn-central-az1-1 ovn-nbctl lrp-set-gateway-chassis lr1-ts-1 ovn-gw-1 +check m_as ovn-central-az1-1 ovn-nbctl lsp-add ts-1 lr1-lsp1 -- \ + lsp-set-addresses lr1-lsp1 router -- \ + lsp-set-type lr1-lsp1 router -- \ + lsp-set-options lr1-lsp1 router-port=lr1-ts-1 + +m_as ovn-chassis-1 ip link del sw1-az1-p1-p +m_as ovn-chassis-1 /data/create_fake_vm.sh sw1-az1-port1 sw1-az1-p1 40:54:00:00:01:01 1342 10.0.1.3 24 10.0.1.1 2001::3/64 2001::1 + +# AZ2 - Create one logical switch with one port +check m_as ovn-central-az2-1 ovn-nbctl ls-add sw1-az2 +check m_as ovn-central-az2-1 ovn-nbctl lsp-add sw1-az2 sw1-az2-port1 +check m_as ovn-central-az2-1 ovn-nbctl lsp-set-addresses sw1-az2-port1 "40:54:00:00:02:01 10.0.2.3 2002::3" + +# AZ2 - Create a logical router and attach the logical switch +check m_as ovn-central-az2-1 ovn-nbctl lr-add lr2 +check m_as ovn-central-az2-1 ovn-nbctl lrp-add lr2 lr2-sw1-az2 00:00:00:00:ff:02 10.0.2.1/24 2002::1/64 +check m_as ovn-central-az2-1 ovn-nbctl lsp-add sw1-az2 sw1-az2-lr2 +check m_as ovn-central-az2-1 ovn-nbctl lsp-set-type sw1-az2-lr2 router +check m_as ovn-central-az2-1 ovn-nbctl lsp-set-addresses sw1-az2-lr2 router +check m_as ovn-central-az2-1 ovn-nbctl lsp-set-options sw1-az2-lr2 router-port=lr2-sw1-az2 + +# AZ2 - Create the LRP, LSP and interconnect to the Transit Switch +check m_as ovn-central-az2-1 ovn-nbctl lrp-add lr2 lr2-ts-1 00:00:00:00:00:02 169.254.251.2/24 fe80:10::2/64 +check m_as ovn-central-az2-1 ovn-nbctl lrp-set-gateway-chassis lr2-ts-1 ovn-gw-2 +check m_as ovn-central-az2-1 ovn-nbctl lsp-add ts-1 lr2-lsp1 -- \ + lsp-set-addresses lr2-lsp1 router -- \ + lsp-set-type lr2-lsp1 router -- \ + lsp-set-options lr2-lsp1 router-port=lr2-ts-1 + +m_as ovn-chassis-2 ip link del sw1-az2-p1-p +m_as ovn-chassis-2 /data/create_fake_vm.sh sw1-az2-port1 sw1-az2-p1 40:54:00:00:02:01 1342 10.0.2.3 24 10.0.2.1 2002::3/64 2002::1 + +# AZ3 - Create one logical switch with one port +check m_as ovn-central-az3-1 ovn-nbctl ls-add sw1-az3 +check m_as ovn-central-az3-1 ovn-nbctl lsp-add sw1-az3 sw1-az3-port1 +check m_as ovn-central-az3-1 ovn-nbctl lsp-set-addresses sw1-az3-port1 "40:54:00:00:03:01 10.0.3.3 2003::3" + +# AZ3 - Create a logical router and attach the logical switch +check m_as ovn-central-az3-1 ovn-nbctl lr-add lr3 +check m_as ovn-central-az3-1 ovn-nbctl lrp-add lr3 lr3-sw1-az3 00:00:00:00:ff:03 10.0.3.1/24 2003::1/64 +check m_as ovn-central-az3-1 ovn-nbctl lsp-add sw1-az3 sw1-az3-lr3 +check m_as ovn-central-az3-1 ovn-nbctl lsp-set-type sw1-az3-lr3 router +check m_as ovn-central-az3-1 ovn-nbctl lsp-set-addresses sw1-az3-lr3 router +check m_as ovn-central-az3-1 ovn-nbctl lsp-set-options sw1-az3-lr3 router-port=lr3-sw1-az3 + +# AZ3 - Create the LRP, LSP and interconnect to the Transit Switch +check m_as ovn-central-az3-1 ovn-nbctl lrp-add lr3 lr3-ts-1 00:00:00:00:00:03 169.254.251.3/24 fe80:10::3/64 +check m_as ovn-central-az3-1 ovn-nbctl lrp-set-gateway-chassis lr3-ts-1 ovn-gw-3 +check m_as ovn-central-az3-1 ovn-nbctl lsp-add ts-1 lr3-lsp1 -- \ + lsp-set-addresses lr3-lsp1 router -- \ + lsp-set-type lr3-lsp1 router -- \ + lsp-set-options lr3-lsp1 router-port=lr3-ts-1 + +m_as ovn-chassis-1 ip link del sw1-az3-p1-p +m_as ovn-chassis-3 /data/create_fake_vm.sh sw1-az3-port1 sw1-az3-p1 40:54:00:00:03:01 1342 10.0.3.3 24 10.0.3.1 2003::3/64 2003::1 + +# Test routes from lr2 and lr3 were learned to lr1 +AT_CHECK([m_as ovn-central-az1-1 ovn-nbctl lr-route-list lr1 | + grep learned | awk '{print $1, $2}' | sort], [0], [dnl +10.0.2.0/24 169.254.251.2 +10.0.3.0/24 169.254.251.3 +2002::/64 fe80:10::2 +2003::/64 fe80:10::3 +]) + +# Test routes from lr1 and lr3 were learned to lr2 +AT_CHECK([m_as ovn-central-az2-1 ovn-nbctl lr-route-list lr2 | + grep learned | awk '{print $1, $2}' | sort], [0], [dnl +10.0.1.0/24 169.254.251.1 +10.0.3.0/24 169.254.251.3 +2001::/64 fe80:10::1 +2003::/64 fe80:10::3 +]) + +# Test routes from lr1 and lr2 were learned to lr3 +AT_CHECK([m_as ovn-central-az3-1 ovn-nbctl lr-route-list lr3 | + grep learned | awk '{print $1, $2}' | sort], [0], [dnl +10.0.1.0/24 169.254.251.1 +10.0.2.0/24 169.254.251.2 +2001::/64 fe80:10::1 +2002::/64 fe80:10::2 +]) + +# Ping IPv4 test Inter-AZ - AZ1 vs AZ2 +M_NS_CHECK_EXEC([ovn-chassis-1], [sw1-az1-p1], [ping -q -c 3 -i 0.3 -w 2 10.0.2.3 | FORMAT_PING], \ +[0], [dnl +3 packets transmitted, 3 received, 0% packet loss, time 0ms +]) + +# Ping IPv4 test Inter-AZ - AZ1 vs AZ3 +M_NS_CHECK_EXEC([ovn-chassis-1], [sw1-az1-p1], [ping -q -c 3 -i 0.3 -w 2 10.0.3.3 | FORMAT_PING], \ +[0], [dnl +3 packets transmitted, 3 received, 0% packet loss, time 0ms +]) + +# Ping IPv6 test Inter-AZ - AZ1 vs AZ2 +M_NS_CHECK_EXEC([ovn-chassis-1], [sw1-az1-p1], [ping6 -q -c 3 -i 0.3 -w 2 2002::3 | FORMAT_PING], \ +[0], [dnl +3 packets transmitted, 3 received, 0% packet loss, time 0ms +]) + +# Ping IPv6 test Inter-AZ - AZ1 vs AZ3 +M_NS_CHECK_EXEC([ovn-chassis-1], [sw1-az1-p1], [ping6 -q -c 3 -i 0.3 -w 2 2003::3 | FORMAT_PING], \ +[0], [dnl +3 packets transmitted, 3 received, 0% packet loss, time 0ms +]) + +AT_CLEANUP \ No newline at end of file