From nobody Wed May 14 01:13:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1526921231676396.58829621882865; Mon, 21 May 2018 09:47:11 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BB669315B162; Mon, 21 May 2018 16:47:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 69A5D5DD7A; Mon, 21 May 2018 16:47:09 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id EDB234A469; Mon, 21 May 2018 16:47:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4LGkccd002684 for ; Mon, 21 May 2018 12:46:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id DA8212024506; Mon, 21 May 2018 16:46:38 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.105]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A0A52024505; Mon, 21 May 2018 16:46:37 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Mon, 21 May 2018 17:46:23 +0100 Message-Id: <20180521164631.7288-6-berrange@redhat.com> In-Reply-To: <20180521164631.7288-1-berrange@redhat.com> References: <20180521164631.7288-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [tck PATCH v2 05/13] scripts: portability fixes in checking command output X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Mon, 21 May 2018 16:47:10 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Some versions of libvirt/dnsmasq will spawn a child process, so we must trim output from ps to only show the first (main) process. With IPv6 networking we might also get a link local address, which we should skip because it will be different each time, derived from the random MAC address. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Laine Stump --- scripts/networks/networkxml2hostout/tck-testnet-1.dat | 2 +- scripts/networks/networkxml2hostout/tck-testnet-2.dat | 2 +- scripts/networks/networkxml2hostout/tck-testnet-3.dat | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/networks/networkxml2hostout/tck-testnet-1.dat b/script= s/networks/networkxml2hostout/tck-testnet-1.dat index fff6ca3..59cda2f 100644 --- a/scripts/networks/networkxml2hostout/tck-testnet-1.dat +++ b/scripts/networks/networkxml2hostout/tck-testnet-1.dat @@ -9,7 +9,7 @@ ACCEPT all -- 0.0.0.0/0 10.1.2.0/24 = state RELATED,ESTAB ACCEPT all -- 10.1.2.0/24 0.0.0.0/0 =20 #ip -o route show dev tck-testbr | gawk '{print $1" "$7}' 10.1.2.0/24 10.1.2.1 -#ps aux | sed -n '/dnsmasq .*tck-testnet/ s|.*\(\/dnsmasq\/tck-testnet.con= f\).*|\1|p' +#ps aux | sed -n '/dnsmasq .*tck-testnet/ s|.*\(\/dnsmasq\/tck-testnet.con= f\).*|\1|p' | head -1 /dnsmasq/tck-testnet.conf #grep bind-dynamic `ps aux | sed -n '0,/dnsmasq .*tck-testnet/ s|.*--conf-= file=3D\(.*tck-testnet.conf\).*|\1|p'` bind-dynamic diff --git a/scripts/networks/networkxml2hostout/tck-testnet-2.dat b/script= s/networks/networkxml2hostout/tck-testnet-2.dat index 7f8c86c..4f3d135 100644 --- a/scripts/networks/networkxml2hostout/tck-testnet-2.dat +++ b/scripts/networks/networkxml2hostout/tck-testnet-2.dat @@ -4,7 +4,7 @@ ACCEPT all -- 10.1.2.0/24 0.0.0.0/0 #iptables -t nat -L -n | grep ' 10\.1\.2\.' #ip -o route show dev tck-testbr | gawk '{print $1" "$7}' 10.1.2.0/24 10.1.2.1 -#ps aux | sed -n '/dnsmasq .*tck-testnet/ s|.*\(\/dnsmasq\/tck-testnet.con= f\).*|\1|p' +#ps aux | sed -n '/dnsmasq .*tck-testnet/ s|.*\(\/dnsmasq\/tck-testnet.con= f\).*|\1|p' | head -1 /dnsmasq/tck-testnet.conf #grep bind-dynamic `ps aux | sed -n '0,/dnsmasq .*tck-testnet/ s|.*--conf-= file=3D\(.*tck-testnet.conf\).*|\1|p'` bind-dynamic diff --git a/scripts/networks/networkxml2hostout/tck-testnet-3.dat b/script= s/networks/networkxml2hostout/tck-testnet-3.dat index 5fbf742..535a9c7 100644 --- a/scripts/networks/networkxml2hostout/tck-testnet-3.dat +++ b/scripts/networks/networkxml2hostout/tck-testnet-3.dat @@ -12,7 +12,7 @@ ACCEPT all ::/0 2001:db8:ac10:fd= 01::/64 ACCEPT all 2001:db8:ac10:fd01::/64 ::/0 =20 ACCEPT all ::/0 2001:db8:ac10:fe01::/64=20 ACCEPT all 2001:db8:ac10:fe01::/64 ::/0 =20 -#ps aux | sed -n '/dnsmasq .*tck-testnet/ s|.*\(\/dnsmasq\/tck-testnet.con= f\).*|\1|p' +#ps aux | sed -n '/dnsmasq .*tck-testnet/ s|.*\(\/dnsmasq\/tck-testnet.con= f\).*|\1|p' | head -1 /dnsmasq/tck-testnet.conf #grep bind-dynamic `ps aux | sed -n '0,/dnsmasq .*tck-testnet/ s|.*--conf-= file=3D\(.*tck-testnet.conf\).*|\1|p'` bind-dynamic @@ -22,7 +22,7 @@ dhcp-range=3D2001:db8:ac10:fe01::1,ra-only dhcp-range=3D2001:db8:ac10:fd01::1,ra-only #brctl show | grep tck-testbr | gawk '{print $1" "$3}' tck-testbr yes -#ip -o addr show dev tck-testbr | gawk '{print $4" "$6}' +#ip -o addr show dev tck-testbr | gawk '{print $4" "$6}' | grep -v link 10.1.2.1/24 10.1.2.255 192.168.123.1/24 192.168.123.255 172.28.255.241/28 172.28.255.255 --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list