On Fri, Jan 24, 2025 at 1:29 PM Tiago Pires via dev
<ovs-dev@openvswitch.org> wrote:
>
> This commit add a new ovn-ic test for the ovn-fake-multinode with 3 AZs
> testing IPv4/IPv6 connectivity between them.
>
> Signed-off-by: Tiago Pires <tiago.pi...@luizalabs.com>
> ---
>  tests/multinode-macros.at |  80 +++++++++++++++++++++
>  tests/multinode.at        | 141 ++++++++++++++++++++++++++++++++++++++
>  2 files changed, 221 insertions(+)

Hi Tiago,

I'm sorry that this patch is in the review for a long time.

Since the added tests are not run by the CI (as it will skip this
test),  I thought of running this test locally.
But unfortunately it fails.

Can you please take a look at the test ?

--
../../tests/ovn-macros.at:794: "$@"
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
../../tests/ovn-macros.at:794: "$@"
Cannot find device "sw1-az3-p1-p"
../../tests/multinode.at:2869: m_as ovn-central-az1-1 ovn-nbctl
lr-route-list lr1 |
             grep learned | awk '{print $1, $2}' | sort
--- - 2025-02-06 11:34:36.647566169 -0500
+++ 
/home/nusiddiq/workspace_cpp/ovn-org/ovn-for-reviews/ovn/_gcc/tests/multinode-testsuite.dir/at-groups/16/stdout
2025-02-06 11:34:36.645174414 -0500
@@ -1,5 +1 @@
-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

----


I'd prefer that this test also runs in the CI for the multinode tests.
Can you add one more configuration here ? -
https://github.com/ovn-org/ovn/blob/main/.github/workflows/ovn-fake-multinode-tests.yml#L81

And add something like

matrix:
        cfg:
         - { branch: "${{ github.ref_name }}", testsuiteflags: ""}
        - { branch: "${{ github.ref_name }}", testsuiteflags: "-k ic"}
        - { branch: "branch-22.03", testsuiteflags: "-k 'basic test'" }

And also modify here -
https://github.com/ovn-org/ovn/blob/main/.github/workflows/ovn-fake-multinode-tests.yml#L152
 to start the cluster
with required chasis, gateway and central count required for the ic test.

Thanks
Numan

>
> diff --git a/tests/multinode-macros.at b/tests/multinode-macros.at
> index 698d2c625..d2d74949b 100644
> --- a/tests/multinode-macros.at
> +++ b/tests/multinode-macros.at
> @@ -71,6 +71,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])
> @@ -225,4 +226,83 @@ 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
> +
> +    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-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
> +        check m_as $c ovs-vsctl del-br br-int
> +        check 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
> +    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
> +    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
> +    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 9602358aa..ae663cc3f 100644
> --- a/tests/multinode.at
> +++ b/tests/multinode.at
> @@ -2575,3 +2575,144 @@ Connected to 10.0.2.4 (10.0.2.4) port 8080
>  fi
>
>  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
> --
> 2.25.1
>
>
> --
>
>
>
>
> _'Esta mensagem é direcionada apenas para os endereços constantes no
> cabeçalho inicial. Se você não está listado nos endereços constantes no
> cabeçalho, pedimos-lhe que desconsidere completamente o conteúdo dessa
> mensagem e cuja cópia, encaminhamento e/ou execução das ações citadas estão
> imediatamente anuladas e proibidas'._
>
>
> * **'Apesar do Magazine Luiza tomar
> todas as precauções razoáveis para assegurar que nenhum vírus esteja
> presente nesse e-mail, a empresa não poderá aceitar a responsabilidade por
> quaisquer perdas ou danos causados por esse e-mail ou por seus anexos'.*
>
>
>
> _______________________________________________
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to