From patchwork Wed Jul 27 07:12:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ales Musil X-Patchwork-Id: 1661120 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=M9t2xg2B; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lt4jK0NGqz9sB4 for ; Wed, 27 Jul 2022 17:12:20 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 0DE5240946; Wed, 27 Jul 2022 07:12:18 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 0DE5240946 Authentication-Results: smtp4.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=M9t2xg2B X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VhIC4KugFWSp; Wed, 27 Jul 2022 07:12:16 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 52E3840940; Wed, 27 Jul 2022 07:12:15 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 52E3840940 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0E6ACC0035; Wed, 27 Jul 2022 07:12:15 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id EAE45C002D for ; Wed, 27 Jul 2022 07:12:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id C0A058195D for ; Wed, 27 Jul 2022 07:12:13 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org C0A058195D Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=M9t2xg2B 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 iExJ13rVnEyq for ; Wed, 27 Jul 2022 07:12:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org B15DA81934 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id B15DA81934 for ; Wed, 27 Jul 2022 07:12:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658905931; 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; bh=4P7G5AzSn7eTGUPqr+KG2hKovCVMDE5fX7m2VOJq7Ps=; b=M9t2xg2BgDzw2EILRw618M2lTVZwRwy96HtbAjvvvbCrCYlunmszTd2G5nTSugLFOBPqCC 5bRylKJiRJcEDy7KN1rYLpUsSMcUXZI3PD48M6/NJUrVJm2AYXrjFe2ZPGWuuCmy+TaGaY feQHWHrVJE6lBl5PR4WTTlqrGghxRgs= 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-622-RcF2IUlwP8-q-1MKRKGbHg-1; Wed, 27 Jul 2022 03:12:10 -0400 X-MC-Unique: RcF2IUlwP8-q-1MKRKGbHg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CD153811E80 for ; Wed, 27 Jul 2022 07:12:09 +0000 (UTC) Received: from amusil.redhat.com (unknown [10.34.130.108]) by smtp.corp.redhat.com (Postfix) with ESMTP id 595AA1121314; Wed, 27 Jul 2022 07:12:09 +0000 (UTC) From: Ales Musil To: dev@openvswitch.org Date: Wed, 27 Jul 2022 09:12:08 +0200 Message-Id: <20220727071208.1096767-1-amusil@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=amusil@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] system-tests: Make netcat calls more robust 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 netcat compilation options differ between distributions, make the nc execution more robust. Now it does not fail on success message being printed to stderr. Signed-off-by: Ales Musil --- tests/system-ovn.at | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/system-ovn.at b/tests/system-ovn.at index 066eab19b..c0621a569 100644 --- a/tests/system-ovn.at +++ b/tests/system-ovn.at @@ -4590,8 +4590,8 @@ ovn-nbctl --wait=hv -t 3 sync NS_CHECK_EXEC([lsp], [timeout 2s nc -k -l 42.42.42.1 4041 &], [0]) # Check that IPv4 TCP hairpin connection succeeds on both VIPs. -NS_CHECK_EXEC([lsp], [nc 88.88.88.88 8080 -z], [0]) -NS_CHECK_EXEC([lsp], [nc 88.88.88.89 8080 -z], [0]) +NS_CHECK_EXEC([lsp], [nc 88.88.88.88 8080 -z], [0], [ignore], [ignore]) +NS_CHECK_EXEC([lsp], [nc 88.88.88.89 8080 -z], [0], [ignore], [ignore]) # Capture IPv4 UDP hairpinned packets. filter="dst 42.42.42.1 and dst port 2021 and udp" @@ -4676,8 +4676,8 @@ ovn-nbctl --wait=hv -t 3 sync NS_CHECK_EXEC([lsp], [timeout 2s nc -k -l 4200::1 4041 &], [0]) # Check that IPv6 TCP hairpin connection succeeds on both VIPs. -NS_CHECK_EXEC([lsp], [nc 8800::0088 8080 -z], [0]) -NS_CHECK_EXEC([lsp], [nc 8800::0089 8080 -z], [0]) +NS_CHECK_EXEC([lsp], [nc 8800::0088 8080 -z], [0], [ignore], [ignore]) +NS_CHECK_EXEC([lsp], [nc 8800::0089 8080 -z], [0], [ignore], [ignore]) # Capture IPv6 UDP hairpinned packets. filter="dst 4200::1 and dst port 2021 and udp" @@ -5540,18 +5540,18 @@ NS_CHECK_EXEC([sw0-p2-lbc], [ip route add default via 20.0.0.1 dev sw1p2], [0]) NETNS_DAEMONIZE([sw0-p2-lbc], [nc -l -k 20.0.0.4 80], [nc0.pid]) # Send the packet to backend -NS_CHECK_EXEC([sw0-p1-lbc], [nc -z 20.0.0.4 80], [0]) +NS_CHECK_EXEC([sw0-p1-lbc], [nc -z 20.0.0.4 80], [0], [ignore], [ignore]) # Send the packet to VIP. -NS_CHECK_EXEC([sw0-p1-lbc], [nc -z 30.0.0.10 80], [0]) +NS_CHECK_EXEC([sw0-p1-lbc], [nc -z 30.0.0.10 80], [0], [ignore], [ignore]) # Now add an ACL in sw1. ovn-nbctl --wait=hv acl-add sw1 to-lport 2002 "ip" allow-related # Send the packet to backend -NS_CHECK_EXEC([sw0-p1-lbc], [nc -z 20.0.0.4 80], [0]) +NS_CHECK_EXEC([sw0-p1-lbc], [nc -z 20.0.0.4 80], [0], [ignore], [ignore]) # Send the packet to VIP. -NS_CHECK_EXEC([sw0-p1-lbc], [nc -z 30.0.0.10 80], [0]) +NS_CHECK_EXEC([sw0-p1-lbc], [nc -z 30.0.0.10 80], [0], [ignore], [ignore]) OVS_APP_EXIT_AND_WAIT([ovn-controller]) @@ -5625,10 +5625,10 @@ check ovn-nbctl --wait=hv sync NETNS_DAEMONIZE([vm1], [nc -k -l 42.42.42.2 4242], [nc-vm1.pid]) # Make sure connecting to the VIP works. -NS_CHECK_EXEC([vm2], [nc 66.66.66.66 666 -p 2000 -z]) +NS_CHECK_EXEC([vm2], [nc 66.66.66.66 666 -p 2000 -z], [0], [ignore], [ignore]) # Start IPv4 TCP connection to VIP from vm2. -NS_CHECK_EXEC([vm2], [nc 66.66.66.66 666 -p 2001 -z]) +NS_CHECK_EXEC([vm2], [nc 66.66.66.66 666 -p 2001 -z], [0], [ignore], [ignore]) # Check conntrack. We expect two entries: # - one in vm1's zone (firewall) @@ -5645,7 +5645,7 @@ tcp,orig=(src=42.42.42.3,dst=66.66.66.66,sport=,dport=666),reply=(s # Start IPv4 TCP connection to backend IP from vm2 which would require # additional source port translation to avoid a tuple conflict. -NS_CHECK_EXEC([vm2], [nc 42.42.42.2 4242 -p 2001 -z]) +NS_CHECK_EXEC([vm2], [nc 42.42.42.2 4242 -p 2001 -z], [0], [ignore], [ignore]) # Check conntrack. We expect three entries: # - one in vm1's zone (firewall) - reused from the previous connection. @@ -5721,10 +5721,10 @@ check ovn-nbctl --wait=hv sync NETNS_DAEMONIZE([vm1], [nc -k -l 4242::2 4242], [nc-vm1.pid]) # Make sure connecting to the VIP works. -NS_CHECK_EXEC([vm2], [nc 6666::1 666 -p 2000 -z]) +NS_CHECK_EXEC([vm2], [nc 6666::1 666 -p 2000 -z], [0], [ignore], [ignore]) # Start IPv6 TCP connection to VIP from vm2. -NS_CHECK_EXEC([vm2], [nc 6666::1 666 -p 2001 -z]) +NS_CHECK_EXEC([vm2], [nc 6666::1 666 -p 2001 -z], [0], [ignore], [ignore]) # Check conntrack. We expect two entries: # - one in vm1's zone (firewall) @@ -5741,7 +5741,7 @@ tcp,orig=(src=4242::3,dst=6666::1,sport=,dport=666),reply=(src=4242 # Start IPv6 TCP connection to backend IP from vm2 which would require # additional source port translation to avoid a tuple conflict. -NS_CHECK_EXEC([vm2], [nc 4242::2 4242 -p 2001 -z]) +NS_CHECK_EXEC([vm2], [nc 4242::2 4242 -p 2001 -z], [0], [ignore], [ignore]) # Check conntrack. We expect three entries: # - one in vm1's zone (firewall) - reused from the previous connection. @@ -8095,7 +8095,7 @@ test_ping() { check ovn-nbctl --wait=hv lr-nat-add R1 snat 172.16.1.21 192.168.2.0/24 echo "foo" > foo -NS_CHECK_EXEC([sw11], [nc 192.168.1.2 8000 < foo]) +NS_CHECK_EXEC([sw11], [nc 192.168.1.2 8000 -z], [0], [ignore], [ignore]) test_ping sw11 192.168.1.2 # Ensure nat has been hit @@ -8112,7 +8112,7 @@ AT_CHECK([ovs-appctl dpctl/flush-conntrack]) # SNAT and DNAT. using Logical IP ovn-nbctl --wait=hv lr-nat-add R1 dnat_and_snat 172.16.1.2 192.168.1.2 -NS_CHECK_EXEC([sw11], [nc 192.168.1.2 8000 < foo ]) +NS_CHECK_EXEC([sw11], [nc 192.168.1.2 8000 -z], [0], [ignore], [ignore]) test_ping sw11 192.168.1.2 # Ensure conntrack entry is present @@ -8126,7 +8126,7 @@ tcp,orig=(src=192.168.2.2,dst=192.168.1.2,sport=,dport=),reply AT_CHECK([ovs-appctl dpctl/flush-conntrack]) # SNAT and DNAT. using floating IP -NS_CHECK_EXEC([sw11], [nc 172.16.1.2 8000 < foo ]) +NS_CHECK_EXEC([sw11], [nc 172.16.1.2 8000 -z], [0], [ignore], [ignore]) test_ping sw11 172.16.1.2 # Ensure conntrack entry is present