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 6BED25A0265 for ; Mon, 7 Nov 2022 10:51:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667814672; 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=VKrBdkCMumEUtRFQaT/SnV0ILxiYvBnG/QrZApJRGKw=; b=WLfLe8ZK+wRZwn8wsO6/GFnvNrUejhUNGoUOk9/GdfMCi/u6PBgGKbt8467E9bXPpqUpCC kxx5zJsHT/rcsK36JgFU6bBS+FcEUTe+BCY8XqVcQyty8PhTvBeUoNrsf3pBNqIP6vRysQ e4MJ26sHGTaM7Ibb9juPX/VbRBi+q+E= 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-628-vqZmxUtjPae_2YPa_Lklqw-1; Mon, 07 Nov 2022 04:51:10 -0500 X-MC-Unique: vqZmxUtjPae_2YPa_Lklqw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 282231C07542; Mon, 7 Nov 2022 09:51:10 +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 A39222027063; Mon, 7 Nov 2022 09:51:09 +0000 (UTC) Date: Mon, 7 Nov 2022 10:51:06 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH] test: Wait for network before starting passt in two_guests setup Message-ID: <20221107105106.1f667fff@elisabeth> In-Reply-To: References: <20221104015336.3831673-1-sbrivio@redhat.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: RPQUQA5OTZPI65JLWU6FGD2CQQYVWQE5 X-Message-ID-Hash: RPQUQA5OTZPI65JLWU6FGD2CQQYVWQE5 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 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. -- Stefano