From a5bdd3b20d88b40df605db49e7f510e626a87469 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Mon, 4 Jul 2016 15:19:56 -0300 Subject: 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 Signed-off-by: Jesse Gross --- tests/netdev-type.at | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/netdev-type.at (limited to 'tests/netdev-type.at') 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 -- cgit v1.2.1