]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
test-usernic: don't use ifconfig
authorSerge Hallyn <serge@hallyn.com>
Fri, 2 Feb 2024 16:39:16 +0000 (10:39 -0600)
committerSerge Hallyn <serge@hallyn.com>
Fri, 2 Feb 2024 16:43:30 +0000 (10:43 -0600)
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 <serge@hallyn.com>
src/tests/lxc-test-usernic.in

index 848ff561cd5ffbec813f114cb9fb9c58616d5380..9af8678f3cf6d6a882fb8fad2912559eab55f2d3 100755 (executable)
@@ -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"