From patchwork Wed Sep 13 06:24:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Felix Huettner X-Patchwork-Id: 1833372 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" (2048-bit key; unprotected) header.d=mail.schwarz header.i=@mail.schwarz header.a=rsa-sha256 header.s=selector1 header.b=oT7kHTMV; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 4Rlr5V41zbz1yhL for ; Wed, 13 Sep 2023 16:24:30 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 7F7EA81F57; Wed, 13 Sep 2023 06:24:28 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 7F7EA81F57 Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=mail.schwarz header.i=@mail.schwarz header.a=rsa-sha256 header.s=selector1 header.b=oT7kHTMV 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 vkVTWqy_VBl7; Wed, 13 Sep 2023 06:24:27 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id 7A7C781F22; Wed, 13 Sep 2023 06:24:26 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 7A7C781F22 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 43321C0071; Wed, 13 Sep 2023 06:24:26 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7778BC0032 for ; Wed, 13 Sep 2023 06:24:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 37D08404C4 for ; Wed, 13 Sep 2023 06:24:24 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 37D08404C4 Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=mail.schwarz header.i=@mail.schwarz header.a=rsa-sha256 header.s=selector1 header.b=oT7kHTMV X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZPxS5zKGnc_p for ; Wed, 13 Sep 2023 06:24:23 +0000 (UTC) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on072a.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1e::72a]) by smtp2.osuosl.org (Postfix) with ESMTPS id CC98D40156 for ; Wed, 13 Sep 2023 06:24:22 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org CC98D40156 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O2jlZ6pz4vhhf5ar9hSAstLao0Q4OWeb20Tys5zEQ+ai/7AJMYS9Zsf5efirnoQpA+Bhlg2Gt+hgP/aavh+ukPR7h6LgCztzCS5d6BP4uUY+hj1s3Cj98ulAZfuC2g9Oy1fGgMKdZBgMhSzbcO9eA+9g7gnw29zkfdo8GgLhijWTl//aqDFmidKSUvvtS0GvhTap3x6hoIMXIfrkmHli4aEqM+aORc4ScZZgP3z2GWyco82KmXwjJx/HHH2ueI6pv82y7/EfIMQo/bRTyZYkC0ooK9NAsF5TYgS7lKka35Ajr5bPi+otQxCF0zugGw9Q/Vj/rnMRBuFcskC11b8qfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VeaLuh3xV/ljUSq/o61xC41cWaOC2sAqhokntE3NWqQ=; b=oXKFnB+bu6KF1onrmr/WzNbPJ/L3NKXev1Dy7GCkpQnFj0N5P67VVxMIXHJj13DyDt36fG+/ovqQaxDbVMh7YUPZoPc8bxCxIuwHTYcIDA6pL2HrPs6AxVpLazeRjL8JxCYmS3sfmlpDcVpMz+5QVAOVbcsAnMwSNhAWMHgfQ1Ng7XUhkA97X+SZ0Yk1nk/UYfNWicTJLAnUtzmjGpNtyUmkDKQDe2QAcWqz3BovR45iTokl/5ix/XDMXmC+qVrvCtLOhDdSuT2GfVRHBHlE07jyVOPCu+51C43ZlkgEgMnJlYz1xyar8PAIKoyMmClkQEW3SJmNZmbitfglKKZZpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mail.schwarz; dmarc=pass action=none header.from=mail.schwarz; dkim=pass header.d=mail.schwarz; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.schwarz; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VeaLuh3xV/ljUSq/o61xC41cWaOC2sAqhokntE3NWqQ=; b=oT7kHTMVrl8ogFTFSN0U14TMau9HRPr5dNlUNbQOPpXaZQ5l7XTFarEX0tnO7oif0nZv8vWdq17sICW51BLh0cjeDshmaKkzURolwKjrjb40q0hanfnu1oPBZtxZg9PEhsIaYYA5uZJfao8glPA3TwIlB/JxZrS2AEYIMjCMbhD3lCYgjzlr5HmbpiynVVA+Dy0aBABVJaizdKv7Xi57JhiESqFnwy9VBx5dTYo8Ub9jxhLZ/ZW5tlFlXXGl0tHXFkKiM/ZHV1rxGcjMHJASgfkNApANzIk/o+vGBi9koU5KgvL+vtDKLvmLN0/Ia5V8mIfqX9KL+0FOjhCm8Veneg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mail.schwarz; Received: from DU0PR10MB5244.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:34c::22) by PAXPR10MB5253.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:280::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.31; Wed, 13 Sep 2023 06:24:18 +0000 Received: from DU0PR10MB5244.EURPRD10.PROD.OUTLOOK.COM ([fe80::ec40:f47d:15c4:258a]) by DU0PR10MB5244.EURPRD10.PROD.OUTLOOK.COM ([fe80::ec40:f47d:15c4:258a%4]) with mapi id 15.20.6792.019; Wed, 13 Sep 2023 06:24:18 +0000 Date: Wed, 13 Sep 2023 08:24:15 +0200 To: dev@openvswitch.org Message-ID: Mail-Followup-To: dev@openvswitch.org, maxim.korezkij@mail.schwarz Content-Disposition: inline X-ClientProxiedBy: FR3P281CA0111.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a3::14) To DU0PR10MB5244.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:34c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR10MB5244:EE_|PAXPR10MB5253:EE_ X-MS-Office365-Filtering-Correlation-Id: f96099a0-e336-4cb3-5227-08dbb4220f00 x-mp-schwarz-dsgvo2: 1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fNkZGX68qey707szMf56C+8jCT2b74sS6et4ke26uHfo1bHJWfErjVglXB8nRJnPTeux974WHHz3cvmfIKDItZrGTbxAr4KYHqS7kVyfqmc8/p2CWPnSITypo4K/n0ymivd/f9uYIvxR3jwwXnTTQtFXBIdUkJ5EArHVgyzqtYxmKmiaRkMrCW6MNhIG8MBdzO0S/iuIh7hesOo12eN52ZZfUacWzAHqfmsGiB3wLiYGYUTXvHYpUYcsFGCiV74HpMR/UVqOyJhPW7xrazjwSMn1jhJwpZWWTiQ4q7nzgq7mxJBVrp0ddZflE8ZgUDupcIG0LvlV5r+0QyfzeUvPY8UVgMl7vCMaL5Hj+3BltdHX5sdalIqgi+0X/GsGrQdRBUSfeCRG1jgl91lrDvPGEcpYqpote/rlrVcRTcWBZeK6Z4+WW4YpE1qB/uxiOIdEf210lO3MN4xq/c1Z3EFX+V/o6pmfEgtV4erskYH4Fuv6L+WlI+vqqWWRU/QWNSAv1dolkn8kZvn5IC39Lmr7Q5IUr0X2elIcIv2QpqldRMkxqAwrVREDZy1c/M36LDnC X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR10MB5244.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230031)(136003)(396003)(346002)(366004)(376002)(39860400002)(451199024)(186009)(1800799009)(107886003)(83380400001)(82960400001)(9686003)(6512007)(86362001)(4326008)(5660300002)(8676002)(6916009)(2906002)(44832011)(66946007)(66476007)(316002)(41300700001)(66556008)(8936002)(6666004)(478600001)(38100700002)(26005)(66574015)(6486002)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9koG807lrufqjWE1IZe7/V7hEA6+4tCJGKwAAAe9o3hAchrbpqztE+lqFbdmVv0+eghjfxYHr3aeJg8k6ZU4f5dyveDnfx3Fs+3DuYConQ9xAZtFwfzfn/z9X2FgklILkDT6C1SyeAFq7bH/SExRLB9XwD6TWNTsNY5amhrXKH9uculLLQjER3ZWmY5SuErAHtAiOPs38Gga+wDH2kat5I0vKr0gNAWOzHKvkGx4VbNqs+/8uBheQ/gf0n/Ee9q1ni/gwvjydnOrAZ27YRWAj2zvB1yj/0JtoZx8sRecX0O4t4jGfw0n5X/BtxKE548/7KE1JNjoMslBFghJH75LfWCrS8EiRuKguAHNxRiagPHcGVBeGegPgY6qipHUhSQY9LfN8Kd/D0NAGIDC6sM2hA+Dk9ze3pqFUPorkVYdyTlBn6CtCgUQlYBms16BhyKRqhnOR58qBvdE4swklJazt7uNSNhKjOcaCKA/e9wIx4AfNnTB4uVCH/3KgOdTHFgd0Ll0QXu+TykKBGpByMoHAIsFfyW+G6etX/VXeak03buMURjKmRDfYqpRsDJT1YL2IwsWY26Q9TuKatokDVobV3y8wXZCxXP3gtusTc0cI601Ey0Q3TRtuesoYt395JULC+rjMU1RTMQ+KRjIlroXbbdQHKu6NH+lQUv9BDIQkFN4QO1r414WGdRPg7W7MrWxLtJPLZAmyfaijxDaM0wsVr7odIas85M/QuhbJ00HpCp43+BYU7dPlHGK/wSFcd6NzbzAcXnOo3B2657e7jfJi32PZ6cAXqcNfuts5JPz5Qf7y4FcrzX5uP4kh96py9CtlIC05lOKLX3ZhN3HDeTj0/AUOhAEecFhc1N2BA+cSFsPlZtrkBeYDWVPYpFZ7ACyuZyHvYASD7FsnWA324ggBpjBwzsr2hFw5hBwfwFwkY8QB+uw5sSeQNCw/k3SNBXtcRibjLAfgN9CS5f41wRcRkceau0jT94U9SDPo+TdgxfPD+crC8vdQ4D5SmiWiiECiPmCn5e4SZ/d+IBggUaeAsg5rVS3XvxbHjALDwqasEnoo1a8q2gJCWairxEwUnybEnXDsvJrnVR8KDjytP80PoWW+h/HKda7W5+cS290T7hpar8elSW+mNXaLPTOnZqP6E8/64cnNvQQ5RtAmA5kUS83Rk0xqpDqsdhtPGf/5n4e2tH/nHrR23S8whO/9gB7QHO/1PuHG7WhYboSLgfYQolknXHZcnkS5OWy6wZsJcnQLhhSZN8oKylalkxBohMYmgftwvx6jYAOOEokRL6c49/4O2bleUf9BH+nJE3kh/gHjbgnmtCXprzumzA9VjJsRPZXHq9F18FEOtp1La6uXkmCkPUMHBdhe/+CdGZ+gWJJZ2kCYSueGzJt8r5mvlHpcGxst/+NqEkvj+CtQCTCqfoGOdOrXK1BXAkSZGawBnaOXtRyG6Q+8wD7xp8d/NqcFbsF04SzJlE8wMzdpUIgafbnWPSslpY62SZM+YnSGXDRmoUVpAVMkyRM3i8/R0G+XcDKS38RIsh3nCeHb/9YqPOL0qUt96Ro7Q0oC0gycpxVJC6nWfDU1R1EPHSw1n7+X6ny1/ZLeXIA/J/BzIM/LA== X-OriginatorOrg: mail.schwarz X-MS-Exchange-CrossTenant-Network-Message-Id: f96099a0-e336-4cb3-5227-08dbb4220f00 X-MS-Exchange-CrossTenant-AuthSource: DU0PR10MB5244.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2023 06:24:17.7737 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d04f4717-5a6e-4b98-b3f9-6918e0385f4c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oOG0X6BAcSzyHUEEMdqfP8y8SRBEvMsONRJENf46vRY3D3QATVL9c6Kvkf8Qsk0qybfFNyaal7SfDOLA3qyuoyiUagDITUXs+sXqz2KmoC0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR10MB5253 Subject: [ovs-dev] [PATCH ovn v3 1/2] ovn-ic fix multiple routers in an az 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: , X-Patchwork-Original-From: Felix Huettner via dev From: Felix Huettner Reply-To: Felix Huettner Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" previously if multiple routers in the same az are connected to the same transit switch then ovn-ic would only propagate the routes of one of these routers to the ic-sb. This commit fixes this behaviour and allows multiple routers in a single az to use route advertisements. Co-authored-by: Maxim Korezkij Signed-off-by: Maxim Korezkij Signed-off-by: Felix Huettner Acked-by: Ales Musil --- ic/ovn-ic.c | 27 +++++++++++----- tests/ovn-ic.at | 86 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 8 deletions(-) -- 2.42.0 Diese E Mail enthält möglicherweise vertrauliche Inhalte und ist nur für die Verwertung durch den vorgesehenen Empfänger bestimmt. Sollten Sie nicht der vorgesehene Empfänger sein, setzen Sie den Absender bitte unverzüglich in Kenntnis und löschen diese E Mail. Hinweise zum Datenschutz finden Sie hier. This e-mail may contain confidential content and is intended only for the specified recipient/s. If you are not the intended recipient, please inform the sender immediately and delete this e-mail. Information on data protection can be found here. diff --git a/ic/ovn-ic.c b/ic/ovn-ic.c index 11b533981..2df1235dc 100644 --- a/ic/ovn-ic.c +++ b/ic/ovn-ic.c @@ -1592,9 +1592,9 @@ build_ts_routes_to_adv(struct ic_context *ctx, } static void -advertise_lr_routes(struct ic_context *ctx, - const struct icsbrec_availability_zone *az, - struct ic_router_info *ic_lr) +collect_lr_routes(struct ic_context *ctx, + struct ic_router_info *ic_lr, + struct shash *routes_ad_by_ts) { const struct nbrec_nb_global *nb_global = nbrec_nb_global_first(ctx->ovnnb_idl); @@ -1605,7 +1605,7 @@ advertise_lr_routes(struct ic_context *ctx, struct lport_addresses ts_port_addrs; const struct icnbrec_transit_switch *key; - struct hmap routes_ad = HMAP_INITIALIZER(&routes_ad); + struct hmap *routes_ad; for (int i = 0; i < ic_lr->n_isb_pbs; i++) { isb_pb = ic_lr->isb_pbs[i]; key = icnbrec_transit_switch_index_init_row( @@ -1614,6 +1614,12 @@ advertise_lr_routes(struct ic_context *ctx, ts_name = icnbrec_transit_switch_index_find( ctx->icnbrec_transit_switch_by_name, key)->name; icnbrec_transit_switch_index_destroy_row(key); + routes_ad = shash_find_data(routes_ad_by_ts, ts_name); + if (!routes_ad) { + routes_ad = xzalloc(sizeof *routes_ad); + hmap_init(routes_ad); + shash_add(routes_ad_by_ts, ts_name, routes_ad); + } if (!extract_lsp_addresses(isb_pb->address, &ts_port_addrs)) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1); @@ -1625,12 +1631,10 @@ advertise_lr_routes(struct ic_context *ctx, } lrp_name = get_lrp_name_by_ts_port_name(ctx, isb_pb->logical_port); route_table = get_route_table_by_lrp_name(ctx, lrp_name); - build_ts_routes_to_adv(ctx, ic_lr, &routes_ad, &ts_port_addrs, + build_ts_routes_to_adv(ctx, ic_lr, routes_ad, &ts_port_addrs, nb_global, route_table); - advertise_routes(ctx, az, ts_name, &routes_ad); destroy_lport_addresses(&ts_port_addrs); } - hmap_destroy(&routes_ad); } static void @@ -1731,14 +1735,21 @@ route_run(struct ic_context *ctx, icsbrec_port_binding_index_destroy_row(isb_pb_key); struct ic_router_info *ic_lr; + struct shash routes_ad_by_ts = SHASH_INITIALIZER(&routes_ad_by_ts); HMAP_FOR_EACH_SAFE (ic_lr, node, &ic_lrs) { - advertise_lr_routes(ctx, az, ic_lr); + collect_lr_routes(ctx, ic_lr, &routes_ad_by_ts); sync_learned_routes(ctx, az, ic_lr); free(ic_lr->isb_pbs); hmap_destroy(&ic_lr->routes_learned); hmap_remove(&ic_lrs, &ic_lr->node); free(ic_lr); } + struct shash_node *node; + SHASH_FOR_EACH (node, &routes_ad_by_ts) { + advertise_routes(ctx, az, node->name, node->data); + hmap_destroy(node->data); + } + shash_destroy_free_data(&routes_ad_by_ts); hmap_destroy(&ic_lrs); } diff --git a/tests/ovn-ic.at b/tests/ovn-ic.at index 9a5f3e312..4b1c33c99 100644 --- a/tests/ovn-ic.at +++ b/tests/ovn-ic.at @@ -1166,3 +1166,89 @@ AT_CHECK([ovn_as az2 ovn-nbctl lr-route-list lr12 | grep dst-ip | sort], [0], [d AT_CLEANUP ]) + +OVN_FOR_EACH_NORTHD([ +AT_SETUP([ovn-ic -- route sync -- multiple logical routers]) + +ovn_init_ic_db +ovn-ic-nbctl ts-add ts1 + +for i in 1 2; do + ovn_start az$i + ovn_as az$i + + # 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 +done + +# Create new transit switches and LRs. Test topology is next: +# +# logical router (lr11) - transit switch (ts1) - logical router (lr21) +# \- logical router (lr22) +# +# each LR has one connected subnet except TS port + + +# create lr11, lr21, lr22, ts1 and connect them +ovn-ic-nbctl ts-add ts1 + +ovn_as az1 + +lr=lr11 +ovn-nbctl lr-add $lr + +lrp=lrp-$lr-ts1 +lsp=lsp-ts1-$lr +# Create LRP and connect to TS +ovn-nbctl lrp-add $lr $lrp aa:aa:aa:aa:a1:01 169.254.10.11/24 +ovn-nbctl lsp-add ts1 $lsp \ + -- lsp-set-addresses $lsp router \ + -- lsp-set-type $lsp router \ + -- lsp-set-options $lsp router-port=$lrp + +ovn_as az2 +for i in 1 2; do + lr=lr2$i + ovn-nbctl lr-add $lr + + lrp=lrp-$lr-ts1 + lsp=lsp-ts1-$lr + # Create LRP and connect to TS + ovn-nbctl lrp-add $lr $lrp aa:aa:aa:aa:a2:0$i 169.254.10.2$i/24 + ovn-nbctl lsp-add ts1 $lsp \ + -- lsp-set-addresses $lsp router \ + -- lsp-set-type $lsp router \ + -- lsp-set-options $lsp router-port=$lrp +done + + +# Create directly-connected routes +ovn_as az1 ovn-nbctl lrp-add lr11 lrp-lr11 aa:aa:aa:aa:bb:01 "192.168.0.1/24" +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 +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 +]) + +# Test direct routes from lr11 and lr22 were learned to lr21 +AT_CHECK([ovn_as az2 ovn-nbctl lr-route-list lr21 | grep 192.168 | + grep learned | awk '{print $1, $2}' | sort ], [0], [dnl +192.168.0.0/24 169.254.10.11 +]) + +# Test direct routes from lr11 and lr21 were learned to lr22 +AT_CHECK([ovn_as az2 ovn-nbctl lr-route-list lr22 | grep 192.168 | + grep learned | awk '{print $1, $2}' | sort ], [0], [dnl +192.168.0.0/24 169.254.10.11 +]) + +OVN_CLEANUP_IC([az1], [az2]) + +AT_CLEANUP +])