Replace brctl command with ip
Commit Message
README of bridge-utils v1.7.1 says:
> This utility is DEPRECATED. No new features will ever be added.
> Instead use the bridge command from the iproute2 package which
> supports more features.
https://git.kernel.org/pub/scm/network/bridge/bridge-utils.git/tree/README?h=v1.7.1
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
framework/qemu_kvm.py | 2 +-
framework/qemu_libvirt.py | 2 +-
test_plans/sriov_kvm_test_plan.rst | 2 +-
test_plans/vf_port_start_stop_test_plan.rst | 2 +-
tests/TestSuite_ip_pipeline.py | 6 +++---
5 files changed, 7 insertions(+), 7 deletions(-)
---
base-commit: 427e7c3f37bbb1263d81c466d7a83e9193013321
change-id: 20240203-brctl-8fdbef4c69be
Best regards,
@@ -68,7 +68,7 @@ class QEMUKvm(VirtBase):
+ " tunctl -t $1\n"
+ " ip link set $1 up\n"
+ " sleep 0.5s\n"
- + " brctl addif $switch $1\n"
+ + " ip link set $1 master $switch\n"
+ " exit 0\n"
+ "else\n"
+ " echo 'Error: no interface specified'\n"
@@ -30,7 +30,7 @@ class LibvirtKvm(VirtBase):
+ " tunctl -t $1\n"
+ " ip link set $1 up\n"
+ " sleep 0.5s\n"
- + " brctl addif $switch $1\n"
+ + " ip link set $1 master $switch\n"
+ " exit 0\n"
+ "else\n"
+ " echo 'Error: no interface specified'\n"
@@ -47,7 +47,7 @@ The /etc/qemu-ifup can be below script, need you to create first::
/usr/sbin/tunctl -u `whoami` -t $1
/sbin/ip link set $1 up
sleep 0.5s
- /usr/sbin/brctl addif $switch $1
+ /sbin/ip link set $1 master $switch
exit 0
else
echo "Error: no interface specified"
@@ -72,7 +72,7 @@ Create Two VF interfaces from two kernel PF interfaces, and then attach them to
/usr/sbin/tunctl -u `whoami` -t $1
/sbin/ip link set $1 up
sleep 0.5s
- /usr/sbin/brctl addif $switch $1
+ /sbin/ip link set $1 master $switch
exit 0
else
echo "Error: no interface specified"
@@ -832,9 +832,9 @@ class TestIpPipeline(TestCase):
self.dut.send_expect(cmd, "fwd port 3", 60)
tap_session = self.dut.new_session()
- cmd = "ip link set br1 down; brctl delbr br1"
+ cmd = "ip link set br1 down; ip link delete br1"
tap_session.send_expect(cmd, "# ", 20)
- cmd = "brctl addbr br1; brctl addif br1 TAP0; brctl addif br1 TAP1"
+ cmd = "ip link add br1 type bridge; ip link set TAP0 master br1; ip link set TAP1 master br1"
tap_session.send_expect(cmd, "# ", 20)
cmd = "ifconfig TAP0 up; ifconfig TAP1 up; ifconfig br1 up"
tap_session.send_expect(cmd, "# ", 20)
@@ -874,7 +874,7 @@ class TestIpPipeline(TestCase):
cmd = "^C"
self.dut.send_expect(cmd, "# ", 20)
- cmd = "ip link set br1 down; brctl delbr br1"
+ cmd = "ip link set br1 down; ip link delete br1"
tap_session.send_expect(cmd, "# ", 20)
self.dut.close_session(tap_session)