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 F1F285A026D for ; Mon, 11 Dec 2023 21:40:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702327201; 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=bsGMnefXER/UwDjNrG5pgRxgFGdWN3BwmU/+c2Vtu3A=; b=jFU0Y5Sy1l9i4M7NlwfYu8h9EZ9DwDiVr98A12DJiwb25HRnRM8VJ394Yt1shvATk6Vk6s iAxKp8XKL10+VLvn3VGUEBS/iQ71srOZzp5bDcjty66R9Js7hihs6gavWFW2z4RnVMdL+n ZaiFVKJaCyoSqtgoLs8QwkznoGpTYBs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-94-jYlltXJrMxybRJhHsNJaJw-1; Mon, 11 Dec 2023 15:40:00 -0500 X-MC-Unique: jYlltXJrMxybRJhHsNJaJw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4A8C0891018 for ; Mon, 11 Dec 2023 20:39:59 +0000 (UTC) Received: from elisabeth (unknown [10.39.208.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1012F1C060AF; Mon, 11 Dec 2023 20:39:57 +0000 (UTC) Date: Mon, 11 Dec 2023 21:39:55 +0100 From: Stefano Brivio To: Jon Maloy Subject: Re: test: make passt.mbuto script more robust Message-ID: <20231211213955.15f55086@elisabeth> In-Reply-To: <20231211185014.54641-1-jmaloy@redhat.com> References: <20231211185014.54641-1-jmaloy@redhat.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: Z4FRD6XY6EIXGWOLJX22QLGZ4OFEV4KL X-Message-ID-Hash: Z4FRD6XY6EIXGWOLJX22QLGZ4OFEV4KL 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, lvivier@redhat.com, dgibson@redhat.com X-Mailman-Version: 3.3.8 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, 11 Dec 2023 13:50:14 -0500 Jon Maloy wrote: > From: Jon Paul Maloy > > Creation of a symbolic link from /sbin to /usr/sbin fails if /sbin > exists and is non-empty. This is the case on Ubuntu-23.04. > > We fix this by removing /sbin before creating the link. > > Signed-off-by: Jon Maloy > --- > test/passt.mbuto | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/test/passt.mbuto b/test/passt.mbuto > index 90816d2..12d7f50 100755 > --- a/test/passt.mbuto > +++ b/test/passt.mbuto > @@ -26,6 +26,8 @@ DIRS="${DIRS} /tmp /sbin /usr/share /var/log /var/lib /etc/ssh /run/sshd /root/. > COPIES="${COPIES} small.bin,/root/small.bin medium.bin,/root/medium.bin big.bin,/root/big.bin" > > FIXUP="${FIXUP}"' > + rm -rf /sbin This works on Ubuntu, but to be safer with other distributions: shouldn't we first move anything we need that happens to be in /sbin to /usr/sbin? On (your version of) Ubuntu /sbin is created because of $DIRS above, but let's say that another version or another distribution has ip(8) at /sbin/ip, we'll get rid of it. That is, if you add /usr/sbin explicitly to DIRS above (to make sure it exists), and then, here, do: mv /sbin/* /sbin || : rm -rf /sbin ...does it also work for you? -- Stefano