]> git.proxmox.com Git - mirror_ovs.git/blob - tests/bridge.at
odp-util: Fix netlink message overflow with userdata.
[mirror_ovs.git] / tests / bridge.at
1 AT_BANNER([bridge])
2
3 dnl When a port disappears from a datapath, e.g. because an admin used
4 dnl "ovs-dpctl del-port", the bridge code should be resilient enough to
5 dnl notice and add it back the next time we reconfigure. A prior version
6 dnl of the code failed to do this, so this test guards against regression.
7 AT_SETUP([bridge - ports that disappear get added back])
8 OVS_VSWITCHD_START
9
10 # Add some ports and make sure that they show up in the datapath.
11 add_of_ports br0 1 2
12 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
13 dummy@ovs-dummy: hit:0 missed:0
14 br0:
15 br0 65534/100: (dummy-internal)
16 p1 1/1: (dummy)
17 p2 2/2: (dummy)
18 ])
19
20 # Delete p1 from the datapath with "ovs-dpctl del-if"
21 # and check that it disappeared.
22 AT_CHECK([ovs-appctl dpctl/del-if dummy@ovs-dummy p1])
23 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
24 dummy@ovs-dummy: hit:0 missed:0
25 br0:
26 br0 65534/100: (dummy-internal)
27 p2 2/2: (dummy)
28 ])
29
30 # Force reconfiguration and make sure that p1 got added back.
31 AT_CHECK([ovs-vsctl del-port p2])
32 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
33 dummy@ovs-dummy: hit:0 missed:0
34 br0:
35 br0 65534/100: (dummy-internal)
36 p1 1/1: (dummy)
37 ])
38 OVS_APP_EXIT_AND_WAIT([ovs-vswitchd])
39 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
40 AT_CLEANUP
41
42 dnl When multiple bridges are connected to the same controller, make
43 dnl sure their status are tracked independently.
44 AT_SETUP([bridge - multiple bridges share a controller])
45 OVS_VSWITCHD_START(
46 [add-br br1 -- \
47 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
48 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 ])
49
50 dnl Start ovs-testcontroller
51 AT_CHECK([ovs-testcontroller --detach --no-chdir punix:controller --pidfile], [0], [ignore])
52 on_exit 'kill `cat ovs-testcontroller.pid`'
53 OVS_WAIT_UNTIL([test -e controller])
54
55 dnl Add the controller to both bridges, 5 seconds apart.
56 AT_CHECK([ovs-vsctl set-controller br0 unix:controller])
57 AT_CHECK([ovs-vsctl set-fail-mode br0 secure])
58 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
59 AT_CHECK([ovs-vsctl set-controller br1 unix:controller])
60 AT_CHECK([ovs-vsctl set-fail-mode br1 secure])
61
62 dnl Wait for the controller connectionsi to be up
63 for i in `seq 0 19`
64 do
65 if ovs-vsctl --columns=is_connected list controller |grep "false"; then
66 :
67 else
68 break
69 fi
70 ovs-appctl time/warp 1100
71 done
72
73 dnl Make sure the connection status have two records and they are different.
74 dnl (The exact output contains timing information that are machine dependent.)
75 AT_CHECK([ovs-vsctl --columns=status list controller | dnl
76 grep "status" | sort -u |wc -l], [0], [2
77 ])
78
79 OVS_APP_EXIT_AND_WAIT([ovs-vswitchd])
80 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
81 AT_CLEANUP
82
83 AT_SETUP([bridge - add port after stopping controller])
84 OVS_VSWITCHD_START
85
86 dnl Start ovs-testcontroller
87 AT_CHECK([ovs-testcontroller --no-chdir --detach punix:controller --pidfile], [0], [ignore])
88 OVS_WAIT_UNTIL([test -e controller])
89
90 AT_CHECK([ovs-vsctl set-controller br0 unix:controller])
91 AT_CHECK([ovs-vsctl add-port br0 p1 -- set Interface p1 type=internal], [0], [ignore])
92 AT_CHECK([ovs-appctl -t ovs-vswitchd version], [0], [ignore])
93
94 # Now kill the ovs-testcontroller
95 kill `cat ovs-testcontroller.pid`
96 if test "$IS_WIN32" = "yes"; then
97 AT_CHECK([rm controller], [0], [ignore])
98 fi
99 OVS_WAIT_UNTIL([! test -e controller])
100 AT_CHECK([ovs-vsctl --no-wait add-port br0 p2 -- set Interface p2 type=internal], [0], [ignore])
101 AT_CHECK([ovs-appctl -t ovs-vswitchd version], [0], [ignore])
102
103 OVS_APP_EXIT_AND_WAIT([ovs-vswitchd])
104 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
105 AT_CLEANUP
106
107 AT_SETUP([bridge - change ofproto versions])
108 dnl Start vswitch and add a version test bridge
109 OVS_VSWITCHD_START(
110 [add-br vr_test0 -- \
111 set bridge vr_test0 datapath-type=dummy \
112 protocols=OpenFlow10])
113
114 dnl set the version to include, say, OpenFlow14
115 AT_CHECK([ovs-vsctl set bridge vr_test0 protocols=OpenFlow10,OpenFlow14])
116
117 dnl now try to use bundle action on a flow
118 AT_CHECK([ovs-ofctl add-flow vr_test0 --bundle actions=normal])
119
120 OVS_APP_EXIT_AND_WAIT([ovs-vswitchd])
121 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
122 AT_CLEANUP