From 71d8a5afb784df39b792c8efd1ebde0a966d2271 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Tue, 19 Nov 2024 16:30:50 +0100 Subject: [PATCH] test-dhcp: remove deprecated ifconfig/brctl commands These commands are deprecated for a long time, but it seems in our new CI images ifconfig is missing so migrate to the new ip command instead. Signed-off-by: Paul Holzinger --- test-dhcp/helpers.bash | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/test-dhcp/helpers.bash b/test-dhcp/helpers.bash index b43e088f8..e1b59ff1c 100644 --- a/test-dhcp/helpers.bash +++ b/test-dhcp/helpers.bash @@ -281,25 +281,24 @@ function basic_setup() { } # -# add_bridge br0 +# add_bridge # function add_bridge() { local bridge_name="$1" br_cidr=$(gateway_from_subnet "$SUBNET_CIDR") - run_in_container_netns brctl addbr $bridge_name - run_in_container_netns ifconfig $bridge_name $br_cidr up - run_in_container_netns firewall-cmd --add-interface=$bridge_name --zone=trusted + run_in_container_netns ip link add $bridge_name type bridge + run_in_container_netns ip addr add $br_cidr dev $bridge_name + run_in_container_netns ip link set $bridge_name up } # -# remove_bridge br0 +# remove_bridge # function remove_bridge() { local bridge_name="$1" - run_in_container_netns firewall-cmd --remove-interface="$bridge_name" --zone=trusted run_in_container_netns ip link set "$bridge_name" down # shellcheck disable=SC2086 - run_in_container_netns brctl delbr $bridge_name + run_in_container_netns ip link del $bridge_name } # @@ -310,10 +309,7 @@ function remove_veth() { local bridge_name="$2" local veth_br_name="${veth_name}br" - run_in_container_netns ip link set "$veth_br_name" down - run_in_container_netns ip link set "$veth_name" down - run_in_container_netns brctl delif "$bridge_name" "$veth_br_name" - run_in_container_netns ip link del "$veth_br_name" type veth peer name "$veth_name" + run_in_container_netns ip link del "$veth_br_name" } # @@ -324,7 +320,7 @@ function add_veth() { local bridge_name="$2" local veth_br_name="${veth_name}br" run_in_container_netns ip link add "$veth_br_name" type veth peer name "$veth_name" - run_in_container_netns brctl addif "$bridge_name" "$veth_br_name" + run_in_container_netns ip link set "$veth_br_name" master "$bridge_name" run_in_container_netns ip link set "$veth_br_name" up run_in_container_netns ip link set "$veth_name" up }