1
0
mirror of https://passt.top/passt synced 2024-06-27 21:42:42 +00:00

test: make passt.mbuto script more robust

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 <jmaloy@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Jon Paul Maloy 2023-12-14 16:12:19 -05:00 committed by Stefano Brivio
parent 6a348cb435
commit f0ccca741f

View File

@ -26,6 +26,9 @@ 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}"'
mv /sbin/* /usr/sbin || :
rm -rf /sbin
ln -s /usr/sbin /sbin
cat > /sbin/dhclient-script << EOF
#!/bin/sh
LOG=/var/log/dhclient-script.log
@ -47,7 +50,6 @@ set >> \$LOG
exit 0
EOF
chmod 755 /sbin/dhclient-script
ln -s /sbin /usr/sbin
ln -s /bin /usr/bin
ln -s /run /var/run
:> /etc/fstab