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