2 Documentation Bulkomatic Keyword library contains keywords for performing bulkomatic operations
3 ... with a single bulkomatic API we can trigger bulk flows in config datastore which eventually populates switches and operational datastore
4 ... So far this library is only to be used by MD-SAL clustering and OpenFlowplugin clustering test as it is very specific for these tests
6 Variables ../variables/Variables.py
9 ${ADD_BULK_CONFIG_NODES_API} /restconf/operations/sal-bulk-flow:flow-test
10 ${GET_BULK_CONFIG_NODES_API} /restconf/operations/sal-bulk-flow:read-flow-test
11 ${jolokia_write_op_status} /jolokia/read/org.opendaylight.openflowplugin.applications.bulk.o.matic:type=FlowCounter/WriteOpStatus
12 ${jolokia_read_op_status} /jolokia/read/org.opendaylight.openflowplugin.applications.bulk.o.matic:type=FlowCounter/ReadOpStatus
13 ${jolokia_flow_count_status} /jolokia/read/org.opendaylight.openflowplugin.applications.bulk.o.matic:type=FlowCounter/FlowCount
16 Operation Status Check
17 [Arguments] ${controller_index} ${op_status_uri}
18 [Documentation] Checks to see if read or write operation is successfull in controller node.
19 ${data}= Utils.Get Data From URI controller${controller_index} ${op_status_uri}
21 ${json}= To Json ${data}
22 ${value}= Get From Dictionary ${json} value
23 ${value}= Convert to String ${value}
24 ${two}= Convert to String 2
25 Should Start With ${value} ${two}
27 Wait Until Write Finishes
28 [Arguments] ${controller_index} ${timeout}
29 [Documentation] Wait Until Write operation status is OK in ${controller_index}.
30 Wait Until Keyword Succeeds ${timeout} 1s BulkomaticKeywords.Operation Status Check ${controller_index} ${jolokia_write_op_status}
32 Wait Until Read Finishes
33 [Arguments] ${controller_index} ${timeout}
34 [Documentation] Wait Until Read operation status is OK in ${controller_index}.
35 Wait Until Keyword Succeeds ${timeout} 1s BulkomaticKeywords.Operation Status Check ${controller_index} ${jolokia_read_op_status}
38 [Arguments] ${controller_index} ${add_bulk_json_file}
39 [Documentation] Add Bulk Flow in ${controller_index} according to ${add_bulk_json_file}.
40 ${add_body}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/${add_bulk_json_file}
41 ${resp} Utils.Post Elements To URI ${ADD_BULK_CONFIG_NODES_API} ${add_body} headers=${HEADERS_YANG_JSON} session=controller${controller_index}
44 [Arguments] ${controller_index} ${del_bulk_json_file}
45 [Documentation] Delete Bulk Flow in ${controller_index} according to ${del_bulk_json_file}.
46 ${del_body}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/${del_bulk_json_file}
47 ${resp} Utils.Post Elements To URI ${ADD_BULK_CONFIG_NODES_API} ${del_body} headers=${HEADERS_YANG_JSON} session=controller${controller_index}
50 [Arguments] ${controller_index} ${get_bulk_json_file}
51 [Documentation] Get Bulk Flow in ${controller_index} according to ${get_bulk_json_file}.
52 ${get_body}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/${get_bulk_json_file}
53 ${resp} Utils.Post Elements To URI ${GET_BULK_CONFIG_NODES_API} ${get_body} headers=${HEADERS_YANG_JSON} session=controller${controller_index}
56 [Arguments] ${controller_index}
57 [Documentation] Get Flow count in ${controller_index}. New Flow Count is available after Get Bulk Flow operation.
58 ${data}= Utils.Get Data From URI controller${controller_index} ${jolokia_flow_count_status}
63 [Arguments] ${controller_index} ${flow_count}
64 [Documentation] Verify Flow Count in ${controller_index} matches ${flow_count}.
65 ${data}= Get Bulk Flow Count ${controller_index}
67 ${json}= To Json ${data}
68 ${value}= Get From Dictionary ${json} value
69 Should Be Equal As Strings ${value} ${flow_count}
72 [Arguments] ${controller_index} ${add_bulk_json_file} ${timeout}
73 [Documentation] Add Bulk Flow in ${controller_index} and wait until operation is completed.
74 Add Bulk Flow ${controller_index} ${add_bulk_json_file}
75 Wait Until Write Finishes ${controller_index} ${timeout}
77 Delete Bulk Flow In Node
78 [Arguments] ${controller_index} ${delete_bulk_json_file} ${timeout}
79 [Documentation] Delete Bulk Flow in ${controller_index} and wait until operation is completed.
80 Delete Bulk Flow ${controller_index} ${delete_bulk_json_file}
81 Wait Until Write Finishes ${controller_index} ${timeout}
83 Get Bulk Flow And Verify Count In Cluster
84 [Arguments] ${controller_index_list} ${get_bulk_json_file} ${timeout} ${flow_count}
85 [Documentation] Get Bulk Flow and Verify Flow Count in ${controller_index_list} matches ${flow_count}.
86 : FOR ${index} IN @{controller_index_list}
87 \ Get Bulk Flow ${index} ${get_bulk_json_file}
88 : FOR ${index} IN @{controller_index_list}
89 \ Wait Until Read Finishes ${index} ${timeout}
90 : FOR ${index} IN @{controller_index_list}
91 \ Verify Flow Count ${index} ${flow_count}