summaryrefslogtreecommitdiff
path: root/tests/netdev-type.at
diff options
context:
space:
mode:
authorThadeu Lima de Souza Cascardo <cascardo@redhat.com>2016-07-04 15:19:56 -0300
committerJesse Gross <jesse@kernel.org>2016-07-06 09:07:42 -0700
commita5bdd3b20d88b40df605db49e7f510e626a87469 (patch)
tree10c444c085005acf49593b7ac138bb66787e2959 /tests/netdev-type.at
parent914403294be27cabaa08778d78fe2b8c87045ba0 (diff)
downloadopenvswitch-a5bdd3b20d88b40df605db49e7f510e626a87469.tar.gz
bridge: open_type should be used for netdev_open
ofproto_port_open_type should be used for netdev_open, but not for other tests. For example, STP/RSTP check for interfaces of internal type, but that check will fail when the netdev datapath is used. The same thing goes for setting MAC address of internal Interfaces. That fails for the netdev datapath because the interface type is set to "tap", but they are still interfaces of type "internal", just their netdev implementation is different. Use a netdev_type for the type that needs to be used for netdev_open and ofproto_port, while we still keep the type as the normalized configured type in the database. Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com> Signed-off-by: Jesse Gross <jesse@kernel.org>
Diffstat (limited to 'tests/netdev-type.at')
-rw-r--r--tests/netdev-type.at24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/netdev-type.at b/tests/netdev-type.at
new file mode 100644
index 000000000..184031b7e
--- /dev/null
+++ b/tests/netdev-type.at
@@ -0,0 +1,24 @@
+AT_BANNER([netdev-type])
+
+dnl Setting MAC address of netdev internal port fails
+AT_SETUP([bridge - set MAC address of internal port])
+OVS_VSWITCHD_START
+
+# Add an internal port and make sure that it shows up in the datapath.
+add_of_ports br0 1
+AT_CHECK([ovs-appctl dpif/show], [0], [dnl
+dummy@ovs-dummy: hit:0 missed:0
+ br0:
+ br0 65534/100: (dummy)
+ p1 1/1: (dummy)
+])
+#
+# Set MAC address of dummy device and check that it has been set
+AT_CHECK([ovs-vsctl set Interface p1 type=internal mac=\"aa:55:c0:ff:ee:00\"])
+AT_CHECK([ovs-vsctl get Interface p1 mac_in_use], [0], [dnl
+"aa:55:c0:ff:ee:00"
+])
+
+OVS_APP_EXIT_AND_WAIT([ovs-vswitchd])
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
+AT_CLEANUP