This patch adds tests which check that configuration settings in the database are reflected in the LACP module's appctl output. --- tests/automake.mk | 1 + tests/lacp.at | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/testsuite.at | 1 + 3 files changed, 107 insertions(+), 0 deletions(-) create mode 100644 tests/lacp.at
diff --git a/tests/automake.mk b/tests/automake.mk index 1236a26..8649b80 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -18,6 +18,7 @@ TESTSUITE_AT = \ tests/odp.at \ tests/multipath.at \ tests/autopath.at \ + tests/lacp.at \ tests/learn.at \ tests/vconn.at \ tests/file_name.at \ diff --git a/tests/lacp.at b/tests/lacp.at new file mode 100644 index 0000000..27e0f94 --- /dev/null +++ b/tests/lacp.at @@ -0,0 +1,105 @@ +AT_BANNER([lacp]) + +AT_SETUP([lacp - config]) +OVS_VSWITCHD_START([\ + add-port br0 p1 --\ + set Port p1 lacp=active --\ + set Interface p1 type=dummy ]) + +AT_CHECK([ovs-appctl lacp/show], [0], [stdout]) +AT_CHECK([cat stdout | sed -e 's/state:.*/state: <omitted>/' -e 's/\t/ /'], [0], [dnl +---- p1 ---- + status: active negotiated + sys_id: aa:55:aa:55:00:00 + sys_priority: 65535 + aggregation key: 1 + lacp_time: slow + +slave: p1: expired attached + port_id: 1 + port_priority: 65535 + + actor sys_id: aa:55:aa:55:00:00 + actor sys_priority: 65535 + actor port_id: 1 + actor port_priority: 65535 + actor key: 1 + actor state: <omitted> + + partner sys_id: 00:00:00:00:00:00 + partner sys_priority: 0 + partner port_id: 0 + partner port_priority: 0 + partner key: 0 + partner state: <omitted> +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([lacp - config]) +OVS_VSWITCHD_START([dnl + add-bond br0 bond p1 p2 --\ + set Port bond lacp=active \ + other_config:lacp-time="fast" \ + other_config:lacp-system-id=11:22:33:44:55:66 \ + other_config:lacp-system-priority=54321 --\ + set Interface p1 type=dummy \ + other_config:lacp-port-id=11 \ + other_config:lacp-port-priority=111 \ + other_config:lacp-aggregation-key=3333 --\ + set Interface p2 type=dummy \ + other_config:lacp-port-id=22 \ + other_config:lacp-port-priority=222 \ + other_config:lacp-aggregation-key=3333 ]) + +AT_CHECK([ovs-appctl lacp/show], [0], [stdout]) +AT_CHECK([cat stdout | sed \ +-e 's/state:.*/state: <omitted>/' \ +-e 's/aggregation key:.*/aggregation key: <omitted>/' \ +-e 's/\t/ /' +], [0], [dnl +---- bond ---- + status: active negotiated + sys_id: 11:22:33:44:55:66 + sys_priority: 54321 + aggregation key: <omitted> + lacp_time: fast + +slave: p1: expired attached + port_id: 11 + port_priority: 111 + + actor sys_id: 11:22:33:44:55:66 + actor sys_priority: 54321 + actor port_id: 11 + actor port_priority: 111 + actor key: 3333 + actor state: <omitted> + + partner sys_id: 00:00:00:00:00:00 + partner sys_priority: 0 + partner port_id: 0 + partner port_priority: 0 + partner key: 0 + partner state: <omitted> + +slave: p2: expired attached + port_id: 22 + port_priority: 222 + + actor sys_id: 11:22:33:44:55:66 + actor sys_priority: 54321 + actor port_id: 22 + actor port_priority: 222 + actor key: 3333 + actor state: <omitted> + + partner sys_id: 00:00:00:00:00:00 + partner sys_priority: 0 + partner port_id: 0 + partner port_priority: 0 + partner key: 0 + partner state: <omitted> +]) +OVS_VSWITCHD_STOP +AT_CLEANUP diff --git a/tests/testsuite.at b/tests/testsuite.at index 481742e..d8af592 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -38,6 +38,7 @@ m4_define([OVS_WAIT_WHILE], [OVS_WAIT([if $1; then :; else exit 0; fi], [$2])]) m4_include([tests/ovsdb-macros.at]) m4_include([tests/ofproto-macros.at]) +m4_include([tests/lacp.at]) m4_include([tests/library.at]) m4_include([tests/bundle.at]) m4_include([tests/classifier.at]) -- 1.7.7 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev