From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id D5BEC5A0082 for ; Mon, 7 Nov 2022 04:32:41 +0100 (CET) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4N5GyD1Ntkz4xwy; Mon, 7 Nov 2022 14:32:36 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1667791956; bh=7knJm7prqkwQpergzOJLudMPkpKKD6K4ZG2reDNmeyg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mS9c4GZf3y5mQD8am0mJRFCgadueJZI9B1pZyX3sL5pm5GgVKQKhRDIH+nJYqqi/n h6D/n10M4P8zqGh1szkycT62zSmrAKjG2hr6HjAZA0Ek58u0N6Lr8KaB+3mS1dTH0s aCYi0JufYymWaX3+z6kZomuhXfG2XyWTBKj4d6co= Date: Mon, 7 Nov 2022 14:21:30 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH] test: Wait for network before starting passt in two_guests setup Message-ID: References: <20221104015336.3831673-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3YdJoxePWOHwEvEg" Content-Disposition: inline In-Reply-To: <20221104015336.3831673-1-sbrivio@redhat.com> Message-ID-Hash: 4C4VE5F2W3X5UFFFRZRYQ7FYPKLBNFWO X-Message-ID-Hash: 4C4VE5F2W3X5UFFFRZRYQ7FYPKLBNFWO X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.3 Precedence: list List-Id: Development discussion and patches for passt Archived-At: <> Archived-At: List-Archive: <> List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --3YdJoxePWOHwEvEg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 04, 2022 at 02:53:36AM +0100, Stefano Brivio wrote: > As pasta now configures that target network namespace with > --config-net, we need to wait for addresses and routes to be actually > present. Just sending netlink messages doesn't mean this is done > synchronously. >=20 > A more elegant alternative, which probably makes sense regardless of > this test setup, would be to query, from pasta, addresses and routes > we added, and wait until they're there, before proceeding. >=20 > Signed-off-by: Stefano Brivio Ugly, but I see the point. As you say in future I hope we can actually detect the completion of interface configuration which would be useful both here and other places. One other thing to consider - in the case where pasta is spawing a new process, rather than attaching to an existing one, it's possibly counterintuitive that the process starts before pasta has completed setup. We possibly should get the spawned thread to wait until the main pasta thread is entering its main loop before exec()ing the shell. Obviously requires some sync mechanism, which is a bit clunky. > --- > test/lib/setup | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/test/lib/setup b/test/lib/setup > index ab6d8d5..07d5056 100755 > --- a/test/lib/setup > +++ b/test/lib/setup > @@ -208,6 +208,8 @@ setup_two_guests() { > =20 > __ifname=3D"$(context_run qemu_1 "ip -j link show | jq -rM '.[] | selec= t(.link_type =3D=3D \"ether\").ifname'")" > =20 > + sleep 1 > + > __opts=3D > [ ${PCAP} -eq 1 ] && __opts=3D"${__opts} -p ${LOGDIR}/passt_1.pcap" > [ ${DEBUG} -eq 1 ] && __opts=3D"${__opts} -d" --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --3YdJoxePWOHwEvEg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoULxWu4/Ws0dB+XtgypY4gEwYSIFAmNoebQACgkQgypY4gEw YSK6Zg/+K8lp5BxCq58rZR159W7SA3nCWgYD/lRFN6AA6rlcWXKYFVhr1o9JMvWE uUCmmCDIglGiB/ljktWOvt/IqCjCUPD33gu5CQN64Y4I9+BPRvZDrZvBieKkvT+d 2Cx3gana83QpZ+VXs67oFVY3q//Tmk8oXYVWYs+2kBDTLhyEfAvg8yl7H9mcsiVK l7uYh9hBlButVk2I2WUwpBSRIiCDie09onY+tCdhWBhCnPvfSIpG8BQB0kTaHex8 g7vt+gyanDLPgDcMEMkq20nq/wrD99DStAjDTQSfS+n9kzbj43N02SZLRAZolaOW eGiIFWOH/aqSWJvJxQkXy8az+EXbiHw506WrF592AxbJwHonW2creUtOpG+ehOur eCWxiQoLdVA7//qkGZlZ/4yLZENGo6P10/bHCfajgnrDEhCTT/TiM20SCSYjS8sl BE7LWnA2i1GryQEtsSTpevyDsQwWoYXQiE+7bX7VzKosm4JkoXl5C4b6LhWEmOJi ok2KvVtowbzNCMIhORzyZWiUkzXu7SRdKoCmlNU1Ii9mYSjUuA697c7GjKWywMk4 wOOchJ+2rOSA3gDeSmVnPxw+kPMQteITOeYeUGxOux7FvTDDVpmW0z4cuEMAnLbK Vc4Q1+sRHvsXsX148eh0cNfjvgahzM26pNSdTX2UG/5X/rw56Dk= =rHq8 -----END PGP SIGNATURE----- --3YdJoxePWOHwEvEg--