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 1629A5A0082 for ; Mon, 7 Nov 2022 04:54:33 +0100 (CET) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4N5HRT75fBz4xGH; Mon, 7 Nov 2022 14:54:29 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1667793269; bh=gL3BFO0NnRRx637OkJvTASMMkz48cha5G7J6NahcbyU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QweC2agD3+Aqy+BdlOo8mhQ7KDxnGE23dtW08VEY4sDlWz7CI+0z+MxqZJJN+8Cgw LDuAR25kKnh3DnaSWawtx1pQQ5S2mKgrQ51BRyvx+ZbT/AJ1ylTjnczaT5t1clMxAv wKTDDDSB7PZIlo+uWDGrm1TXHH04TF6Lnt50QkGQ= Date: Mon, 7 Nov 2022 14:54:26 +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="cjPutI44Rd8wAyU5" Content-Disposition: inline In-Reply-To: Message-ID-Hash: LT6VETOLDC7DZA7EEZEBXSWQ24HPHTTL X-Message-ID-Hash: LT6VETOLDC7DZA7EEZEBXSWQ24HPHTTL 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: --cjPutI44Rd8wAyU5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 07, 2022 at 02:21:30PM +1100, David Gibson wrote: > 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 >=20 > Ugly, but I see the point. Oops, forgot to add Reviewed-by: David Gibson >=20 > 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. >=20 > 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. >=20 > > --- > > 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 '.[] | sel= ect(.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 --=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 --cjPutI44Rd8wAyU5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoULxWu4/Ws0dB+XtgypY4gEwYSIFAmNogWsACgkQgypY4gEw YSKFDhAArBmi4XCufTf+DLQ7DGZhTGikIDORGdKDbZmmSHJWLFzRcbgj2AW2gWFj /4bleLvQqDI7V7pr6BEvMwZJowRlKmFkLU1fT7Lnm1do46rlercjLYejFuxLwh1N d0hvhn18oZ31j2oSiNikxR3vDp/rF1jmf/VeBgTZsJDbCu78i7zYUhAP+5zPLMlv pU7GESLbttDcWIe8cqWU7OSWu+rEsMJIdVLYj8TjmkBBA6gWC/Kz+5jTN6o/9pj2 ZDqtQMQ4ZT8aY83DQmbdlUoKPBYU8HqegXoFCBXYR5OojEpMeh+9+v8m2KaV7w0v bVPPI8KK/99J/kLqNRFaDixpD4kMyHXsNLNS/C3LkgOqxrDZeUdEyB8nzfECWDDm /PVtU18eIcM7y+dTEaYRJy63zjdJ3YbMpzCxFyZG5IkTGuAurkqVoMony5/7I1b7 Ugy3bx6A1CV0eDI2CFwtzWkeR+Ikl7YN9ETL7iDJ0LnlQMTwscaXoqrk7BSvh/o7 0wJ0fy9Lqrj7WTe0Kj/qBDUDvuSWoZg+g24w8/pG1QAABD6UhJ6QUwQKliFYITeQ R4E7MhLNGgb8whVhBJ5vIIk0Gl4wl2chxQq4+vIo1ovfmV8pgzfHp7aBZdvME643 jIKOUwPTJ2dosdbGKx1hmV/z3qOLsI3/sbRlr/2bW1HY0Kpk1YM= =gIRH -----END PGP SIGNATURE----- --cjPutI44Rd8wAyU5--