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
7 Variables ../variables/Variables.py
11 ${ADD_BULK_CONFIG_NODES_API} /rests/operations/sal-bulk-flow:flow-test
12 ${GET_BULK_CONFIG_NODES_API} /rests/operations/sal-bulk-flow:read-flow-test
13 ${ADD_TABLE_NODEs_API} /rests/operations/sal-bulk-flow:table-test
14 ${jolokia_write_op_status}
15 ... /jolokia/read/org.opendaylight.openflowplugin.applications.bulk.o.matic:type=FlowCounter/WriteOpStatus
16 ${jolokia_read_op_status}
17 ... /jolokia/read/org.opendaylight.openflowplugin.applications.bulk.o.matic:type=FlowCounter/ReadOpStatus
18 ${jolokia_flow_count_status}
19 ... /jolokia/read/org.opendaylight.openflowplugin.applications.bulk.o.matic:type=FlowCounter/FlowCount
23 Operation Status Check
24 [Documentation] Checks to see if read or write operation is successfull in controller node.
25 [Arguments] ${op_status_uri} ${controller_index}
26 ${data}= ClusterManagement.Get From Member ${op_status_uri} ${controller_index}
27 ${json}= To Json ${data}
28 ${value}= Get From Dictionary ${json} value
29 ${value}= Convert to String ${value}
30 ${two}= Convert to String 2
31 Should Start With ${value} ${two}
33 Wait Until Write Finishes
34 [Documentation] Wait Until Write operation status is OK in member ${controller_index}.
35 [Arguments] ${controller_index} ${timeout}
36 Wait Until Keyword Succeeds
39 ... BulkomaticKeywords.Operation Status Check
40 ... ${jolokia_write_op_status}
41 ... ${controller_index}
43 Wait Until Read Finishes
44 [Documentation] Wait Until Read operation status is OK in member ${controller_index}.
45 [Arguments] ${controller_index} ${timeout}
46 Wait Until Keyword Succeeds
49 ... BulkomaticKeywords.Operation Status Check
50 ... ${jolokia_read_op_status}
51 ... ${controller_index}
54 [Documentation] Add Bulk Flow in member ${controller_index} according to \${json_body_add}.
55 [Arguments] ${json_body_add} ${controller_index}
56 ${resp}= ClusterManagement.Post As Json To Member
57 ... ${ADD_BULK_CONFIG_NODES_API}
59 ... ${controller_index}
62 [Documentation] Add Table in member ${controller_index} according to \${json_body_add}.
63 [Arguments] ${json_body_add} ${controller_index}
64 ${resp}= ClusterManagement.Post As Json To Member
65 ... ${ADD_TABLE_NODEs_API}
67 ... ${controller_index}
70 [Documentation] Delete Bulk Flow in member ${controller_index} according to \${json_body_del}.
71 [Arguments] ${json_body_del} ${controller_index}
72 ${resp}= ClusterManagement.Post As Json To Member
73 ... ${ADD_BULK_CONFIG_NODES_API}
75 ... ${controller_index}
78 [Documentation] Get Bulk Flow in member ${controller_index} according to \${json_body_get}.
79 [Arguments] ${json_body_get} ${controller_index}
80 ${resp}= ClusterManagement.Post As Json To Member
81 ... ${GET_BULK_CONFIG_NODES_API}
83 ... ${controller_index}
86 [Documentation] Get Flow count in member ${controller_index}. New Flow Count is available after Get Bulk Flow operation.
87 [Arguments] ${controller_index}
88 ${data}= ClusterManagement.Get From Member ${jolokia_flow_count_status} ${controller_index}
92 [Documentation] Verify Flow Count in member ${controller_index} matches ${flow_count}.
93 [Arguments] ${flow_count} ${controller_index}
94 ${data}= Get Bulk Flow Count ${controller_index}
95 ${json}= To Json ${data}
96 ${value}= Get From Dictionary ${json} value
97 Should Be Equal As Strings ${value} ${flow_count}
100 [Documentation] Add Bulk Flow in member ${controller_index} and wait until operation is completed.
101 [Arguments] ${json_body_add} ${controller_index} ${timeout}
102 Add Bulk Flow ${json_body_add} ${controller_index}
103 Wait Until Write Finishes ${controller_index} ${timeout}
106 [Documentation] Add Table Flow in member ${controller_index} and wait until operation is completed.
107 [Arguments] ${json_body_add} ${controller_index} ${timeout}
108 Add Table Flow ${json_body_add} ${controller_index}
109 Wait Until Write Finishes ${controller_index} ${timeout}
111 Delete Bulk Flow In Node
112 [Documentation] Delete Bulk Flow in member ${controller_index} and wait until operation is completed.
113 [Arguments] ${json_body_del} ${controller_index} ${timeout}
114 Delete Bulk Flow ${json_body_del} ${controller_index}
115 Wait Until Write Finishes ${controller_index} ${timeout}
117 Get Bulk Flow And Verify Count In Cluster
118 [Documentation] Get Bulk Flow and Verify Flow Count in ${controller_index_list} matches ${flow_count}.
119 [Arguments] ${json_body_get} ${timeout} ${flow_count} ${controller_index_list}=${EMPTY}
120 ${index_list}= ClusterManagement.List Indices Or All given_list=${controller_index_list}
121 FOR ${index} IN @{index_list}
122 Get Bulk Flow ${json_body_get} ${index}
124 FOR ${index} IN @{index_list}
125 Wait Until Read Finishes ${index} ${timeout}
127 FOR ${index} IN @{index_list}
128 Verify Flow Count ${flow_count} ${index}
131 Set DPN And Flow Count In Json Add
132 [Documentation] Set new DPN count and flows count per DPN in the Bulkomatic Add json file.
133 [Arguments] ${json_config} ${dpn_count} ${flows_count}
134 ${body}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/${json_config}
135 ${get_string}= Set Variable "sal-bulk-flow:dpn-count" : "1"
136 ${put_string}= Set Variable "sal-bulk-flow:dpn-count" : "${dpn_count}"
137 ${str}= Replace String Using Regexp ${body} ${get_string} ${put_string}
138 ${get_string}= Set Variable "sal-bulk-flow:flows-per-dpn" : "1000"
139 ${put_string}= Set Variable "sal-bulk-flow:flows-per-dpn" : "${flows_count}"
140 ${json_body_add}= Replace String Using Regexp ${str} ${get_string} ${put_string}
141 ${get_string}= Set Variable "sal-bulk-flow:batch-size" : "1"
142 ${put_string}= Set Variable "sal-bulk-flow:batch-size" : "${flows_count}"
143 ${json_body_add}= Replace String Using Regexp ${json_body_add} ${get_string} ${put_string}
145 RETURN ${json_body_add}
147 Set DPN And Flow Count In Json Get
148 [Documentation] Set new DPN count and flows count per DPN in the Bulkomatic Get json file.
149 [Arguments] ${json_config} ${dpn_count} ${flows_count}
150 ${body}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/${json_config}
151 ${get_string}= Set Variable "sal-bulk-flow:dpn-count" : "1"
152 ${put_string}= Set Variable "sal-bulk-flow:dpn-count" : "${dpn_count}"
153 ${str}= Replace String Using Regexp ${body} ${get_string} ${put_string}
154 ${get_string}= Set Variable "sal-bulk-flow:flows-per-dpn" : "1000"
155 ${put_string}= Set Variable "sal-bulk-flow:flows-per-dpn" : "${flows_count}"
156 ${json_body_get}= Replace String Using Regexp ${str} ${get_string} ${put_string}
158 RETURN ${json_body_get}
160 Set DPN And Flow Count In Json Del
161 [Documentation] Set new DPN count and flows count per DPN in the Bulkomatic Del json file.
162 [Arguments] ${json_config} ${dpn_count} ${flows_count}
163 ${body}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/${json_config}
164 ${get_string}= Set Variable "sal-bulk-flow:dpn-count" : "1"
165 ${put_string}= Set Variable "sal-bulk-flow:dpn-count" : "${dpn_count}"
166 ${str}= Replace String Using Regexp ${body} ${get_string} ${put_string}
167 ${get_string}= Set Variable "sal-bulk-flow:flows-per-dpn" : "1000"
168 ${put_string}= Set Variable "sal-bulk-flow:flows-per-dpn" : "${flows_count}"
169 ${json_body_del}= Replace String Using Regexp ${str} ${get_string} ${put_string}
170 ${get_string}= Set Variable "sal-bulk-flow:batch-size" : "1"
171 ${put_string}= Set Variable "sal-bulk-flow:batch-size" : "${flows_count}"
172 ${json_body_del}= Replace String Using Regexp ${json_body_del} ${get_string} ${put_string}
174 RETURN ${json_body_del}