c21403c062c07808ae0acc4a34e89551d8d76fce
[integration/test.git] / csit / suites / netconf / MDSAL / northbound.robot
1 *** Settings ***
2 Documentation       Metconf MDSAL Northbound test suite.
3 ...
4 ...                 Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
5 ...
6 ...                 This program and the accompanying materials are made available under the
7 ...                 terms of the Eclipse Public License v1.0 which accompanies this distribution,
8 ...                 and is available at http://www.eclipse.org/legal/epl-v10.html
9 ...
10 ...
11 ...                 The request produced by test cases "Get Config Running", "Get Config Running
12 ...                 To Confirm No_Edit Before Commit", "Get Config Running To Confirm Delete
13 ...                 After Commit" and "Get Config Candidate To Confirm Discard" all use the same
14 ...                 message id ("empty") for their requests. This is possible because the
15 ...                 requests produced by this suite are strictly serialized. The RFC 6241 does
16 ...                 not state that these IDs are unique, it only requires that each ID used is
17 ...                 "XML attribute normalized" if the client wants it to be returned unmodified.
18 ...                 The RFC specifically says that "the content of this attribute is not
19 ...                 interpreted in any way, it only is stored to be returned with the reply to
20 ...                 the request. The reuse of the "empty" string for the 4 test cases was chosen
21 ...                 for simplicity.
22 ...
23 ...                 TODO: Change the 4 testcases to use unique message IDs.
24 ...
25 ...                 TODO: There are many sections with too many "Should_[Not_]Contain" keyword
26 ...                 invocations (see Check_Multiple_Modules_Merge_Replace for a particularly bad
27 ...                 example). Create a resource that will be able to extract the data from the
28 ...                 requests and search for them in the response, then convert to usage of this
29 ...                 resource (think "Thou shall not repeat yourself"). The following resource was
30 ...                 found when doing research on this:
31 ...                 http://robotframework.org/robotframework/latest/libraries/XML.html
32
33 Library             RequestsLibrary
34 Library             SSHLibrary
35 Library             String
36 Library             XML
37 Resource            ${CURDIR}/../../../libraries/CompareStream.robot
38 Resource            ${CURDIR}/../../../libraries/FailFast.robot
39 Resource            ${CURDIR}/../../../libraries/SetupUtils.robot
40 Resource            ${CURDIR}/../../../libraries/SSHKeywords.robot
41 Resource            ${CURDIR}/../../../libraries/Utils.robot
42 Variables           ${CURDIR}/../../../variables/Variables.py
43
44 Suite Setup         Setup_Everything
45 Suite Teardown      Teardown_Everything
46 Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
47 Test Teardown       SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
48
49
50 *** Variables ***
51 ${datadir}              ${CURDIR}/../../../variables/netconf/MDSAL
52 ${dataext}              msg
53 ${ssh_netconf_pid}      -1
54
55
56 *** Test Cases ***
57 Connect_To_ODL_Netconf
58     [Documentation]    Connect to ODL Netconf and fail if that is not possible.
59     Create_ODL_Netconf_Connection
60     Open_ODL_Netconf_Connection
61
62 Get_Config_Running
63     [Documentation]    Make sure the configuration has only the default elements in it.
64     Check_Test_Objects_Not_Present_In_Config    get-config
65
66 Missing_Message_ID_Attribute
67     [Documentation]    Check that messages with missing "message-ID" attribute are rejected with the correct error (RFC 6241, section 4.1).
68     Perform_Test    missing-attr
69
70 Additional_Attributes_In_Message
71     [Documentation]    Check that additional attributes in messages are returned properly (RFC 6241, sections 4.1 and 4.2).
72     ${reply}=    Load_And_Send_Message    additional-attr
73     BuiltIn.Should_Contain    ${reply}    xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
74     BuiltIn.Should_Contain    ${reply}    message-id="1"
75     BuiltIn.Should_Contain    ${reply}    attribute="something"
76     BuiltIn.Should_Contain    ${reply}    additional="otherthing"
77     BuiltIn.Should_Contain    ${reply}    xmlns:prefix="http://www.example.com/my-schema-example.html"
78
79 Send_Stuff_In_Undefined_Namespace
80     [Documentation]    Try to send something within an undefined namespace and check the reply complains about the nonexistent namespace and element.
81     ${reply}=    Load_And_Send_Message    merge-nonexistent-namespace
82     SetupUtils.Set_Known_Bug_Id    5125
83     BuiltIn.Should_Not_Contain    ${reply}    java.lang.NullPointerException
84     SetupUtils.Set_Unknown_Bug_Id
85     BuiltIn.Should_Contain    ${reply}    urn:this:is:in:a:nonexistent:namespace
86     BuiltIn.Should_Contain    ${reply}    <rpc-error>
87
88 Edit_Config_First_Batch_Merge
89     [Documentation]    Request a "merge" operation adding an element in candidate configuration and check the reply.
90     Perform_Test    merge-1
91
92 Get_Config_Running_To_Confirm_No_Edit_Before_Commit
93     [Documentation]    Make sure the running configuration is still unchanged as the change was not commited yet.
94     Check_Test_Objects_Not_Present_In_Config    get-config-no-edit-before-commit
95
96 Commit_Edit
97     [Documentation]    Commit the change and check the reply.
98     Perform_Test    commit-edit
99
100 First_Batch_In_Config_Running_To_Confirm_Edit_After_Commit
101     [Documentation]    Check that the change is now in the configuration.
102     ${reply}=    Load_And_Send_Message    get-config-edit-after-commit
103     Check_First_Batch_Data_Present    ${reply}
104
105 Terminate_Connection_Gracefully
106     [Documentation]    Close the session and disconnect.
107     Close_ODL_Netconf_Connection_Gracefully
108
109 Reconnect_To_ODL_Netconf_After_Graceful_Session_End
110     [Documentation]    Reconnect to ODL Netconf and fail if that is not possible.
111     Open_ODL_Netconf_Connection
112
113 First_Batch_In_Config_Running_After_Reconnect
114     [Documentation]    Check that the change is now in the configuration.
115     ${reply}=    Load_And_Send_Message    get-config-edit-after-commit
116     Check_First_Batch_Data_Present    ${reply}
117
118 Edit_Config_Create_Shall_Fail_Now
119     [Documentation]    Request a "create" operation of an element that already exists and check that it fails with the correct error (RFC 6241, section 7.2, operation "create").
120     Perform_Test    create
121
122 Delete_First_Batch
123     [Documentation]    Delete the created element from the candidate configuration and check the reply.
124     Perform_Test    delete
125
126 Get_Config_Running_To_Confirm_No_Delete_Before_Commit
127     [Documentation]    Make sure the element is still present in the running configuration as the delete command was not committed yet.
128     ${reply}=    Load_And_Send_Message    get-config-no-delete-before-commit
129     Check_First_Batch_Data_Present    ${reply}
130
131 Commit_Delete
132     [Documentation]    Commit the deletion of the element and check the reply.
133     Perform_Test    commit-delete
134
135 Get_Config_Running_To_Confirm_Delete_After_Commit
136     [Documentation]    Check that the element is gone.
137     Check_Test_Objects_Not_Present_In_Config    get-config-delete-after-commit
138
139 Commit_No_Transaction
140     [Documentation]    Attempt to perform "commit" when there are no changes in the candidate configuration and check that it returns OK status.
141     Perform_Test    commit-no-transaction
142     [Teardown]    Utils.Report_Failure_Due_To_Bug    4455
143
144 Edit_Config_Second_Batch_Merge
145     [Documentation]    Create an element to be discarded and check the reply.
146     Perform_Test    merge-2
147
148 Get_And_Check_Config_Candidate_For_Discard
149     [Documentation]    Check that the element to be discarded is present in the candidate configuration.
150     ${reply}=    Load_And_Send_Message    get-config-candidate
151     Check_First_Batch_Data_Not_Present    ${reply}
152     Check_Second_Batch_Data_Present    ${reply}
153
154 Discard_Changes_Using_Discard_Request
155     [Documentation]    Ask the server to discard the candidate and check the reply.
156     Perform_Test    commit-discard
157
158 Get_And_Check_Config_Candidate_To_Confirm_Discard
159     [Documentation]    Check that the element was really discarded.
160     Check_Test_Objects_Not_Present_In_Config    get-config-candidate-discard
161
162 Edit_Config_Multiple_Batch_Merge_Create
163     [Documentation]    Use a create request with the third batch to create the infrastructure.
164     Perform_Test    merge-multiple-create
165
166 Edit_Config_Multiple_Batch_Merge_Third
167     [Documentation]    Use a create request with the third batch to create the infrastructure.
168     Perform_Test    merge-multiple-1
169
170 Edit_Config_Multiple_Batch_Merge_Fourth
171     [Documentation]    Use a merge request with the third batch to create the infrastructure.
172     Perform_Test    merge-multiple-2
173
174 Edit_Config_Multiple_Batch_Merge_Fifth
175     [Documentation]    Add a "name4" subelement to the element and check the reply.
176     Perform_Test    merge-multiple-3
177
178 Commit_Multiple_Merge
179     [Documentation]    Commit the changes and check the reply.
180     Perform_Test    merge-multiple-commit
181
182 Multiple_Batch_Data_In_Running_Config
183     [Documentation]    Check that the 3 subelements are now present in the running configuration.
184     ${reply}=    Load_And_Send_Message    merge-multiple-check
185     Check_Multiple_Batch_Data_Present    ${reply}
186
187 Abort_Connection_To_Simulate_Session_Failure
188     [Documentation]    Simulate session failure by disconnecting without terminating the session.
189     Abort_ODL_Netconf_Connection
190
191 Reconnect_To_ODL_Netconf_After_Session_Failure
192     [Documentation]    Reconnect to ODL Netconf and fail if that is not possible.
193     Open_ODL_Netconf_Connection
194
195 Multiple_Batch_Data_In_Running_Config_After_Session_Failure
196     [Documentation]    Check that the 3 subelements are now present in the running configuration.
197     ${reply}=    Load_And_Send_Message    merge-multiple-check
198     Check_Multiple_Batch_Data_Present    ${reply}
199
200 Edit_Multiple_Merge_Data
201     [Documentation]    Add another subelement named "test" to the element and check the reply.
202     Perform_Test    merge-multiple-edit
203
204 Commit_Multiple_Modules_Merge_Edit
205     [Documentation]    Commit the addition of the "test" subelement and check the reply.
206     Perform_Test    merge-multiple-edit-commit
207
208 Check_Multiple_Modules_Merge_Edit
209     [Documentation]    Check that the "test" subelement exists and has correct value for "port" subelement.
210     ${reply}=    Load_And_Send_Message    merge-multiple-edit-check
211     BuiltIn.Should_Contain    ${reply}    <id>test</id>
212     BuiltIn.Should_Contain    ${reply}    <model>Dixi</model>
213     BuiltIn.Should_Contain    ${reply}    <manufacturer>BMW</manufacturer>
214     BuiltIn.Should_Contain    ${reply}    <year>1928</year>
215
216 Update_Multiple_Modules_Merge
217     [Documentation]    Update the value of the "port" subelement of the "test" subelement and check the reply.
218     Perform_Test    merge-multiple-update
219
220 Commit_Multiple_Modules_Merge_Update
221     [Documentation]    Commit the update and check the reply.
222     Perform_Test    merge-multiple-update-commit
223
224 Check_Multiple_Modules_Merge_Update
225     [Documentation]    Check that the value of the "port" was really updated.
226     ${reply}=    Load_And_Send_Message    merge-multiple-update-check
227     BuiltIn.Should_Contain    ${reply}    <id>test</id>
228     BuiltIn.Should_Contain    ${reply}    <model>Bentley Speed Six</model>
229     BuiltIn.Should_Contain    ${reply}    <manufacturer>Bentley</manufacturer>
230     BuiltIn.Should_Contain    ${reply}    <year>1930</year>
231     BuiltIn.Should_Not_Contain    ${reply}    <model>Dixi</model>
232     BuiltIn.Should_Not_Contain    ${reply}    <manufacturer>BMW</manufacturer>
233     BuiltIn.Should_Not_Contain    ${reply}    <year>1928</year>
234
235 Replace_Multiple_Modules_Merge
236     [Documentation]    Replace the content of the "test" with another completely different and check the reply.
237     Perform_Test    merge-multiple-replace
238
239 Commit_Multiple_Modules_Merge_Replace
240     [Documentation]    Commit the replace and check the reply.
241     Perform_Test    merge-multiple-replace-commit
242
243 Check_Multiple_Modules_Merge_Replace
244     [Documentation]    Check that the new content is there and the old content is gone.
245     ${reply}=    Load_And_Send_Message    merge-multiple-replace-check
246     BuiltIn.Should_Contain    ${reply}    <id>REPLACE</id>
247     BuiltIn.Should_Contain    ${reply}    <manufacturer>FIAT</manufacturer>
248     BuiltIn.Should_Contain    ${reply}    <model>Panda</model>
249     BuiltIn.Should_Contain    ${reply}    <year>2003</year>
250     BuiltIn.Should_Contain    ${reply}    <car-id>REPLACE</car-id>
251     BuiltIn.Should_Not_Contain    ${reply}    <id>TOY001</id>
252     BuiltIn.Should_Not_Contain    ${reply}    <id>CUST001</id>
253     BuiltIn.Should_Not_Contain    ${reply}    <car-id>TOY001</car-id>
254     BuiltIn.Should_Not_Contain    ${reply}    <person-id>CUST001</person-id>
255     BuiltIn.Should_Not_Contain    ${reply}    <id>OLD001</id>
256     BuiltIn.Should_Not_Contain    ${reply}    <id>CUST002</id>
257     BuiltIn.Should_Not_Contain    ${reply}    <car-id>OLD001</car-id>
258     BuiltIn.Should_Not_Contain    ${reply}    <person-id>CUST002</person-id>
259     BuiltIn.Should_Not_Contain    ${reply}    <id>CAROLD</id>
260     BuiltIn.Should_Contain    ${reply}    <id>CUSTOLD</id>
261     BuiltIn.Should_Not_Contain    ${reply}    <car-id>CAROLD</car-id>
262     BuiltIn.Should_Not_Contain    ${reply}    <person-id>CUSTOLD</person-id>
263     BuiltIn.Should_Not_Contain    ${reply}    <id>CARYOUNG</id>
264     BuiltIn.Should_Contain    ${reply}    <id>CUSTYOUNG</id>
265     BuiltIn.Should_Not_Contain    ${reply}    <car-id>CARYOUNG</car-id>
266     BuiltIn.Should_Contain    ${reply}    <person-id>CUSTYOUNG</person-id>
267     BuiltIn.Should_Not_Contain    ${reply}    <id>CARMID</id>
268     BuiltIn.Should_Contain    ${reply}    <id>CUSTMID</id>
269     BuiltIn.Should_Not_Contain    ${reply}    <car-id>CARMID</car-id>
270     BuiltIn.Should_Not_Contain    ${reply}    <person-id>CUSTMID</person-id>
271     BuiltIn.Should_Not_Contain    ${reply}    <id>CAROLD2</id>
272     BuiltIn.Should_Contain    ${reply}    <id>CUSTOLD2</id>
273     BuiltIn.Should_Not_Contain    ${reply}    <car-id>CAROLD2</car-id>
274     BuiltIn.Should_Not_Contain    ${reply}    <person-id>CUSTOLD2</person-id>
275     BuiltIn.Should_Not_Contain    ${reply}    <id>CUSTBAD</id>
276     BuiltIn.Should_Not_Contain    ${reply}    <id>test</id>
277
278 Remove_Test_Data
279     [Documentation]    Remove the testing elements and all their subelements and check the reply.
280     Perform_Test    merge-multiple-remove
281
282 Commit_Test_Data_Removal
283     [Documentation]    Commit the removal and check the reply.
284     Perform_Test    merge-multiple-remove-commit
285
286 Connector_Simplified_Pattern
287     [Documentation]    Several requests in a (simplified) pattern typical for requests from netconf-connector.
288     Perform_Test    none-replace
289     Perform_Test    commit-edit
290     Perform_Test    delete
291     Perform_Test    commit-edit
292
293 Test_Bug_7791
294     [Documentation]    Send (checking replies) series of netconf messages to trigger
295     ...    https://bugs.opendaylight.org/show_bug.cgi?id=7791
296     Perform_Test    bug7791-1
297     Perform_Test    bug7791-2
298     Perform_Test    commit-edit
299     Perform_Test    delete
300     Perform_Test    commit-edit
301     [Teardown]    Utils.Report_Failure_Due_To_Bug    7791
302
303 Delete_Not_Existing_Element
304     [Documentation]    Attempt to delete the elements again and check that it fails with the correct error.
305     Perform_Test    delete-not-existing
306
307 Commit_Delete_Not_Existing_Module
308     [Documentation]    Attempt to commit and check the reply.
309     Perform_Test    commit-no-transaction
310     [Teardown]    Utils.Report_Failure_Due_To_Bug    4455
311
312 Remove_Not_Existing_Module
313     [Documentation]    Attempt to remove the "module" element again and check that the operation is "silently ignored".
314     Perform_Test    remove-not-existing
315
316 Commit_Remove_Not_Existing_Module
317     [Documentation]    Attempt to commit and check the reply.
318     Perform_Test    remove-not-existing-commit
319     [Teardown]    Utils.Report_Failure_Due_To_Bug    4455
320
321 Close_Session
322     [Documentation]    Close the session and check that it was closed properly.
323     Perform_Test    close-session
324
325
326 *** Keywords ***
327 Get_Data
328     [Documentation]    Load the specified data from the data directory and return it.
329     [Arguments]    ${name}
330     ${data}=    OperatingSystem.Get_File    ${datadir}${/}${name}.${dataext}
331     RETURN    ${data}
332
333 Create_ODL_Netconf_Connection
334     [Documentation]    Open a netconf connecion to the given machine.
335     [Arguments]    ${host}=${ODL_SYSTEM_IP}    ${port}=${ODL_NETCONF_MDSAL_PORT}    ${user}=${ODL_NETCONF_USER}    ${password}=${ODL_NETCONF_PASSWORD}
336     # The "-s netconf" flag (see the "SSHLibrary.Write" line below)    is not
337     # supported by SSHLibrary, therefore we need to use this elaborate and
338     # pretty tricky way to connect to the ODL Netconf port.
339     # TODO: Extract into NetconfKeywords as there are other tests that are
340     #    going to need to use this operation (Netconf Performance and Scaling
341     #    comes to my mind now as one of the things tested is the performance
342     #    of the direct netconf connection.
343     # TODO: Make this keyword return a dictionary object with all the
344     #    data about the prepared connection neatly packaged. Make all
345     #    the other keywords handling the connection accept such an
346     #    object and pull the data out of it rather than relying on
347     #    global variables. This will allow for tracking more Netconf
348     #    connections, increasing utility.
349     ${control}=    SSHLibrary.Open_Connection    ${host}    prompt=${ODL_SYSTEM_PROMPT}    timeout=60s
350     SSHKeywords.Flexible_Controller_Login
351     BuiltIn.Set_Suite_Variable    ${ssh_control}    ${control}
352     ${netconf}=    SSHLibrary.Open_Connection    ${host}    prompt=${ODL_SYSTEM_PROMPT}    timeout=60s
353     SSHKeywords.Flexible_Controller_Login
354     BuiltIn.Set_Suite_Variable    ${ssh_netconf}    ${netconf}
355     BuiltIn.Set_Suite_Variable    ${ssh_port}    ${port}
356     BuiltIn.Set_Suite_Variable    ${ssh_user}    ${user}
357     BuiltIn.Set_Suite_Variable    ${ssh_password}    ${password}
358
359 Reopen_ODL_Netconf_Connection
360     [Documentation]    Reopen a closed netconf connection.
361     SSHLibrary.Write
362     ...    sshpass -p ${ssh_password} ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${ssh_user}\@127.0.0.1 -p ${ssh_port} -s netconf
363     ${hello}=    SSHLibrary.Read_Until    ${ODL_NETCONF_PROMPT}
364     SSHLibrary.Switch_Connection    ${ssh_control}
365     ${pid}=    SSHLibrary.Execute_Command    ps -A | grep sshpass | awk '{print $1}'
366     BuiltIn.Set_Suite_Variable    ${ssh_netconf_pid}    ${pid}
367     SSHLibrary.Switch_Connection    ${ssh_netconf}
368     RETURN    ${hello}
369
370 Open_ODL_Netconf_Connection
371     [Documentation]    Open a prepared netconf connecion.
372     ${hello}=    Reopen_ODL_Netconf_Connection
373     ${hello_message}=    Get_Data    hello
374     Transmit_Message    ${hello_message}
375     RETURN    ${hello}
376
377 Transmit_Message
378     [Documentation]    Transmit message to Netconf connection and discard the echo of the message.
379     [Arguments]    ${message}
380     SSHLibrary.Write    ${message}
381     SSHLibrary.Write    ${ODL_NETCONF_PROMPT}
382     SSHLibrary.Read_Until    ${ODL_NETCONF_PROMPT}
383
384 Send_Message
385     [Documentation]    Send message to Netconf connection and get the reply.
386     [Arguments]    ${message}
387     Transmit_Message    ${message}
388     ${reply}=    SSHLibrary.Read_Until    ${ODL_NETCONF_PROMPT}
389     RETURN    ${reply}
390
391 Prepare_For_Search
392     [Documentation]    Prepare the specified string for searching in Netconf connection replies.
393     ...    The string passed to this keyword is coming from a data
394     ...    file which has different end of line conventions than
395     ...    the actual Netconf reply. This keyword patches the string
396     ...    to match what Netconf actually returns.
397     [Arguments]    ${searched_string}
398     ${result}=    BuiltIn.Evaluate    "\\r\\n".join("""${searched_string}""".split("\\n"))
399     RETURN    ${result}
400
401 Load_And_Send_Message
402     [Documentation]    Load a message from the data file set, send it to Netconf and return the reply.
403     [Arguments]    ${name}
404     ${request}=    Get_Data    ${name}-request
405     ${reply}=    Send_Message    ${request}
406     RETURN    ${reply}
407
408 Load_Expected_Reply
409     [Documentation]    Load the expected reply from the data file set and return it.
410     [Arguments]    ${name}
411     ${expected_reply}=    Get_Data    ${name}-reply
412     RETURN    ${expected_reply}
413
414 Abort_ODL_Netconf_Connection
415     [Documentation]    Correctly close the Netconf connection and make sure it is really dead.
416     IF    ${ssh_netconf_pid} == -1    RETURN
417     ${kill_command}=    BuiltIn.Set_Variable    kill ${ssh_netconf_pid}
418     BuiltIn.Set_Suite_Variable    ${ssh_netconf_pid}    -1
419     SSHLibrary.Switch_Connection    ${ssh_control}
420     SSHLibrary.Write    ${kill_command}
421     SSHLibrary.Read_Until_Prompt
422     SSHLibrary.Switch_Connection    ${ssh_netconf}
423     SSHLibrary.Read_Until_Prompt
424
425 Close_ODL_Netconf_Connection_Gracefully
426     Perform_Test    close-session
427     Abort_ODL_Netconf_Connection
428
429 Setup_Everything
430     [Documentation]    Setup resources and create session for Restconf checking.
431     SetupUtils.Setup_Utils_For_Setup_And_Teardown
432     RequestsLibrary.Create_Session    config    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${REST_API}    auth=${AUTH}
433
434 Teardown_Everything
435     [Documentation]    Close the Netconf connection and destroy all sessions in the requests library.
436     Abort_ODL_Netconf_Connection
437     RequestsLibrary.Delete_All_Sessions
438
439 Check_First_Batch_Data
440     [Arguments]    ${reply}    ${keyword}
441     BuiltIn.RunKeyword    ${keyword}    ${reply}    <id>TOY001</id>
442     BuiltIn.RunKeyword    ${keyword}    ${reply}    <id>CUST001</id>
443     BuiltIn.RunKeyword    ${keyword}    ${reply}    <car-id>TOY001</car-id>
444     BuiltIn.RunKeyword    ${keyword}    ${reply}    <person-id>CUST001</person-id>
445
446 Check_First_Batch_Data_Present
447     [Arguments]    ${reply}
448     Check_First_Batch_Data    ${reply}    BuiltIn.Should_Contain
449
450 Check_First_Batch_Data_Not_Present
451     [Arguments]    ${reply}
452     Check_First_Batch_Data    ${reply}    BuiltIn.Should_Not_Contain
453
454 Check_Second_Batch_Data
455     [Arguments]    ${reply}    ${keyword}
456     BuiltIn.RunKeyword    ${keyword}    ${reply}    <id>OLD001</id>
457     BuiltIn.RunKeyword    ${keyword}    ${reply}    <id>CUST002</id>
458     BuiltIn.RunKeyword    ${keyword}    ${reply}    <car-id>OLD001</car-id>
459     BuiltIn.RunKeyword    ${keyword}    ${reply}    <person-id>CUST002</person-id>
460
461 Check_Second_Batch_Data_Present
462     [Arguments]    ${reply}
463     Check_Second_Batch_Data    ${reply}    BuiltIn.Should_Contain
464
465 Check_Multiple_Batch_Data
466     [Arguments]    ${reply}    ${keyword}
467     BuiltIn.RunKeyword    ${keyword}    ${reply}    <id>CAROLD</id>
468     BuiltIn.RunKeyword    ${keyword}    ${reply}    <id>CUSTOLD</id>
469     BuiltIn.RunKeyword    ${keyword}    ${reply}    <car-id>CAROLD</car-id>
470     BuiltIn.RunKeyword    ${keyword}    ${reply}    <person-id>CUSTOLD</person-id>
471     BuiltIn.RunKeyword    ${keyword}    ${reply}    <id>CARYOUNG</id>
472     BuiltIn.RunKeyword    ${keyword}    ${reply}    <id>CUSTYOUNG</id>
473     BuiltIn.RunKeyword    ${keyword}    ${reply}    <car-id>CARYOUNG</car-id>
474     BuiltIn.RunKeyword    ${keyword}    ${reply}    <person-id>CUSTYOUNG</person-id>
475     BuiltIn.RunKeyword    ${keyword}    ${reply}    <id>CARMID</id>
476     BuiltIn.RunKeyword    ${keyword}    ${reply}    <id>CUSTMID</id>
477     BuiltIn.RunKeyword    ${keyword}    ${reply}    <car-id>CARMID</car-id>
478     BuiltIn.RunKeyword    ${keyword}    ${reply}    <person-id>CUSTMID</person-id>
479     BuiltIn.RunKeyword    ${keyword}    ${reply}    <id>CAROLD2</id>
480     BuiltIn.RunKeyword    ${keyword}    ${reply}    <id>CUSTOLD2</id>
481     BuiltIn.RunKeyword    ${keyword}    ${reply}    <car-id>CAROLD2</car-id>
482     BuiltIn.RunKeyword    ${keyword}    ${reply}    <person-id>CUSTOLD2</person-id>
483
484 Check_Multiple_Batch_Data_Absent
485     [Arguments]    ${reply}
486     Check_Multiple_Batch_Data    ${reply}    BuiltIn.Should_not_Contain
487
488 Check_Multiple_Batch_Data_Present
489     [Arguments]    ${reply}
490     Check_Multiple_Batch_Data    ${reply}    BuiltIn.Should_Contain
491
492 Check_Auxiliary_Data
493     [Arguments]    ${reply}    ${keyword}
494     BuiltIn.RunKeyword    ${keyword}    ${reply}    <id>CUSTBAD</id>
495     BuiltIn.RunKeyword    ${keyword}    ${reply}    <id>test</id>
496
497 Check_Test_Objects_Absent
498     [Arguments]    ${reply}
499     Check_First_Batch_Data_Not_Present    ${reply}
500     Check_Second_Batch_Data    ${reply}    BuiltIn.Should_not_Contain
501     Check_Multiple_Batch_Data_Absent    ${reply}
502     Check_Auxiliary_Data    ${reply}    BuiltIn.Should_not_Contain
503     BuiltIn.Should_not_Contain    ${reply}    <id>test</id>
504
505 Check_Test_Objects_Not_Present_In_Config
506     [Documentation]    Use dataset with the specified name to get the configuration and check that none of our test objects are there.
507     [Arguments]    ${name}
508     ${reply}=    Load_And_Send_Message    ${name}
509     Check_Test_Objects_Absent    ${reply}
510     BuiltIn.Should_not_Contain    ${reply}    <id>REPLACE</id>
511     RETURN    ${reply}
512
513 Perform_Test
514     [Documentation]    Load and send the request from the dataset and compare the returned reply to the one stored in the dataset.
515     [Arguments]    ${name}
516     ${actual}=    Load_And_Send_Message    ${name}
517     ${expected}=    Load_Expected_Reply    ${name}
518     ${actual}=    String.Remove String    ${actual}    ]]>]]>
519     ${actual}=    String.Strip String    ${actual}    mode=both
520     XML.Elements Should Be Equal    ${actual}    ${expected}    normalize_whitespace=True
521     RETURN    ${actual}
522
523 Send_And_Check
524     [Arguments]    ${name}    ${expected}
525     ${actual}=    Load_And_Send_Message    ${name}
526     BuiltIn.Should_Be_Equal    ${expected}    ${actual}