diff options
Diffstat (limited to 'csit')
-rwxr-xr-x | csit/prepare-csit.sh | 2 | ||||
-rw-r--r-- | csit/pylibs.txt | 2 | ||||
-rw-r--r-- | csit/tests/cps-data-operations/cps-data-operations.robot | 12 | ||||
-rw-r--r-- | csit/tests/cps-data-sync/cps-data-sync.robot | 14 | ||||
-rw-r--r-- | csit/tests/cps-model-sync/cps-model-sync.robot | 30 |
5 files changed, 41 insertions, 19 deletions
diff --git a/csit/prepare-csit.sh b/csit/prepare-csit.sh index fbd5dc5f0d..1b8578e0ce 100755 --- a/csit/prepare-csit.sh +++ b/csit/prepare-csit.sh @@ -71,7 +71,7 @@ echo "Versioning information:" python3 --version echo "Installing confluent kafka library for robot framework:" -pip install robotframework-confluentkafkalibrary +pip install robotframework-confluentkafkalibrary==2.4.0-2 pip freeze python3 -m robot.run --version || :
\ No newline at end of file diff --git a/csit/pylibs.txt b/csit/pylibs.txt index 32bfa6faca..3eeb1ab9ec 100644 --- a/csit/pylibs.txt +++ b/csit/pylibs.txt @@ -9,7 +9,7 @@ robotframework-requests==0.9.3 robotframework-selenium2library==3.0.0 robotframework-extendedselenium2library robotframework-sshlibrary -robotframework-confluentkafkalibrary +robotframework-confluentkafkalibrary==2.4.0-2 scapy # Module jsonpath is needed by current AAA idmlite suite. jsonpath-rw diff --git a/csit/tests/cps-data-operations/cps-data-operations.robot b/csit/tests/cps-data-operations/cps-data-operations.robot index 85e8a2a857..96212ff632 100644 --- a/csit/tests/cps-data-operations/cps-data-operations.robot +++ b/csit/tests/cps-data-operations/cps-data-operations.robot @@ -26,6 +26,7 @@ Library OperatingSystem Library RequestsLibrary Library BuiltIn Library ConfluentKafkaLibrary +Library String Suite Setup Create Session CPS_URL http://${CPS_CORE_HOST}:${CPS_CORE_PORT} @@ -63,8 +64,7 @@ Consume cloud event from client topic Compare Header Values ${header_key_value_pair[0]} ${header_key_value_pair[1]} "ce_specversion" "1.0" Compare Header Values ${header_key_value_pair[0]} ${header_key_value_pair[1]} "ce_type" "org.onap.cps.ncmp.events.async1_0_0.DataOperationEvent" Compare Header Values ${header_key_value_pair[0]} ${header_key_value_pair[1]} "ce_correlationid" "${expectedRequestId}" - # Need to check the root cause of this failure. To be investigated separately as part of CPS-2363 - # Compare Header Values ${header_key_value_pair[0]} ${header_key_value_pair[1]} "ce_source" "DMI" + Compare Header Values ${header_key_value_pair[0]} ${header_key_value_pair[1]} "ce_source" "DMI" END [Teardown] Basic Teardown ${group_id} @@ -79,12 +79,20 @@ Is CM Handle READY [Arguments] ${uri} ${headers} ${cmHandle} ${response}= GET On Session CPS_URL ${uri} headers=${headers} Should Be Equal As Strings ${response.status_code} 200 + ${number_of_items}= Count Items In JSON Response ${response} + Should Be True ${number_of_items} > 0 FOR ${item} IN ${response.json()} IF "${item['cmHandle']}" == "${cmHandle}" Should Be Equal As Strings ${item['state']['cmHandleState']} READY END END +Count Items In JSON Response + [Arguments] ${response} + ${json_data}= Evaluate json.loads('${response.content.decode("utf-8")}') json + ${number_of_items}= Get Length ${json_data} + RETURN ${number_of_items} + Basic Teardown [Arguments] ${group_id} Unsubscribe ${group_id} diff --git a/csit/tests/cps-data-sync/cps-data-sync.robot b/csit/tests/cps-data-sync/cps-data-sync.robot index 6fc1876421..b8ba479e7c 100644 --- a/csit/tests/cps-data-sync/cps-data-sync.robot +++ b/csit/tests/cps-data-sync/cps-data-sync.robot @@ -35,11 +35,6 @@ ${ncmpBasePath} /ncmp *** Test Cases *** -Check if ietfYang-PNFDemo is READY - ${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo - ${headers}= Create Dictionary Authorization=${auth} - Wait Until Keyword Succeeds 20sec 200ms Is CM Handle READY ${uri} ${headers} ietfYang-PNFDemo - Operational state goes to UNSYNCHRONIZED when data sync (flag) is enabled ${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/data-sync ${params}= Create Dictionary dataSyncEnabled=true @@ -57,15 +52,6 @@ Operational state goes to SYNCHRONIZED after sometime when data sync (flag) is e Wait Until Keyword Succeeds 40sec 100ms Is CM Handle State SYNCHRONIZED ${uri} ${headers} *** Keywords *** -Is CM Handle READY - [Arguments] ${uri} ${headers} ${cmHandle} - ${response}= GET On Session CPS_URL ${uri} headers=${headers} - Should Be Equal As Strings ${response.status_code} 200 - FOR ${item} IN ${response.json()} - IF "${item['cmHandle']}" == "${cmHandle}" - Should Be Equal As Strings ${item['state']['cmHandleState']} READY - END - END Is CM Handle State SYNCHRONIZED [Arguments] ${uri} ${headers} diff --git a/csit/tests/cps-model-sync/cps-model-sync.robot b/csit/tests/cps-model-sync/cps-model-sync.robot index bb881f6a67..514076f085 100644 --- a/csit/tests/cps-model-sync/cps-model-sync.robot +++ b/csit/tests/cps-model-sync/cps-model-sync.robot @@ -25,6 +25,7 @@ Library Collections Library OperatingSystem Library RequestsLibrary Library BuiltIn +Library String Suite Setup Create Session CPS_URL http://${CPS_CORE_HOST}:${CPS_CORE_PORT} @@ -88,13 +89,40 @@ Get cm handle details and confirm it has been deleted ${headers}= Create Dictionary Authorization=${auth} ${response}= GET On Session CPS_URL ${uri} headers=${headers} expected_status=404 +Check if ietfYang-PNFDemo is READY + ${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo + ${headers}= Create Dictionary Authorization=${auth} + Wait Until Keyword Succeeds 20sec 200ms Is CM Handle READY ${uri} ${headers} ietfYang-PNFDemo + Get modules for registered data node ${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/modules ${headers}= Create Dictionary Authorization=${auth} ${response}= GET On Session CPS_URL ${uri} headers=${headers} Should Be Equal As Strings ${response.status_code} 200 + ${number_of_items}= Count Items In JSON Response ${response} + Should Be True ${number_of_items} > 0 FOR ${item} IN @{response.json()} IF "${item['moduleName']}" == "stores" Should Be Equal As Strings "${item['revision']}" "2020-09-15" END - END
\ No newline at end of file + END + +*** Keywords *** + +Is CM Handle READY + [Arguments] ${uri} ${headers} ${cmHandle} + ${response}= GET On Session CPS_URL ${uri} headers=${headers} + Should Be Equal As Strings ${response.status_code} 200 + ${number_of_items}= Count Items In JSON Response ${response} + Should Be True ${number_of_items} > 0 + FOR ${item} IN ${response.json()} + IF "${item['cmHandle']}" == "${cmHandle}" + Should Be Equal As Strings ${item['state']['cmHandleState']} READY + END + END + +Count Items In JSON Response + [Arguments] ${response} + ${json_data}= Evaluate json.loads('${response.content.decode("utf-8")}') json + ${number_of_items}= Get Length ${json_data} + RETURN ${number_of_items}
\ No newline at end of file |