X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Fsuites%2Fnetconf%2FMDSAL%2Fnorthbound.robot;h=e3dc825470ec2b08a269a29cd4b4d2aa40cc04b7;hb=955afa35efdd87b0fb9da6c8bf7327302f15bba9;hp=cc96256647d65baa77d3551f15b4d21c43445596;hpb=19f787af8093a4eb590fa2d3ff3b483cb657e716;p=integration%2Ftest.git diff --git a/csit/suites/netconf/MDSAL/northbound.robot b/csit/suites/netconf/MDSAL/northbound.robot index cc96256647..e3dc825470 100644 --- a/csit/suites/netconf/MDSAL/northbound.robot +++ b/csit/suites/netconf/MDSAL/northbound.robot @@ -21,10 +21,17 @@ Documentation Metconf MDSAL Northbound test suite. ... for simplicity. ... ... TODO: Change the 4 testcases to use unique message IDs. +... +... TODO: There are many sections with too many "Should_[Not_]Contain" keyword +... invocations (see Check_Multiple_Modules_Merge_Replace for a particularly bad +... example). Create a resource that will be able to extract the data from the +... requests and search for them in the response, then convert to usage of this +... resource (think "Thou shall not repeat yourself"). The following resource was +... found when doing research on this: +... http://robotframework.org/robotframework/latest/libraries/XML.html Suite Setup Setup_Everything Suite Teardown Teardown_Everything -Test Setup SetupUtils.Setup_Test_With_Logging_And_Fast_Failing -Test Teardown FailFast.Start_Failing_Fast_If_This_Failed +Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing Library RequestsLibrary Library SSHLibrary Resource ${CURDIR}/../../../libraries/FailFast.robot @@ -61,9 +68,19 @@ Additional_Attributes_In_Message BuiltIn.Should_Contain ${reply} additional="otherthing" BuiltIn.Should_Contain ${reply} xmlns:prefix="http://www.example.com/my-schema-example.html" -Edit_Config_Modules_Merge +Send_Stuff_In_Undefined_Namespace + [Documentation] Try to send something within an undefined namespace and check the reply complains about the nonexistent namespace and element. + ${reply}= Load_And_Send_Message merge-nonexistent-namespace + BuiltIn.Set_Test_Variable ${bugno} 5125 + BuiltIn.Should_Not_Contain ${reply} java.lang.NullPointerException + BuiltIn.Set_Test_Variable ${bugno} ${EMPTY} + BuiltIn.Should_Contain ${reply} urn:this:is:in:a:nonexistent:namespace + BuiltIn.Should_Contain ${reply} + [Teardown] BuiltIn.Run_Keyword_If '${bugno}' != '${EMPTY}' Utils.Report_Failure_Due_To_Bug 5125 + +Edit_Config_First_Batch_Merge [Documentation] Request a "merge" operation adding an element in candidate configuration and check the reply. - Perform_Test config-modules-merge-1 + Perform_Test merge-1 Get_Config_Running_To_Confirm_No_Edit_Before_Commit [Documentation] Make sure the running configuration is still unchanged as the change was not commited yet. @@ -73,51 +90,36 @@ Commit_Edit [Documentation] Commit the change and check the reply. Perform_Test commit-edit -name0_In_Config_Running_To_Confirm_Edit_After_Commit +First_Batch_In_Config_Running_To_Confirm_Edit_After_Commit [Documentation] Check that the change is now in the configuration. ${reply}= Load_And_Send_Message get-config-edit-after-commit - BuiltIn.Should_Contain ${reply} name0 - -name0_In_Config_Modules_Via_Restconf - [Documentation] Check that the change is also visible through Restconf. - ${data}= Utils.Get_Data_From_URI config config:modules headers=${ACCEPT_XML} - BuiltIn.Should_Contain ${data} name0 + Check_First_Batch_Data_Present ${reply} Terminate_Connection_Gracefully [Documentation] Close the session and disconnect. Close_ODL_Netconf_Connection_Gracefully -name0_In_Config_Modules_Via_Restconf_After_Disconnect - [Documentation] Check that the change is still visible through Restconf after Netconf disconnect. - ${data}= Utils.Get_Data_From_URI config config:modules headers=${ACCEPT_XML} - BuiltIn.Should_Contain ${data} name0 - Reconnect_To_ODL_Netconf_After_Graceful_Session_End [Documentation] Reconnect to ODL Netconf and fail if that is not possible. Open_ODL_Netconf_Connection -name0_In_Config_Running_After_Reconnect +First_Batch_In_Config_Running_After_Reconnect [Documentation] Check that the change is now in the configuration. ${reply}= Load_And_Send_Message get-config-edit-after-commit - BuiltIn.Should_Contain ${reply} name0 - -name0_In_Config_Modules_Via_Restconf_After_Reconnect - [Documentation] Check that the change is still visible through Restconf after Netconf reconnect. - ${data}= Utils.Get_Data_From_URI config config:modules headers=${ACCEPT_XML} - BuiltIn.Should_Contain ${data} name0 + Check_First_Batch_Data_Present ${reply} -Edit_Config_Modules_Create_Shall_Fail_Now +Edit_Config_Create_Shall_Fail_Now [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"). - Perform_Test config-modules-create + Perform_Test create -Delete_Modules +Delete_First_Batch [Documentation] Delete the created element from the candidate configuration and check the reply. - Perform_Test config-modules-delete + Perform_Test delete Get_Config_Running_To_Confirm_No_Delete_Before_Commit [Documentation] Make sure the element is still present in the running configuration as the delete command was not committed yet. ${reply}= Load_And_Send_Message get-config-no-delete-before-commit - BuiltIn.Should_Contain ${reply} name0 + Check_First_Batch_Data_Present ${reply} Commit_Delete [Documentation] Commit the deletion of the element and check the reply. @@ -127,24 +129,20 @@ Get_Config_Running_To_Confirm_Delete_After_Commit [Documentation] Check that the element is gone. Check_Test_Objects_Not_Present_In_Config get-config-delete-after-commit -Restconf_Get_Modules_Shall_Return_404 - [Documentation] Check that "Not Found" is returned when Restconf is asked for the deleted element. - ${response}= RequestsLibrary.Get config config:modules ${ACCEPT_XML} - BuiltIn.Should_Be_Equal_As_Strings ${response.status_code} 404 - Commit_No_Transaction - [Documentation] Attempt to perform "commit" when there are no changes in the candidate configuration and check that it fails with the correct error. - Test_Commit_With_No_Transactions + [Documentation] Attempt to perform "commit" when there are no changes in the candidate configuration and check that it returns OK status. + Perform_Test commit-no-transaction + [Teardown] Utils.Report_Failure_Due_To_Bug 4455 -Edit_Config_Another_Modules_Merge_For_Discard +Edit_Config_Second_Batch_Merge [Documentation] Create an element to be discarded and check the reply. - Perform_Test config-modules-merge-2 + Perform_Test merge-2 Get_And_Check_Config_Candidate_For_Discard [Documentation] Check that the element to be discarded is present in the candidate configuration. ${reply}= Load_And_Send_Message get-config-candidate - BuiltIn.Should_Contain ${reply} name1 - BuiltIn.Should_Not_Contain ${reply} name0 + Check_First_Batch_Data_Not_Present ${reply} + Check_Second_Batch_Data_Present ${reply} Discard_Changes_Using_Discard_Request [Documentation] Ask the server to discard the candidate and check the reply. @@ -154,59 +152,45 @@ Get_And_Check_Config_Candidate_To_Confirm_Discard [Documentation] Check that the element was really discarded. Check_Test_Objects_Not_Present_In_Config get-config-candidate-discard -Edit_Config_Modules_Multiple_Modules_Merge_1 - [Documentation] Create the element with "name2" subelement again and check the reply. +Edit_Config_Multiple_Batch_Merge_Create + [Documentation] Use a create request with the third batch to create the infrastructure. + Perform_Test merge-multiple-create + +Edit_Config_Multiple_Batch_Merge_Third + [Documentation] Use a create request with the third batch to create the infrastructure. Perform_Test merge-multiple-1 -Edit_Config_Modules_Multiple_Modules_Merge_2 - [Documentation] Add a "name3" subelement to the element and check the reply. +Edit_Config_Multiple_Batch_Merge_Fourth + [Documentation] Use a merge request with the third batch to create the infrastructure. Perform_Test merge-multiple-2 -Edit_Config_Modules_Multiple_Modules_Merge_3 +Edit_Config_Multiple_Batch_Merge_Fifth [Documentation] Add a "name4" subelement to the element and check the reply. Perform_Test merge-multiple-3 -Commit_Multiple_Modules_Merge +Commit_Multiple_Merge [Documentation] Commit the changes and check the reply. Perform_Test merge-multiple-commit -name2_name3_name4_In_Running_Config +Multiple_Batch_Data_In_Running_Config [Documentation] Check that the 3 subelements are now present in the running configuration. ${reply}= Load_And_Send_Message merge-multiple-check - BuiltIn.Should_Contain ${reply} name2 - BuiltIn.Should_Contain ${reply} name3 - BuiltIn.Should_Contain ${reply} name4 - -name2_name3_name4_In_Config_Modules_Via_Restconf - [Documentation] Check that the 3 subelements are visible via Restconf. - ${data}= Utils.Get_Data_From_URI config config:modules headers=${ACCEPT_XML} - BuiltIn.Should_Contain ${data} name2 - BuiltIn.Should_Contain ${data} name3 - BuiltIn.Should_Contain ${data} name4 + Check_Multiple_Batch_Data_Present ${reply} Abort_Connection_To_Simulate_Session_Failure [Documentation] Simulate session failure by disconnecting without terminating the session. Abort_ODL_Netconf_Connection -name2_name3_name4_In_Config_Modules_Via_Restconf_After_Session_Fail - [Documentation] Check that the 3 subelements are visible via Restconf. - ${data}= Utils.Get_Data_From_URI config config:modules headers=${ACCEPT_XML} - BuiltIn.Should_Contain ${data} name2 - BuiltIn.Should_Contain ${data} name3 - BuiltIn.Should_Contain ${data} name4 - Reconnect_To_ODL_Netconf_After_Session_Failure [Documentation] Reconnect to ODL Netconf and fail if that is not possible. Open_ODL_Netconf_Connection -name2_name3_name4_In_Running_Config_After_Session_Failure +Multiple_Batch_Data_In_Running_Config_After_Session_Failure [Documentation] Check that the 3 subelements are now present in the running configuration. ${reply}= Load_And_Send_Message merge-multiple-check - BuiltIn.Should_Contain ${reply} name2 - BuiltIn.Should_Contain ${reply} name3 - BuiltIn.Should_Contain ${reply} name4 + Check_Multiple_Batch_Data_Present ${reply} -Edit_Multiple_Modules_Merge +Edit_Multiple_Merge_Data [Documentation] Add another subelement named "test" to the element and check the reply. Perform_Test merge-multiple-edit @@ -217,7 +201,10 @@ Commit_Multiple_Modules_Merge_Edit Check_Multiple_Modules_Merge_Edit [Documentation] Check that the "test" subelement exists and has correct value for "port" subelement. ${reply}= Load_And_Send_Message merge-multiple-edit-check - BuiltIn.Should_Contain ${reply} 2022 + BuiltIn.Should_Contain ${reply} test + BuiltIn.Should_Contain ${reply} Dixi + BuiltIn.Should_Contain ${reply} BMW + BuiltIn.Should_Contain ${reply} 1928 Update_Multiple_Modules_Merge [Documentation] Update the value of the "port" subelement of the "test" subelement and check the reply. @@ -230,7 +217,13 @@ Commit_Multiple_Modules_Merge_Update Check_Multiple_Modules_Merge_Update [Documentation] Check that the value of the "port" was really updated. ${reply}= Load_And_Send_Message merge-multiple-update-check - BuiltIn.Should_Contain ${reply} 3000 + BuiltIn.Should_Contain ${reply} test + BuiltIn.Should_Contain ${reply} Bentley Speed Six + BuiltIn.Should_Contain ${reply} Bentley + BuiltIn.Should_Contain ${reply} 1930 + BuiltIn.Should_Not_Contain ${reply} Dixi + BuiltIn.Should_Not_Contain ${reply} BMW + BuiltIn.Should_Not_Contain ${reply} 1928 Replace_Multiple_Modules_Merge [Documentation] Replace the content of the "test" with another completely different and check the reply. @@ -243,33 +236,53 @@ Commit_Multiple_Modules_Merge_Replace Check_Multiple_Modules_Merge_Replace [Documentation] Check that the new content is there and the old content is gone. ${reply}= Load_And_Send_Message merge-multiple-replace-check - BuiltIn.Should_Contain ${reply} test - BuiltIn.Should_Contain ${reply}
10.194.132.42
- BuiltIn.Should_Contain ${reply} false - BuiltIn.Should_Contain ${reply} 4000 - BuiltIn.Should_Contain ${reply} admin - BuiltIn.Should_Contain ${reply} admin - BuiltIn.Should_Not_Contain ${reply} global-event-executor - BuiltIn.Should_Not_Contain ${reply} binding-osgi-broker - BuiltIn.Should_Not_Contain ${reply} dom-broker - BuiltIn.Should_Not_Contain ${reply} global-netconf-dispatcher - BuiltIn.Should_Not_Contain ${reply} global-netconf-processing-executor - -Remove_Multiple_Modules - [Documentation] Remove the testing "module" element and all its subelements and check the reply. + BuiltIn.Should_Contain ${reply} REPLACE + BuiltIn.Should_Contain ${reply} FIAT + BuiltIn.Should_Contain ${reply} Panda + BuiltIn.Should_Contain ${reply} 2003 + BuiltIn.Should_Contain ${reply} REPLACE + BuiltIn.Should_Not_Contain ${reply} TOY001 + BuiltIn.Should_Not_Contain ${reply} CUST001 + BuiltIn.Should_Not_Contain ${reply} TOY001 + BuiltIn.Should_Not_Contain ${reply} CUST001 + BuiltIn.Should_Not_Contain ${reply} OLD001 + BuiltIn.Should_Not_Contain ${reply} CUST002 + BuiltIn.Should_Not_Contain ${reply} OLD001 + BuiltIn.Should_Not_Contain ${reply} CUST002 + BuiltIn.Should_Not_Contain ${reply} CAROLD + BuiltIn.Should_Contain ${reply} CUSTOLD + BuiltIn.Should_Not_Contain ${reply} CAROLD + BuiltIn.Should_Not_Contain ${reply} CUSTOLD + BuiltIn.Should_Not_Contain ${reply} CARYOUNG + BuiltIn.Should_Contain ${reply} CUSTYOUNG + BuiltIn.Should_Not_Contain ${reply} CARYOUNG + BuiltIn.Should_Contain ${reply} CUSTYOUNG + BuiltIn.Should_Not_Contain ${reply} CARMID + BuiltIn.Should_Contain ${reply} CUSTMID + BuiltIn.Should_Not_Contain ${reply} CARMID + BuiltIn.Should_Not_Contain ${reply} CUSTMID + BuiltIn.Should_Not_Contain ${reply} CAROLD2 + BuiltIn.Should_Contain ${reply} CUSTOLD2 + BuiltIn.Should_Not_Contain ${reply} CAROLD2 + BuiltIn.Should_Not_Contain ${reply} CUSTOLD2 + BuiltIn.Should_Not_Contain ${reply} CUSTBAD + BuiltIn.Should_Not_Contain ${reply} test + +Remove_Test_Data + [Documentation] Remove the testing elements and all their subelements and check the reply. Perform_Test merge-multiple-remove -Commit_Multiple_Modules_Removal +Commit_Test_Data_Removal [Documentation] Commit the removal and check the reply. Perform_Test merge-multiple-remove-commit -Delete_Not_Existing_Module - [Documentation] Attempt to delete the "module" element again and check that it fails with the correct error. +Delete_Not_Existing_Element + [Documentation] Attempt to delete the elements again and check that it fails with the correct error. Perform_Test delete-not-existing Commit_Delete_Not_Existing_Module [Documentation] Attempt to commit and check the reply. - Test_Commit_With_No_Transactions + Perform_Test commit-no-transaction [Teardown] Utils.Report_Failure_Due_To_Bug 4455 Remove_Not_Existing_Module @@ -279,6 +292,7 @@ Remove_Not_Existing_Module Commit_Remove_Not_Existing_Module [Documentation] Attempt to commit and check the reply. Perform_Test remove-not-existing-commit + [Teardown] Utils.Report_Failure_Due_To_Bug 4455 Close_Session [Documentation] Close the session and check that it was closed properly. @@ -397,15 +411,79 @@ Teardown_Everything Abort_ODL_Netconf_Connection RequestsLibrary.Delete_All_Sessions +Check_First_Batch_Data + [Arguments] ${reply} ${keyword} + BuiltIn.RunKeyword ${keyword} ${reply} TOY001 + BuiltIn.RunKeyword ${keyword} ${reply} CUST001 + BuiltIn.RunKeyword ${keyword} ${reply} TOY001 + BuiltIn.RunKeyword ${keyword} ${reply} CUST001 + +Check_First_Batch_Data_Present + [Arguments] ${reply} + Check_First_Batch_Data ${reply} BuiltIn.Should_Contain + +Check_First_Batch_Data_Not_Present + [Arguments] ${reply} + Check_First_Batch_Data ${reply} BuiltIn.Should_Not_Contain + +Check_Second_Batch_Data + [Arguments] ${reply} ${keyword} + BuiltIn.RunKeyword ${keyword} ${reply} OLD001 + BuiltIn.RunKeyword ${keyword} ${reply} CUST002 + BuiltIn.RunKeyword ${keyword} ${reply} OLD001 + BuiltIn.RunKeyword ${keyword} ${reply} CUST002 + +Check_Second_Batch_Data_Present + [Arguments] ${reply} + Check_Second_Batch_Data ${reply} BuiltIn.Should_Contain + +Check_Multiple_Batch_Data + [Arguments] ${reply} ${keyword} + BuiltIn.RunKeyword ${keyword} ${reply} CAROLD + BuiltIn.RunKeyword ${keyword} ${reply} CUSTOLD + BuiltIn.RunKeyword ${keyword} ${reply} CAROLD + BuiltIn.RunKeyword ${keyword} ${reply} CUSTOLD + BuiltIn.RunKeyword ${keyword} ${reply} CARYOUNG + BuiltIn.RunKeyword ${keyword} ${reply} CUSTYOUNG + BuiltIn.RunKeyword ${keyword} ${reply} CARYOUNG + BuiltIn.RunKeyword ${keyword} ${reply} CUSTYOUNG + BuiltIn.RunKeyword ${keyword} ${reply} CARMID + BuiltIn.RunKeyword ${keyword} ${reply} CUSTMID + BuiltIn.RunKeyword ${keyword} ${reply} CARMID + BuiltIn.RunKeyword ${keyword} ${reply} CUSTMID + BuiltIn.RunKeyword ${keyword} ${reply} CAROLD2 + BuiltIn.RunKeyword ${keyword} ${reply} CUSTOLD2 + BuiltIn.RunKeyword ${keyword} ${reply} CAROLD2 + BuiltIn.RunKeyword ${keyword} ${reply} CUSTOLD2 + +Check_Multiple_Batch_Data_Absent + [Arguments] ${reply} + Check_Multiple_Batch_Data ${reply} BuiltIn.Should_not_Contain + +Check_Multiple_Batch_Data_Present + [Arguments] ${reply} + Check_Multiple_Batch_Data ${reply} BuiltIn.Should_Contain + +Check_Auxiliary_Data + [Arguments] ${reply} ${keyword} + BuiltIn.RunKeyword ${keyword} ${reply} CUSTBAD + BuiltIn.RunKeyword ${keyword} ${reply} test + +Check_Test_Objects_Absent + [Arguments] ${reply} + Check_First_Batch_Data_Not_Present ${reply} + Check_Second_Batch_Data ${reply} BuiltIn.Should_not_Contain + Check_Multiple_Batch_Data_Absent ${reply} + Check_Auxiliary_Data ${reply} BuiltIn.Should_not_Contain + BuiltIn.Should_not_Contain ${reply} test + Check_Test_Objects_Not_Present_In_Config [Arguments] ${name} [Documentation] Use dataset with the specified name to get the configuration and check that none of our test objects are there. ${reply}= Load_And_Send_Message ${name} - BuiltIn.Should_Not_Contain ${reply} name0 - BuiltIn.Should_Not_Contain ${reply} name1 - BuiltIn.Should_Not_Contain ${reply} name2 - BuiltIn.Should_Not_Contain ${reply} name3 - BuiltIn.Should_Not_Contain ${reply} name4 + Check_Test_Objects_Absent ${reply} + BuiltIn.Should_not_Contain ${reply} REPLACE + [Return] ${reply} Perform_Test [Arguments] ${name} @@ -413,16 +491,10 @@ Perform_Test ${actual}= Load_And_Send_Message ${name} ${expected}= Load_Expected_Reply ${name} ${newline}= BuiltIn.Evaluate "\\r\\n" - BuiltIn.Should_Be_Equal ${actual} ${newline}${expected}${ODL_NETCONF_PROMPT} + BuiltIn.Should_Be_Equal ${newline}${expected}${ODL_NETCONF_PROMPT} ${actual} [Return] ${actual} Send_And_Check [Arguments] ${name} ${expected} ${actual}= Load_And_Send_Message ${name} - BuiltIn.Should_Be_Equal ${actual} ${expected} - -Test_Commit_With_No_Transactions - [Documentation] Issue a "commit" RPC request and check that it fails with "No current transactions" error. - ${reply}= Load_And_Send_Message commit-no-transaction - ${expected}= Load_Expected_Reply commit-no-transaction - BuiltIn.Should_Contain ${reply} ${expected} + BuiltIn.Should_Be_Equal ${expected} ${actual}