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 ${ADD_TABLE_NODEs_API} /restconf/operations/sal-bulk-flow:table-test
12 ${jolokia_write_op_status} /jolokia/read/org.opendaylight.openflowplugin.applications.bulk.o.matic:type=FlowCounter/WriteOpStatus
13 ${jolokia_read_op_status} /jolokia/read/org.opendaylight.openflowplugin.applications.bulk.o.matic:type=FlowCounter/ReadOpStatus
14 ${jolokia_flow_count_status} /jolokia/read/org.opendaylight.openflowplugin.applications.bulk.o.matic:type=FlowCounter/FlowCount
17 Operation Status Check
18 [Arguments] ${op_status_uri} ${controller_index}
19 [Documentation] Checks to see if read or write operation is successfull in controller node.
20 ${data}= ClusterManagement.Get From Member ${op_status_uri} ${controller_index}
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 member ${controller_index}.
30 Wait Until Keyword Succeeds ${timeout} 1s BulkomaticKeywords.Operation Status Check ${jolokia_write_op_status} ${controller_index}
32 Wait Until Read Finishes
33 [Arguments] ${controller_index} ${timeout}
34 [Documentation] Wait Until Read operation status is OK in member ${controller_index}.
35 Wait Until Keyword Succeeds ${timeout} 1s BulkomaticKeywords.Operation Status Check ${jolokia_read_op_status} ${controller_index}
38 [Arguments] ${json_body_add} ${controller_index}
39 [Documentation] Add Bulk Flow in member ${controller_index} according to \${json_body_add}.
40 ${resp} ClusterManagement.Post As Json To Member ${ADD_BULK_CONFIG_NODES_API} ${json_body_add} ${controller_index}
43 [Arguments] ${json_body_add} ${controller_index}
44 [Documentation] Add Table in member ${controller_index} according to \${json_body_add}.
45 ${resp} ClusterManagement.Post As Json To Member ${ADD_TABLE_NODEs_API} ${json_body_add} ${controller_index}
48 [Arguments] ${json_body_del} ${controller_index}
49 [Documentation] Delete Bulk Flow in member ${controller_index} according to \${json_body_del}.
50 ${resp} ClusterManagement.Post As Json To Member ${ADD_BULK_CONFIG_NODES_API} ${json_body_del} ${controller_index}
53 [Arguments] ${json_body_get} ${controller_index}
54 [Documentation] Get Bulk Flow in member ${controller_index} according to \${json_body_get}.
55 ${resp} ClusterManagement.Post As Json To Member ${GET_BULK_CONFIG_NODES_API} ${json_body_get} ${controller_index}
58 [Arguments] ${controller_index}
59 [Documentation] Get Flow count in member ${controller_index}. New Flow Count is available after Get Bulk Flow operation.
60 ${data}= ClusterManagement.Get From Member ${jolokia_flow_count_status} ${controller_index}
64 [Arguments] ${flow_count} ${controller_index}
65 [Documentation] Verify Flow Count in member ${controller_index} matches ${flow_count}.
66 ${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] ${json_body_add} ${controller_index} ${timeout}
73 [Documentation] Add Bulk Flow in member ${controller_index} and wait until operation is completed.
74 Add Bulk Flow ${json_body_add} ${controller_index}
75 Wait Until Write Finishes ${controller_index} ${timeout}
78 [Arguments] ${json_body_add} ${controller_index} ${timeout}
79 [Documentation] Add Table Flow in member ${controller_index} and wait until operation is completed.
80 Add Table Flow ${json_body_add} ${controller_index}
81 Wait Until Write Finishes ${controller_index} ${timeout}
83 Delete Bulk Flow In Node
84 [Arguments] ${json_body_del} ${controller_index} ${timeout}
85 [Documentation] Delete Bulk Flow in member ${controller_index} and wait until operation is completed.
86 Delete Bulk Flow ${json_body_del} ${controller_index}
87 Wait Until Write Finishes ${controller_index} ${timeout}
89 Get Bulk Flow And Verify Count In Cluster
90 [Arguments] ${json_body_get} ${timeout} ${flow_count} ${controller_index_list}=${EMPTY}
91 [Documentation] Get Bulk Flow and Verify Flow Count in ${controller_index_list} matches ${flow_count}.
92 ${index_list} = ClusterManagement.List Indices Or All given_list=${controller_index_list}
93 : FOR ${index} IN @{index_list}
94 \ Get Bulk Flow ${json_body_get} ${index}
95 : FOR ${index} IN @{index_list}
96 \ Wait Until Read Finishes ${index} ${timeout}
97 : FOR ${index} IN @{index_list}
98 \ Verify Flow Count ${flow_count} ${index}
100 Set DPN And Flow Count In Json Add
101 [Arguments] ${json_config} ${dpn_count} ${flows_count}
102 [Documentation] Set new DPN count and flows count per DPN in the Bulkomatic Add json file.
103 ${body}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/${json_config}
104 ${get_string}= Set Variable "sal-bulk-flow:dpn-count" : "1"
105 ${put_string}= Set Variable "sal-bulk-flow:dpn-count" : "${dpn_count}"
106 ${str} Replace String Using Regexp ${body} ${get_string} ${put_string}
107 ${get_string}= Set Variable "sal-bulk-flow:flows-per-dpn" : "1000"
108 ${put_string}= Set Variable "sal-bulk-flow:flows-per-dpn" : "${flows_count}"
109 ${json_body_add} Replace String Using Regexp ${str} ${get_string} ${put_string}
110 ${get_string}= Set Variable "sal-bulk-flow:batch-size" : "1"
111 ${put_string}= Set Variable "sal-bulk-flow:batch-size" : "${flows_count}"
112 ${json_body_add} Replace String Using Regexp ${json_body_add} ${get_string} ${put_string}
114 [Return] ${json_body_add}
116 Set DPN And Flow Count In Json Get
117 [Arguments] ${json_config} ${dpn_count} ${flows_count}
118 [Documentation] Set new DPN count and flows count per DPN in the Bulkomatic Get json file.
119 ${body}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/${json_config}
120 ${get_string}= Set Variable "sal-bulk-flow:dpn-count" : "1"
121 ${put_string}= Set Variable "sal-bulk-flow:dpn-count" : "${dpn_count}"
122 ${str} Replace String Using Regexp ${body} ${get_string} ${put_string}
123 ${get_string}= Set Variable "sal-bulk-flow:flows-per-dpn" : "1000"
124 ${put_string}= Set Variable "sal-bulk-flow:flows-per-dpn" : "${flows_count}"
125 ${json_body_get} Replace String Using Regexp ${str} ${get_string} ${put_string}
127 [Return] ${json_body_get}
129 Set DPN And Flow Count In Json Del
130 [Arguments] ${json_config} ${dpn_count} ${flows_count}
131 [Documentation] Set new DPN count and flows count per DPN in the Bulkomatic Del json file.
132 ${body}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/${json_config}
133 ${get_string}= Set Variable "sal-bulk-flow:dpn-count" : "1"
134 ${put_string}= Set Variable "sal-bulk-flow:dpn-count" : "${dpn_count}"
135 ${str} Replace String Using Regexp ${body} ${get_string} ${put_string}
136 ${get_string}= Set Variable "sal-bulk-flow:flows-per-dpn" : "1000"
137 ${put_string}= Set Variable "sal-bulk-flow:flows-per-dpn" : "${flows_count}"
138 ${json_body_del} Replace String Using Regexp ${str} ${get_string} ${put_string}
139 ${get_string}= Set Variable "sal-bulk-flow:batch-size" : "1"
140 ${put_string}= Set Variable "sal-bulk-flow:batch-size" : "${flows_count}"
141 ${json_body_del} Replace String Using Regexp ${json_body_del} ${get_string} ${put_string}
143 [Return] ${json_body_del}