From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id 9C3D65A0265 for ; Mon, 7 Nov 2022 19:59:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667847582; 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=VXAVGpbLkwg9NQRyACVyJoup0bAHZkSVRagVCulBdvo=; b=XACPtjPSSgQfbHw2gn6gHF77Bx8k5zXJVYV6YT7CLdOqaMw8KSaS1DHzbFl69VkTSv9Kal FrHiqrvjejWtj0LvPnKIM1MFNiZ6fIPWzimjiDnvTJ87Q2B5xid/fa9Zj1vZmCIhk5kNl8 pNWWj3MIiRaxgJt3SQhqHDsgXFy9TNI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-508-RALuGqhSOAqZ1m_J-YqoFA-1; Mon, 07 Nov 2022 13:59:41 -0500 X-MC-Unique: RALuGqhSOAqZ1m_J-YqoFA-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 3DD3D29AA2EE; Mon, 7 Nov 2022 18:59:41 +0000 (UTC) Received: from maya.cloud.tilaa.com (ovpn-208-9.brq.redhat.com [10.40.208.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED4C92166B31; Mon, 7 Nov 2022 18:59:40 +0000 (UTC) Date: Mon, 7 Nov 2022 19:59:36 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH] test: Wait for network before starting passt in two_guests setup Message-ID: <20221107195936.1875b08c@elisabeth> In-Reply-To: <20221107105106.1f667fff@elisabeth> References: <20221104015336.3831673-1-sbrivio@redhat.com> <20221107105106.1f667fff@elisabeth> Organization: Red Hat 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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: ZHJQ7XBQN73MFAPBCHY7Z3Z3S6HLC5PY X-Message-ID-Hash: ZHJQ7XBQN73MFAPBCHY7Z3Z3S6HLC5PY X-MailFrom: sbrivio@redhat.com 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: On Mon, 7 Nov 2022 10:51:06 +0100 Stefano Brivio wrote: > On Mon, 7 Nov 2022 14:21:30 +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. > > > > > > 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. > > > > > > 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. > > Yes... the outcome of "pasta --config-net ip address show" (compared to > "pasta --config-net -- sh -c 'sleep 0.05; ip address show'") is a bit > bothering. > > > 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. > > Right, that might be a problem if somebody spawns a script that relies > on the tap interface to be working right away (even though the delay is > probably small enough for all practical cases). > > I'll file a ticket covering both topics. ... https://bugs.passt.top/show_bug.cgi?id=37. -- Stefano