From patchwork Wed Nov 23 11:14:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eelco Chaudron X-Patchwork-Id: 1708254 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=) 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=bMGxx/ZG; dkim-atps=neutral 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NHJT75MrWz23mf for ; Wed, 23 Nov 2022 22:15:39 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id F188061188; Wed, 23 Nov 2022 11:15:37 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org F188061188 Authentication-Results: smtp3.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=bMGxx/ZG 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 o2eyWvyfXToe; Wed, 23 Nov 2022 11:15:36 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 8A9EA60B93; Wed, 23 Nov 2022 11:15:35 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 8A9EA60B93 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 87E43C007E; Wed, 23 Nov 2022 11:15:33 +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 4520EC002D for ; Wed, 23 Nov 2022 11:15:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id A1A5B4052D for ; Wed, 23 Nov 2022 11:15:25 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org A1A5B4052D 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=bMGxx/ZG 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 CdpPfY-nPSY4 for ; Wed, 23 Nov 2022 11:15:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 7803F401A2 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 7803F401A2 for ; Wed, 23 Nov 2022 11:15:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669202123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Fp04RUPiaZL5llfhKyV/rPqN/z0yahQf4+V0L/l1VuU=; b=bMGxx/ZGBrrC2s13SdDuXkjwt4B3uz2r8iZ8Z6P45q3xgeXyjTe6MWKgUjZByY0SVU63MO FDkaV+mbJhX5LvAotLOYA452DFdD02t2/M/1H07rcfvxMVub9ul/4I8OHH17idL9s4DjyY y6QkeNqYQR0NqIxCVZAxQK+k0m0ytLE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-34-oaw3IjCWMMeNhqxdZKePHw-1; Wed, 23 Nov 2022 06:15:20 -0500 X-MC-Unique: oaw3IjCWMMeNhqxdZKePHw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2873A85A588; Wed, 23 Nov 2022 11:15:20 +0000 (UTC) Received: from ebuild.redhat.com (unknown [10.39.195.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 824E42166B26; Wed, 23 Nov 2022 11:15:19 +0000 (UTC) From: Eelco Chaudron To: dev@openvswitch.org Date: Wed, 23 Nov 2022 12:14:56 +0100 Message-Id: <166920209616.2283155.11615834853041513562.stgit@ebuild> In-Reply-To: <166920194290.2283155.10407738288968236037.stgit@ebuild> References: <166920194290.2283155.10407738288968236037.stgit@ebuild> User-Agent: StGit/1.1 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH v5 04/15] test: Add delay on revalidator flush for offload test cases. 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 revalidator/purge commands in the system test cases sometimes get called immediately after a partial test is completed. This could cause the revalidator thread to log an error that it can not find/delete a flow due to the slower flow installation nature of TC. This patch uses a macro to call the revalidator/purge command, which can be overwritten when the system tests are run on a tc enabled datapath. Signed-off-by: Eelco Chaudron Acked-by: Roi Dayan --- tests/system-common-macros.at | 4 ++++ tests/system-offloads.at | 8 +++++++- tests/system-traffic.at | 38 +++++++++++++++++++------------------- 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at index 8b9f5c752..d95d79791 100644 --- a/tests/system-common-macros.at +++ b/tests/system-common-macros.at @@ -343,3 +343,7 @@ m4_define([OVS_CHECK_IPROUTE_ENCAP], # OVS_CHECK_CT_CLEAR() m4_define([OVS_CHECK_CT_CLEAR], [AT_SKIP_IF([! grep -q "Datapath supports ct_clear action" ovs-vswitchd.log])]) + +# OVS_REVALIDATOR_PURGE() +m4_define([OVS_REVALIDATOR_PURGE], + [AT_CHECK([ovs-appctl revalidator/purge], [0])]) diff --git a/tests/system-offloads.at b/tests/system-offloads.at index fbe1dc99a..7b6deccf0 100644 --- a/tests/system-offloads.at +++ b/tests/system-offloads.at @@ -30,11 +30,17 @@ m4_define([OVS_TRAFFIC_VSWITCHD_START], AT_CHECK([ovs-vsctl -- _ADD_BR([br0]) -- $1 m4_if([$2], [], [], [| uuidfilt])], [0], [$2]) ]) + +# We override the OVS_REVALIDATOR_PURGE macro, allowing a bit more time for the +# tc-datapath entries to be installed. +m4_define([OVS_REVALIDATOR_PURGE], + [AT_CHECK([sleep 2; ovs-appctl revalidator/purge], [0])]) + + # The list below are tests that will not pass for a "test environment" specific # issue. m4_define([OVS_TEST_SKIP_LIST], [ovs_test_skip_list=" -datapath - basic truncate action datapath - truncate and output to gre tunnel by simulated packets datapath - truncate and output to gre tunnel conntrack - force commit diff --git a/tests/system-traffic.at b/tests/system-traffic.at index cd3ad0f68..1d0d0dfd5 100644 --- a/tests/system-traffic.at +++ b/tests/system-traffic.at @@ -1517,12 +1517,12 @@ on_exit 'rm -f payload200.bin' NS_CHECK_EXEC([at_ns0], [nc $NC_EOF_OPT -u 10.1.1.2 1234 < payload200.bin]) dnl packet with truncated size -AT_CHECK([ovs-appctl revalidator/purge], [0]) +OVS_REVALIDATOR_PURGE() AT_CHECK([ovs-ofctl dump-flows br0 table=0 | grep "in_port=3" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl n_bytes=100 ]) dnl packet with original size -AT_CHECK([ovs-appctl revalidator/purge], [0]) +OVS_REVALIDATOR_PURGE() AT_CHECK([ovs-ofctl dump-flows br0 table=0 | grep "in_port=5" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl n_bytes=242 ]) @@ -1539,7 +1539,7 @@ AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) NS_CHECK_EXEC([at_ns0], [nc $NC_EOF_OPT -u 10.1.1.2 1234 < payload200.bin]) dnl 100 + 100 + 242 + min(65535,242) = 684 -AT_CHECK([ovs-appctl revalidator/purge], [0]) +OVS_REVALIDATOR_PURGE() AT_CHECK([ovs-ofctl dump-flows br0 table=0 | grep "in_port=3" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl n_bytes=684 ]) @@ -1569,7 +1569,7 @@ AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) NS_CHECK_EXEC([at_ns0], [nc $NC_EOF_OPT -u 10.1.1.2 1234 < payload200.bin]) dnl 100 + 100 + 242 + min(65535,242) = 684 -AT_CHECK([ovs-appctl revalidator/purge], [0]) +OVS_REVALIDATOR_PURGE() AT_CHECK([ovs-ofctl dump-flows br0 table=0 | grep "in_port=3" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl n_bytes=684 ]) @@ -1653,7 +1653,7 @@ AT_CHECK([ovs-ofctl add-flows br-underlay flows-underlay.txt]) dnl check tunnel push path, from at_ns1 to at_ns0 NS_CHECK_EXEC([at_ns1], [nc $NC_EOF_OPT -u 10.1.1.1 1234 < payload200.bin]) -AT_CHECK([ovs-appctl revalidator/purge], [0]) +OVS_REVALIDATOR_PURGE() dnl Before truncation = ETH(14) + IP(20) + UDP(8) + 200 = 242B AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=2" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl @@ -1669,7 +1669,7 @@ dnl This 200-byte packet is simulated on behalf of ns_gre0 ovs-ofctl -O OpenFlow13 packet-out br-underlay "in_port=1 packet=02908ca8a149faadfa25056008004500010a9e9d4000402f4084ac1f0101ac1f016400006558e666c1222222e666c11111110800450000e46f8e40004011b4760a0101010a010102e026162e00d016e6a366ebf904c74132c6fed42a9e9e46240b4d9fd13c9b47d9704a388e70a5e77db16934a6188dc01d86aa20007ace2cf9cdb111f208474b88ffc851c871f0e3fb4fff138c1d288d437efff487e2b86a9c99fbf4229a6485e133bcf3e16f6e345207fda0932d9eeb602740456fd077b4847d25481337bd716155cc245be129ccc11bf82b834767b3760b52fe913c0e24f31c0e1b27f88acf7bba6b985fb64ee2cd6fc6bba1a9c1f021e253e1728b046fd4d023307e3296361a37ea2617ebcb2537e0284a81050dd0ee actions=LOCAL" dnl After truncation = 100 byte at loopback device p2(4) -AT_CHECK([ovs-appctl revalidator/purge], [0]) +OVS_REVALIDATOR_PURGE() AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=4" | ofctl_strip], [0], [dnl n_packets=1, n_bytes=100, priority=1,ip,in_port=4 actions=drop ]) @@ -1690,7 +1690,7 @@ AT_CHECK([ovs-ofctl add-flows br-underlay flows-underlay.txt]) dnl check tunnel push path, from at_ns1 to at_ns0 NS_CHECK_EXEC([at_ns1], [nc $NC_EOF_OPT -u 10.1.1.1 1234 < payload200.bin]) -AT_CHECK([ovs-appctl revalidator/purge], [0]) +OVS_REVALIDATOR_PURGE() dnl Before truncation = ETH(14) + IP(20) + UDP(8) + 200 = 242B AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=2" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl @@ -1706,7 +1706,7 @@ dnl This 200-byte packet is simulated on behalf of ns_gre0 ovs-ofctl -O OpenFlow13 packet-out br-underlay "in_port=1 packet=02908ca8a149faadfa25056008004500010a9e9d4000402f4084ac1f0101ac1f016400006558e666c1222222e666c11111110800450000e46f8e40004011b4760a0101010a010102e026162e00d016e6a366ebf904c74132c6fed42a9e9e46240b4d9fd13c9b47d9704a388e70a5e77db16934a6188dc01d86aa20007ace2cf9cdb111f208474b88ffc851c871f0e3fb4fff138c1d288d437efff487e2b86a9c99fbf4229a6485e133bcf3e16f6e345207fda0932d9eeb602740456fd077b4847d25481337bd716155cc245be129ccc11bf82b834767b3760b52fe913c0e24f31c0e1b27f88acf7bba6b985fb64ee2cd6fc6bba1a9c1f021e253e1728b046fd4d023307e3296361a37ea2617ebcb2537e0284a81050dd0ee actions=LOCAL" dnl After truncation = 100 byte at loopback device p2(4) -AT_CHECK([ovs-appctl revalidator/purge], [0]) +OVS_REVALIDATOR_PURGE() AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=4" | ofctl_strip], [0], [dnl n_packets=1, n_bytes=100, priority=1,ip,in_port=4 actions=drop ]) @@ -1783,7 +1783,7 @@ AT_CHECK([ovs-ofctl add-flows br-underlay flows-underlay.txt]) dnl check tunnel push path, from at_ns1 to at_ns0 NS_CHECK_EXEC([at_ns1], [nc $NC_EOF_OPT -u 10.1.1.1 1234 < payload200.bin]) -AT_CHECK([ovs-appctl revalidator/purge], [0]) +OVS_REVALIDATOR_PURGE() dnl Before truncation = ETH(14) + IP(20) + UDP(8) + 200 = 242B AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=2" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl @@ -1797,7 +1797,7 @@ n_bytes=138 dnl check tunnel pop path, from at_ns0 to at_ns1 NS_CHECK_EXEC([at_ns0], [nc $NC_EOF_OPT -u 10.1.1.2 5678 < payload200.bin]) dnl After truncation = 100 byte at loopback device p2(4) -AT_CHECK([ovs-appctl revalidator/purge], [0]) +OVS_REVALIDATOR_PURGE() AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=4" | ofctl_strip], [0], [dnl n_packets=1, n_bytes=100, priority=1,ip,in_port=4 actions=drop ]) @@ -1818,7 +1818,7 @@ AT_CHECK([ovs-ofctl add-flows br-underlay flows-underlay.txt]) dnl check tunnel push path, from at_ns1 to at_ns0 NS_CHECK_EXEC([at_ns1], [nc $NC_EOF_OPT -u 10.1.1.1 1234 < payload200.bin]) -AT_CHECK([ovs-appctl revalidator/purge], [0]) +OVS_REVALIDATOR_PURGE() dnl Before truncation = ETH(14) + IP(20) + UDP(8) + 200 = 242B AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=2" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl @@ -1832,7 +1832,7 @@ n_bytes=138 dnl check tunnel pop path, from at_ns0 to at_ns1 NS_CHECK_EXEC([at_ns0], [nc $NC_EOF_OPT -u 10.1.1.2 5678 < payload200.bin]) dnl After truncation = 100 byte at loopback device p2(4) -AT_CHECK([ovs-appctl revalidator/purge], [0]) +OVS_REVALIDATOR_PURGE() AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=4" | ofctl_strip], [0], [dnl n_packets=1, n_bytes=100, priority=1,ip,in_port=4 actions=drop ]) @@ -2200,7 +2200,7 @@ AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 "in_port=1 packet=50540000000a5 dnl Now try a reply from port 2. AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 "in_port=2 packet=50540000000a50540000000908004500001c000000000011a4cd0a0101020a0101010002000100080000 actions=resubmit(,0)"]) -AT_CHECK([ovs-appctl revalidator/purge], [0]) +OVS_REVALIDATOR_PURGE() OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) @@ -2221,7 +2221,7 @@ udp,orig=(src=10.1.1.2,dst=10.1.1.1,sport=2,dport=1),reply=(src=10.1.1.1,dst=10. dnl OK, now send another packet from port 1 and see that it switches again AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 "in_port=1 packet=50540000000a50540000000908004500001c000000000011a4cd0a0101010a0101020001000200080000 actions=resubmit(,0)"]) -AT_CHECK([ovs-appctl revalidator/purge], [0]) +OVS_REVALIDATOR_PURGE() AT_CHECK([ovs-appctl dpctl/dump-conntrack | grep "orig=.src=10\.1\.1\.1,"], [], [dnl udp,orig=(src=10.1.1.1,dst=10.1.1.2,sport=1,dport=2),reply=(src=10.1.1.2,dst=10.1.1.1,sport=2,dport=1) @@ -3219,7 +3219,7 @@ AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) dnl UDP packets from ns0->ns1 should solicit "destination unreachable" response. NS_CHECK_EXEC([at_ns0], [bash -c "echo a | nc $NC_EOF_OPT -u 10.1.1.2 10000"]) -AT_CHECK([ovs-appctl revalidator/purge], [0]) +OVS_REVALIDATOR_PURGE() AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort | grep -v drop], [0], [dnl n_packets=1, n_bytes=44, priority=100,udp,in_port=1 actions=ct(commit,exec(load:0x1->NXM_NX_CT_MARK[[]])),output:2 n_packets=1, n_bytes=72, priority=100,ct_state=+rel+trk,ct_mark=0x1,icmp,in_port=2 actions=output:1 @@ -3265,12 +3265,12 @@ dnl packet, but in the original direction of the conntrack entry created dnl for the 1st packet. AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 2 resubmit\(,0\) '000102000204002322112233080045000038000100003f01f7eec0640108c0640205030a80e5ffffffff4500001c000100003f11f7fac0640205c06401080035003500087b9e']) -AT_CHECK([ovs-appctl revalidator/purge], [0]) +OVS_REVALIDATOR_PURGE() dnl 4. Repeat 3. AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 2 resubmit\(,0\) '000102000204002322112233080045000038000100003f01f7eec0640108c0640205030a80e5ffffffff4500001c000100003f11f7fac0640205c06401080035003500087b9e']) -AT_CHECK([ovs-appctl revalidator/purge], [0]) +OVS_REVALIDATOR_PURGE() AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort | grep -v drop], [0], [dnl n_packets=4, n_bytes=224, priority=100,ip actions=ct(table=1) @@ -5554,7 +5554,7 @@ sleep 1 dnl UDP packets from ns0->ns1 should solicit "destination unreachable" response. NS_CHECK_EXEC([at_ns0], [bash -c "echo a | nc $NC_EOF_OPT -u 10.1.1.2 10000"]) -AT_CHECK([ovs-appctl revalidator/purge], [0]) +OVS_REVALIDATOR_PURGE() AT_CHECK([ovs-ofctl -O OpenFlow15 dump-flows br0 | ofctl_strip | sort | grep -v drop], [0], [dnl n_packets=1, n_bytes=42, priority=10,arp actions=NORMAL n_packets=1, n_bytes=44, udp,in_port=1 actions=ct(commit,nat(src=10.1.1.240-10.1.1.254),exec(set_field:0x1->ct_mark)),output:2 @@ -7079,7 +7079,7 @@ AT_CHECK([ovs-ofctl add-flow br0 "priority=1 action=normal"]) OVS_WAIT_UNTIL([ip netns exec at_ns0 ping -c 1 10.2.2.2]) dnl CVLAN traffic should match the flow and drop -AT_CHECK([ovs-appctl revalidator/purge]) +OVS_REVALIDATOR_PURGE() AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:vlan-limit=1]) AT_CHECK([ovs-ofctl add-flow br0 "priority=100 dl_type=0x8100 action=drop"]) NS_CHECK_EXEC([at_ns0], [ping -q -c 1 -w 3 10.2.2.2], [1], [ignore])