From patchwork Thu Sep 16 00:06:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladislav Odintsov X-Patchwork-Id: 1528602 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=EeuHNasm; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H8y7S19jtz9sW8 for ; Thu, 16 Sep 2021 10:07:00 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id C1CE160EA3; Thu, 16 Sep 2021 00:06:57 +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 lcN6r5MZuN74; Thu, 16 Sep 2021 00:06:56 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id F3DDA61381; Thu, 16 Sep 2021 00:06:55 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id BC079C0011; Thu, 16 Sep 2021 00:06:55 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 080DAC0011 for ; Thu, 16 Sep 2021 00:06:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 6478061381 for ; Thu, 16 Sep 2021 00:06:52 +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 DRuXODdcdqdp for ; Thu, 16 Sep 2021 00:06:51 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by smtp3.osuosl.org (Postfix) with ESMTPS id EF09E6137E for ; Thu, 16 Sep 2021 00:06:50 +0000 (UTC) Received: by mail-lf1-x134.google.com with SMTP id p29so11189970lfa.11 for ; Wed, 15 Sep 2021 17:06:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Rl/rkzIK2Rag63q4+UAnK+bAmOYYW5X0ejhcVNwphdk=; b=EeuHNasmtoiikT4bkVe5j4498vTLsVdkbq4GSqxBXtqMbredR/PxHhKPTvJK3ZRX4N lJsBVMkdXN0RrRQSdATzTZPruZ9g0x4+4vosIQNCECoztJ7In6Gwl5p+RpsWrUg0tmuz 8Yi6YUJOTPfwFT2wog740r/wuQFDA+AEnyrQbSMh56DWKqX6iR3LeYI14etgVJZ/SNm/ Ia/VuNAAJCCxsKAgiqLnY+OzPlfIIh3DghERZYakUlCHonne2yDV32Qs1HxoCCRFFcsj wOghC9EPiTV1/n0GwRpPtcA5XNm/1O90GC0rv1gU9vA8Ben/qq/C/YjWL4xX+rdqcxns a1Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Rl/rkzIK2Rag63q4+UAnK+bAmOYYW5X0ejhcVNwphdk=; b=f17ERLZ6RpXsFyjji0DeDvj4bpO7cB5O11nsoyHxq//hVJMtzz5i7n+AQM0YKDBZis EezA0ZLWa+YGYeMEsxobBbGXhn5wnU5d7W5BZQwgjlSf9jF2AyPLCYDrpcBgGbFLvWJn 9Kqicatk2A4+PT0tn0a8PE6quolVfxmDJyzEoOljbqjPrqefZ0POHmgWkh4VbQ8m6Pxv goP10a6HD6seKPnWshotBi9vDMkleHmTbmx9zx+qbXx930ku6AVmCot7RHdQaWuzY8kF oTA1dStS6x28aQ4enznarwc+LSDP9aXOPMDdKJlStpjl8uH4v/tFGWbtitda7hpLBnm6 ta0A== X-Gm-Message-State: AOAM531SAo0AMTyXfD1+yEvPhGls+pHwSKrTFZppoyth+P2pC5ZJvo+q YSzrMFG9uI0c1eKS+lx9csUd1ClDkUY= X-Google-Smtp-Source: ABdhPJyLq2PPAojlJF5/bOx92BfGDpoeJH2Fs+c99gmTWnvSpRiEgry8wLJP3ME2Cw5Bli4s1eDhYw== X-Received: by 2002:a05:651c:50e:: with SMTP id o14mr2385988ljp.351.1631750808832; Wed, 15 Sep 2021 17:06:48 -0700 (PDT) Received: from localhost.localdomain (109-252-131-59.dynamic.spd-mgts.ru. [109.252.131.59]) by smtp.gmail.com with ESMTPSA id 207sm157486ljf.41.2021.09.15.17.06.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Sep 2021 17:06:48 -0700 (PDT) From: Vladislav Odintsov To: dev@openvswitch.org Date: Thu, 16 Sep 2021 03:06:23 +0300 Message-Id: <20210916000624.1609-3-odivlad@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210916000624.1609-1-odivlad@gmail.com> References: <20210916000624.1609-1-odivlad@gmail.com> MIME-Version: 1.0 Cc: Vladislav Odintsov Subject: [ovs-dev] [PATCH ovn 2/3] tests: check that flow for ramp switch is added when PB is created 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" Signed-off-by: Vladislav Odintsov --- tests/ovn-controller-vtep.at | 64 ++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/tests/ovn-controller-vtep.at b/tests/ovn-controller-vtep.at index 21d79c66b..2d1ebad56 100644 --- a/tests/ovn-controller-vtep.at +++ b/tests/ovn-controller-vtep.at @@ -558,3 +558,67 @@ done | sort], [0], [dnl OVN_CONTROLLER_VTEP_STOP AT_CLEANUP + + +# Tests OF to vtep device on ovn-controller node. +OVN_FOR_EACH_NORTHD([ +AT_SETUP([ovn-controller-vtep - hv flows]) +ovn_start +OVN_CONTROLLER_VTEP_START(vtep1) +net_add n1 + +# Start hv chassis and create lswitch with normal vif attached to hv chassis +sim_add hv1 +as hv1 +ovs-vsctl -- add-br br-phys +ovn_attach n1 br-phys 192.168.0.1 +ovn-nbctl ls-add lsw0 +ovn-nbctl lsp-add lsw0 lsp0 +ovn-nbctl lsp-set-addresses lsp0 f0:00:00:00:00:01 +ovs-vsctl add-port br-int vif0 -- set Interface vif0 external-ids:iface-id=lsp0 + + +# 1st testcase: create vtep logical switch port and then bind vlan on vtep +OVN_NB_ADD_VTEP_PORT([lsw0], [lsp-vtep], [vtep1], [lswitch0]) + +# ensure there is a port_binding without chassis set +wait_row_count Port_Binding 1 logical_port=lsp-vtep chassis='[[]]' + +# add vlan binding, ensure port_binding has chassis and OF on hv is installed +OVS_WAIT_WHILE([ovs-ofctl dump-flows br-int table=0 | grep 'priority=110']) +check as vtep1 vtep-ctl add-ls lswitch0 -- bind-ls vtep1 p0 100 lswitch0 +wait_row_count Port_Binding 1 logical_port=lsp-vtep chassis!='[[]]' +OVS_WAIT_UNTIL([ovs-ofctl dump-flows br-int table=0 | grep 'priority=110']) +AT_CHECK([ovs-ofctl dump-flows br-int table=0 | grep 'priority=110' | \ + awk '{print $(NF-1), $NF}' | sed -e 's/in_port=[[0-9]]\+/in_port=<>/g' | \ + sed -e 's/0x[[0-9a-f]]\+/0x<>/g'], [0], [dnl +priority=110,tun_id=0x<>,in_port=<> actions=move:NXM_NX_TUN_ID[[0..23]]->OXM_OF_METADATA[[0..23]],load:0x<>->NXM_NX_REG14[[0..14]],load:0x<>->NXM_NX_REG10[[1]],resubmit(,8) +]) + +# cleanup +check ovn-nbctl lsp-del lsp-vtep +check as vtep1 vtep-ctl unbind-ls vtep1 p0 100 -- clear-local-macs lswitch0 \ + -- clear-remote-macs lswitch0 -- del-ls lswitch0 + + +# 2nd testcase: create vlan binding on vtep and then create logical switch port for it. +# ensure there's no port_binding +wait_row_count Port_Binding 0 logical_port=lsp-vtep + +check as vtep1 vtep-ctl add-ls lswitch0 -- bind-ls vtep1 p0 100 lswitch0 +OVN_NB_ADD_VTEP_PORT([lsw0], [lsp-vtep], [vtep1], [lswitch0]) +wait_row_count Port_Binding 1 logical_port=lsp-vtep chassis!='[[]]' + +# TODO (Numan): Remove this recompute to reproduce the issue +check as hv1 ovn-appctl -t ovn-controller recompute + +OVS_WAIT_UNTIL([ovs-ofctl dump-flows br-int table=0 | grep 'priority=110']) +AT_CHECK([ovs-ofctl dump-flows br-int table=0 | grep 'priority=110' | \ + awk '{print $(NF-1), $NF}' | sed -e 's/in_port=[[0-9]]\+/in_port=<>/g' | \ + sed -e 's/0x[[0-9a-f]]\+/0x<>/g'], [0], [dnl +priority=110,tun_id=0x<>,in_port=<> actions=move:NXM_NX_TUN_ID[[0..23]]->OXM_OF_METADATA[[0..23]],load:0x<>->NXM_NX_REG14[[0..14]],load:0x<>->NXM_NX_REG10[[1]],resubmit(,8) +]) + +OVN_CLEANUP([hv1]) +AT_CLEANUP +])