From: Serge Hallyn Date: Fri, 2 Feb 2024 16:39:16 +0000 (-0600) Subject: test-usernic: don't use ifconfig X-Git-Tag: v6.0.0~24^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27ec0b0f64de326e4705d6b7245babc22dbb2708;p=thirdparty%2Flxc.git test-usernic: don't use ifconfig ifconfig is not available on many modern systems. Use ip instead. Maybe it would be better to detect what's available, but that could become brittle. Signed-off-by: Serge Hallyn --- diff --git a/src/tests/lxc-test-usernic.in b/src/tests/lxc-test-usernic.in index 848ff561c..9af8678f3 100755 --- a/src/tests/lxc-test-usernic.in +++ b/src/tests/lxc-test-usernic.in @@ -34,8 +34,8 @@ cleanup() { lxc-destroy -n usernic-c1 sed -i '/usernic-user/d' /run/lxc/nics /etc/lxc/lxc-usernet - ifconfig usernic-br0 down - ifconfig usernic-br1 down + ip link set usernic-br0 down + ip link set usernic-br1 down brctl delbr usernic-br0 brctl delbr usernic-br1 @@ -114,8 +114,9 @@ chown -R usernic-user: /run/user/$(id -u usernic-user) /home/usernic-user # Create two test bridges brctl addbr usernic-br0 brctl addbr usernic-br1 -ifconfig usernic-br0 0.0.0.0 up -ifconfig usernic-br1 0.0.0.0 up +ip link set usernic-br0 up +ip link set usernic-br1 up + # Create three containers run_cmd "lxc-create -t busybox -n b1"