bond: Add ovs-appctl bond/show to LACP sanity checks.
[openvswitch] / tests / lacp.at
1 AT_BANNER([lacp])
2
3 AT_SETUP([lacp - config])
4 OVS_VSWITCHD_START([\
5         add-port br0 p1 --\
6         set Port p1 lacp=active --\
7         set Interface p1 type=dummy ])
8
9 AT_CHECK([ovs-appctl lacp/show], [0], [dnl
10 ---- p1 ----
11         status: active negotiated
12         sys_id: aa:55:aa:55:00:00
13         sys_priority: 65535
14         aggregation key: 1
15         lacp_time: slow
16
17 slave: p1: expired attached
18         port_id: 1
19         port_priority: 65535
20
21         actor sys_id: aa:55:aa:55:00:00
22         actor sys_priority: 65535
23         actor port_id: 1
24         actor port_priority: 65535
25         actor key: 1
26         actor state: activity synchronized collecting distributing expired
27
28         partner sys_id: 00:00:00:00:00:00
29         partner sys_priority: 0
30         partner port_id: 0
31         partner port_priority: 0
32         partner key: 0
33         partner state: timeout
34 ])
35 AT_CHECK([ovs-appctl bond/show])
36 OVS_VSWITCHD_STOP
37 AT_CLEANUP
38
39 AT_SETUP([lacp - multi port config])
40 OVS_VSWITCHD_START([dnl
41         add-bond br0 bond p1 p2 --\
42         set Port bond lacp=active \
43             bond_mode=active-backup \
44             other_config:lacp-time="fast" \
45             other_config:lacp-system-id=11:22:33:44:55:66 \
46             other_config:lacp-system-priority=54321 --\
47         set Interface p1 type=dummy \
48             other_config:lacp-port-id=11 \
49             other_config:lacp-port-priority=111 \
50             other_config:lacp-aggregation-key=3333 --\
51         set Interface p2 type=dummy \
52             other_config:lacp-port-id=22 \
53             other_config:lacp-port-priority=222 \
54             other_config:lacp-aggregation-key=3333 ])
55
56 AT_CHECK([ovs-appctl lacp/show], [0], [stdout])
57 AT_CHECK([sed -e 's/aggregation key:.*/aggregation key: <omitted>/' < stdout], [0], [dnl
58 ---- bond ----
59         status: active negotiated
60         sys_id: 11:22:33:44:55:66
61         sys_priority: 54321
62         aggregation key: <omitted>
63         lacp_time: fast
64
65 slave: p1: expired attached
66         port_id: 11
67         port_priority: 111
68
69         actor sys_id: 11:22:33:44:55:66
70         actor sys_priority: 54321
71         actor port_id: 11
72         actor port_priority: 111
73         actor key: 3333
74         actor state: activity timeout aggregation synchronized collecting distributing expired
75
76         partner sys_id: 00:00:00:00:00:00
77         partner sys_priority: 0
78         partner port_id: 0
79         partner port_priority: 0
80         partner key: 0
81         partner state: timeout
82
83 slave: p2: expired attached
84         port_id: 22
85         port_priority: 222
86
87         actor sys_id: 11:22:33:44:55:66
88         actor sys_priority: 54321
89         actor port_id: 22
90         actor port_priority: 222
91         actor key: 3333
92         actor state: activity timeout aggregation synchronized collecting distributing expired
93
94         partner sys_id: 00:00:00:00:00:00
95         partner sys_priority: 0
96         partner port_id: 0
97         partner port_priority: 0
98         partner key: 0
99         partner state: timeout
100 ])
101 AT_CHECK([ovs-appctl bond/show], [0], [dnl
102 ---- bond ----
103 bond_mode: active-backup
104 bond-hash-basis: 0
105 updelay: 0 ms
106 downdelay: 0 ms
107 lacp_negotiated: true
108
109 slave p1: disabled
110         may_enable: false
111
112 slave p2: disabled
113         may_enable: false
114
115 ])
116 OVS_VSWITCHD_STOP
117 AT_CLEANUP