]> git.proxmox.com Git - ovs.git/commitdiff
tests: add-del-add sequence for interface
authorAshish Varma <ashishvarma.ovs@gmail.com>
Fri, 15 Dec 2017 15:09:50 +0000 (07:09 -0800)
committerBen Pfaff <blp@ovn.org>
Wed, 10 Jan 2018 21:13:18 +0000 (13:13 -0800)
Added a unit test case for testing the condition when a veth interface
is added to br0 and then the veth interface is deleted from the
system and added back with the same name.

Signed-off-by: Ashish Varma <ashishvarma.ovs@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
tests/automake.mk
tests/system-interface.at [new file with mode: 0644]
tests/system-kmod-testsuite.at
tests/system-userspace-testsuite.at

index 8157641d94f9c306a2604832623a6f446067edb2..18698ebc342d2f3d70cc5f0ee974a8e999252366 100644 (file)
@@ -119,7 +119,8 @@ SYSTEM_TESTSUITE_AT = \
        tests/system-common-macros.at \
        tests/system-ovn.at \
        tests/system-layer3-tunnels.at \
-       tests/system-traffic.at
+       tests/system-traffic.at \
+       tests/system-interface.at
 
 SYSTEM_OFFLOADS_TESTSUITE_AT = \
        tests/system-common-macros.at \
diff --git a/tests/system-interface.at b/tests/system-interface.at
new file mode 100644 (file)
index 0000000..db790d5
--- /dev/null
@@ -0,0 +1,27 @@
+AT_BANNER([system-inteface])
+
+dnl add a veth interface to br0, then delete and re-create
+dnl the veth interface with the same name in the system
+AT_SETUP([interface - add delete add same interface])
+
+OVS_TRAFFIC_VSWITCHD_START()
+
+AT_CHECK([ip link add ovs-veth0 type veth peer name ovs-veth1])
+on_exit 'ip link del ovs-veth0'
+
+AT_CHECK([ovs-vsctl add-port br0 ovs-veth0])
+
+AT_CHECK([ip link del ovs-veth0])
+AT_CHECK([ip link add ovs-veth0 type veth peer name ovs-veth1])
+
+AT_CHECK([ovs-vsctl del-port br0 ovs-veth0])
+
+OVS_TRAFFIC_VSWITCHD_STOP(["dnl
+/could not open network device ovs-veth0/d
+/cannot get .*STP status on nonexistent port/d
+/ethtool command .*on network device ovs-veth0 failed/d
+/error receiving .*ovs-veth0/d
+/ovs-veth0: removing policing failed/d"])
+
+AT_CLEANUP
+
index 975b200342e62baea360a5ee67f14fe190bbf1bf..bda314a08986d5def9e9c46c8de429f586640fd1 100644 (file)
@@ -25,3 +25,4 @@ m4_include([tests/system-kmod-macros.at])
 m4_include([tests/system-traffic.at])
 m4_include([tests/system-layer3-tunnels.at])
 m4_include([tests/system-ovn.at])
+m4_include([tests/system-interface.at])
index a89536f1d3812807ee11199526dc41d255d6a6ec..c0aaa606d05d401751ee05463cace76eb03443c1 100644 (file)
@@ -25,4 +25,5 @@ m4_include([tests/system-common-macros.at])
 m4_include([tests/system-traffic.at])
 m4_include([tests/system-layer3-tunnels.at])
 m4_include([tests/system-ovn.at])
+m4_include([tests/system-interface.at])
 m4_include([tests/system-userspace-packet-type-aware.at])