From 5e89d4076173c4d5acd20c4c2bbb80f990ac1eed Mon Sep 17 00:00:00 2001 From: Jing Chen Date: Tue, 2 Jul 2024 13:58:21 -0700 Subject: [PATCH] Test renaming a link name in setlink_test.sh PiperOrigin-RevId: 648834200 --- test/rtnetlink/linux/setlink_test.sh | 10 ++++++++++ test/rtnetlink/linux/veth_test.sh | 11 ----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/test/rtnetlink/linux/setlink_test.sh b/test/rtnetlink/linux/setlink_test.sh index 31463ee34..2931fc87d 100755 --- a/test/rtnetlink/linux/setlink_test.sh +++ b/test/rtnetlink/linux/setlink_test.sh @@ -28,3 +28,13 @@ if ! wait_for ! ip link show test_veth02; then exit 1 fi +# Create a new veth pair in the current namespace and rename the link. +ip link add name test_veth01 type veth peer name test_veth02 +ip link set test_veth01 name test_veth03 +ip link show test_veth03 +ip link del name test_veth03 +# Check that test_veth02 has been destroyed. +if ! wait_for ! ip link show test_veth02; then + fail "test_veth02 hasn't been destroyed" + exit 1 +fi diff --git a/test/rtnetlink/linux/veth_test.sh b/test/rtnetlink/linux/veth_test.sh index 4e24d3f02..d1c10fffa 100755 --- a/test/rtnetlink/linux/veth_test.sh +++ b/test/rtnetlink/linux/veth_test.sh @@ -30,17 +30,6 @@ if ! wait_for ! ip link show test_veth02; then exit 1 fi -# Create a new veth pair in the current namespace and rename the link. -ip link add name test_veth01 type veth peer name test_veth02 -ip link set test_veth01 name test_veth03 -ip link show test_veth03 -ip link del name test_veth03 -# Check that test_veth02 has been destroyed. -if ! wait_for ! ip link show test_veth02; then - fail "test_veth02 hasn't been destroyed" - exit 1 -fi - ip netns add test ip link add test_veth01 type veth peer name test_veth02 netns test ip link show test_veth01