From patchwork Mon Feb 12 17:55:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1897905 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=TnrREM2H; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::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 4TYXFM6Q4Hz23r3 for ; Tue, 13 Feb 2024 04:56:07 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 1610781DEB; Mon, 12 Feb 2024 17:56:06 +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 1DrR1_wDqB36; Mon, 12 Feb 2024 17:56: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 smtp1.osuosl.org 81DF981E45 Authentication-Results: smtp1.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=TnrREM2H Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 81DF981E45; Mon, 12 Feb 2024 17:56:00 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 41EDBC0DDA; Mon, 12 Feb 2024 17:55:59 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 174F0C0DCF for ; Mon, 12 Feb 2024 17:55:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id D4EB340AE9 for ; Mon, 12 Feb 2024 17:55:50 +0000 (UTC) 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 JON0nsRUo3gX for ; Mon, 12 Feb 2024 17:55:47 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=xsimonar@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org BE5E440A07 Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org BE5E440A07 Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=TnrREM2H Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id BE5E440A07 for ; Mon, 12 Feb 2024 17:55:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707760543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LcdvlAamMVcZswHiKiC1AjtIaM44iCVGltL+yO7SCBo=; b=TnrREM2HmKqBwJBAfXnFJX//D4jMPk2YFyQ3J5ft/5HwKQcPSJDiKsxEP84bx7XzEpxeoT qYf7tvD6EL5Ngj4YYm1A13cVeYuxQdMg988nMosntZ5uppOC4+cRel/XzIjqRQVBrlTnAe qGqpgJEmZNk/HlDtNTLoydxc0KqFees= 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-38-NCh4GUjMNi-fViOL0uC_dA-1; Mon, 12 Feb 2024 12:55:42 -0500 X-MC-Unique: NCh4GUjMNi-fViOL0uC_dA-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 C5DE310665A6 for ; Mon, 12 Feb 2024 17:55:41 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.193.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 55EAEAC1F; Mon, 12 Feb 2024 17:55:41 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Mon, 12 Feb 2024 18:55:32 +0100 Message-ID: <20240212175537.1356073-6-xsimonar@redhat.com> In-Reply-To: <20240212175537.1356073-1-xsimonar@redhat.com> References: <20240212175537.1356073-1-xsimonar@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 05/10] tests: Fix "ofctrl wait before clearing flows". 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" - The test was sometimes failing if ofctrl was too slow to reconnect. - Also, the test was not really verifying that flows were not installed before expiry of wait-before-clear. - Finally, use grep -F to avoid catching unexpected flows. Signed-off-by: Xavier Simonart --- tests/ovn-controller.at | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/ovn-controller.at b/tests/ovn-controller.at index f77e032d4..8dda85f53 100644 --- a/tests/ovn-controller.at +++ b/tests/ovn-controller.at @@ -2193,14 +2193,14 @@ check ovn-nbctl --wait=hv sync AT_CHECK([ovn-appctl -t ovn-controller group-table-list | awk '{print $2}' | sort | uniq | wc -l], [0], [2 ]) -# Set 5 seconds wait time before clearing OVS flows. -check ovs-vsctl set open . external_ids:ovn-ofctrl-wait-before-clear=5000 - # Stop ovn-controller OVS_APP_EXIT_AND_WAIT([ovn-controller]) +# Set 5 seconds wait time before clearing OVS flows. +check ovs-vsctl set open . external_ids:ovn-ofctrl-wait-before-clear=5000 + # The old OVS flows should remain (this is regardless of the configuration) -AT_CHECK([ovs-ofctl dump-flows br-int | grep 10.1.2.3], [0], [ignore]) +AT_CHECK([ovs-ofctl dump-flows br-int | grep -F 10.1.2.3], [0], [ignore]) # We should have 2 flows with groups. AT_CHECK([ovs-ofctl dump-flows br-int | grep group -c], [0], [2 @@ -2212,11 +2212,16 @@ check ovn-nbctl --wait=sb lsp-set-addresses ls1-lp1 "f0:00:00:00:00:01 10.1.2.4" # Start ovn-controller, which should compute new flows but not apply them # until the wait time is completed. start_daemon ovn-controller -sleep 2 + +# Wait for octrl to run - it will handle the wait-before-clear +OVS_WAIT_UNTIL([grep -q 'wait-before-clear' hv1/ovn-controller.log]) + +# Check that there is no flow using 10.1.2.4 except the lb one (using 2.2.2.2) +OVS_WAIT_UNTIL([test 0 = $(ovs-ofctl dump-flows br-int | grep -F 10.1.2.4 | grep -cvF 2.2.2.2)]) # Check in the middle of the wait. lflow_run_1=$(ovn-appctl -t ovn-controller coverage/read-counter lflow_run) -AT_CHECK([ovs-ofctl dump-flows br-int | grep 10.1.2.3], [0], [ignore]) +AT_CHECK([ovs-ofctl dump-flows br-int | grep -F 10.1.2.3], [0], [ignore]) # We should have 2 flows with groups. AT_CHECK([ovs-ofctl dump-flows br-int | grep group -c], [0], [2 @@ -2225,7 +2230,7 @@ AT_CHECK([ovs-ofctl dump-flows br-int | grep group -c], [0], [2 sleep 5 # Check after the wait -OVS_WAIT_UNTIL([ovs-ofctl dump-flows br-int | grep 10.1.2.4]) +OVS_WAIT_UNTIL([ovs-ofctl dump-flows br-int | grep -F 10.1.2.4 | grep -vF 2.2.2.2]) # We should have 2 flows with groups. AT_CHECK([ovs-ofctl dump-flows br-int | grep group -c], [0], [2 @@ -2240,7 +2245,7 @@ AT_CHECK_UNQUOTED([echo $lflow_run_1], [0], [$lflow_run_2 # Restart OVS this time, and wait until flows are reinstalled OVS_APP_EXIT_AND_WAIT([ovs-vswitchd]) start_daemon ovs-vswitchd --enable-dummy=system -vvconn -vofproto_dpif -vunixctl -OVS_WAIT_UNTIL([ovs-ofctl dump-flows br-int | grep 10.1.2.4]) +OVS_WAIT_UNTIL([ovs-ofctl dump-flows br-int | grep -F 10.1.2.4 | grep -vF 2.2.2.2]) check ovn-nbctl --wait=hv lb-add lb3 3.3.3.3 10.1.2.5 \ -- ls-lb-add ls1 lb3