diff options
Diffstat (limited to 'csit')
4 files changed, 11 insertions, 116 deletions
diff --git a/csit/data/subscription-notification/cmSubscriptionNcmpOutEventForCsit.json b/csit/data/subscription-notification/cmSubscriptionNcmpOutEventForCsit.json deleted file mode 100644 index 71fee37b22..0000000000 --- a/csit/data/subscription-notification/cmSubscriptionNcmpOutEventForCsit.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data":{ - "statusCode":1, - "statusMessage":"successfully applied subscription", - "additionalInfo":{ - "rejected":[], - "pending":[] - } - } -}
\ No newline at end of file diff --git a/csit/plans/cps/testplanNcmp.txt b/csit/plans/cps/testplanNcmp.txt index 81c5468618..e80f0d98a0 100644 --- a/csit/plans/cps/testplanNcmp.txt +++ b/csit/plans/cps/testplanNcmp.txt @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2023 Nordix Foundation +# Copyright (C) 2023-2024 Nordix Foundation # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ # Place the suites in run order. cps-model-sync cps-data-sync -cps-subscriptions ncmp-passthrough cm-handle-query cps-trust-level diff --git a/csit/tests/cps-subscriptions/cps-subscription-notification.robot b/csit/tests/cps-subscriptions/cps-subscription-notification.robot deleted file mode 100644 index 2d5152a290..0000000000 --- a/csit/tests/cps-subscriptions/cps-subscription-notification.robot +++ /dev/null @@ -1,90 +0,0 @@ -# ============LICENSE_START======================================================= -# Copyright (C) 2023 Nordix Foundation. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 -# ============LICENSE_END========================================================= - - -*** Settings *** -Library ConfluentKafkaLibrary -Library Collections -Library OperatingSystem -Library RequestsLibrary - -Suite Setup Starting Test - -*** Variables *** - -${auth} Basic Y3BzdXNlcjpjcHNyMGNrcyE= -${basePath} /ncmpInventory/v1/ch - - -*** Test Cases *** -Create CM Handle - Create Session CPS_URL http://${CPS_CORE_HOST}:${CPS_CORE_PORT} - ${headers} Create Dictionary Content-Type=application/json Authorization=${auth} - ${jsonData}= Get Binary File ${DATADIR_SUBS_NOTIFICATION}${/}createCmHandleRequestBody.json - ${response}= POST On Session CPS_URL ${basePath} headers=${headers} data=${jsonData} - Should Be Equal As Strings ${response.status_code} 200 - Sleep 5 wait some time to get updated in the db - -Verify Kafka flow for Subscription Creation Notification - ${group_id}= Create Consumer - Subscribe Topic group_id=${group_id} topics=${RESPONSE_TOPIC} - Wait Until Keyword Succeeds 10x 3s All Messages Are Produced and Consumed ${group_id} - [Teardown] Basic Teardown ${group_id} - -*** Keywords *** -Starting Test - Set Suite Variable ${REQUEST_TOPIC} subscription - Set Suite Variable ${RESPONSE_TOPIC} subscription-response - ${ncmpOutEventJson}= Get File ${DATADIR_SUBS_NOTIFICATION}${/}cmSubscriptionNcmpOutEventForCsit.json - ${ncmpOutEventJson}= Evaluate json.loads("""${ncmpOutEventJson}""") json - Set Suite Variable ${ncmpOutEventJsonGlobal} ${ncmpOutEventJson} - ${thread}= Start Consumer Threaded topics=test - Set Suite Variable ${MAIN_THREAD} ${thread} - ${producer_group_id}= Create Producer - Set Suite Variable ${PRODUCER_ID} ${producer_group_id} - ${ncmpInEventJson}= Get File ${DATADIR_SUBS_NOTIFICATION}${/}cmSubscriptionNcmpInEventForCsit.json encoding=UTF-8 - Set Suite Variable ${ncmpInEventJsonGlobal} ${ncmpInEventJson} - ${headers}= Create Dictionary ce_specversion=1.0 ce_id=some-event-id ce_source=some-resource ce_type=subscriptionCreated ce_correlationid=test-cmhandle1 - Set Suite Variable ${headersGlobal} ${headers} - -All Messages Are Produced and Consumed - [Arguments] ${GROUP_ID} - Produce group_id=${PRODUCER_ID} topic=${REQUEST_TOPIC} value=${ncmpInEventJsonGlobal} headers=${headersGlobal} - Sleep 10sec - ${result}= Poll group_id=${GROUP_ID} only_value=False - ${headers} Set Variable ${result[0].headers()} - ${value} Set Variable ${result[0].value()} - ${valueAsDict}= Evaluate json.loads("""${value}""") json - FOR ${header_key_value_pair} IN @{headers} - 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_source" "NCMP" - Compare Header Values ${header_key_value_pair[0]} ${header_key_value_pair[1]} "ce_type" "subscriptionCreatedStatus" - Compare Header Values ${header_key_value_pair[0]} ${header_key_value_pair[1]} "ce_correlationid" "SCO-9989752cm-subscription-001" - END - Dictionaries Should Be Equal ${valueAsDict} ${ncmpOutEventJsonGlobal} - -Compare Header Values - [Arguments] ${header_key} ${header_value} ${header_to_check} ${expected_header_value} - IF "${header_key}" == ${header_to_check} - Should Be Equal As Strings "${header_value}" ${expected_header_value} - END - -Basic Teardown - [Arguments] ${group_id} - Unsubscribe ${group_id} - Close Consumer ${group_id}
\ No newline at end of file diff --git a/csit/tests/cps-trust-level/cps-trust-level.robot b/csit/tests/cps-trust-level/cps-trust-level.robot index 5a16a343e9..70659000cf 100644 --- a/csit/tests/cps-trust-level/cps-trust-level.robot +++ b/csit/tests/cps-trust-level/cps-trust-level.robot @@ -37,17 +37,18 @@ ${dmiUrl} http://${DMI_HOST}:${DMI_PORT} ${jsonCreateCmHandles} {"dmiPlugin":"${dmiUrl}","dmiDataPlugin":"","dmiModelPlugin":"","createdCmHandles":[{"trustLevel":"COMPLETE","cmHandle":"CH-1"},{"trustLevel":"COMPLETE","cmHandle":"CH-2"},{"cmHandle":"CH-3"},{"trustLevel":"NONE","cmHandle":"CH-4"}]} ${jsonTrustLevelPropertyQueryParameters} {"cmHandleQueryParameters": [{"conditionName": "cmHandleWithTrustLevel", "conditionParameters": [ {"trustLevel": "COMPLETE"} ] }]} ${jsonTrustLevelQueryResponse} {"data":{"attributeValueChange":[{"attributeName":"trustLevel","newAttributeValue":"NONE"}]}} -${partitionId} ${0} *** Test Cases *** -Register data node and verify notification - ${group_id}= Create Consumer - ${topic_partition}= Create Topic Partition cm-events ${partitionId} - ${offset}= Get Watermark Offsets ${group_id} ${topic_partition} - ${tp}= Create Topic Partition cm-events ${partitionId} ${offset[1]} - Assign To Topic Partition ${group_id} ${tp} - Sleep 5sec - Register Data Nodes +Register data node + ${uri}= Set Variable ${ncmpInventoryBasePath}/v1/ch + ${headers}= Create Dictionary Content-Type=application/json Authorization=${auth} + ${response}= POST On Session CPS_URL ${uri} headers=${headers} data=${jsonCreateCmHandles} + Should Be Equal As Strings ${response.status_code} 200 + Sleep 5 + +Verify notification + ${group_id}= Create Consumer auto_offset_reset=earliest + Subscribe Topic topics=cm-events group_id=${group_id} ${result}= Poll group_id=${group_id} only_value=False poll_attempts=5 ${headers} Set Variable ${result[0].headers()} ${payload} Set Variable ${result[0].value()} @@ -72,11 +73,6 @@ Retrieve CM Handle ids where query parameters Match (trust level query) Should Not Contain ${responseJson} CH-4 *** Keywords *** -Register Data Nodes - ${uri}= Set Variable ${ncmpInventoryBasePath}/v1/ch - ${headers}= Create Dictionary Content-Type=application/json Authorization=${auth} - ${response}= POST On Session CPS_URL ${uri} headers=${headers} data=${jsonCreateCmHandles} - Should Be Equal As Strings ${response.status_code} 200 Compare Header Values [Arguments] ${header_key} ${header_value} ${header_to_check} ${expected_header_value} |