summaryrefslogtreecommitdiffstats
path: root/csit/tests/cps-model-sync
diff options
context:
space:
mode:
authorDylanB95EST <dylan.byrne@est.tech>2022-01-27 17:12:52 +0000
committerDylan Byrne <dylan.byrne@est.tech>2022-03-01 16:17:16 +0000
commite557338803286d8aaa0f877aa25d52d18735f309 (patch)
tree059b68301b3e6c34d8bb68a8cb7dadf6bed45a06 /csit/tests/cps-model-sync
parent03459a08895ecc7e481fc5ec34779556268992f1 (diff)
Create Endpoint For Get Cm Handles By Name
Create endpoint and implement logic for get cm handle details by cm handle name Issue-ID: CPS-817 Change-Id: I83bd2da9219d13fac715a08b19108028ca6f6751 Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
Diffstat (limited to 'csit/tests/cps-model-sync')
-rw-r--r--csit/tests/cps-model-sync/cps-model-sync.robot39
1 files changed, 36 insertions, 3 deletions
diff --git a/csit/tests/cps-model-sync/cps-model-sync.robot b/csit/tests/cps-model-sync/cps-model-sync.robot
index 5021f77e90..dfad948614 100644
--- a/csit/tests/cps-model-sync/cps-model-sync.robot
+++ b/csit/tests/cps-model-sync/cps-model-sync.robot
@@ -34,15 +34,48 @@ ${auth} Basic Y3BzdXNlcjpjcHNyMGNrcyE=
${ncmpInventoryBasePath} /ncmpInventory
${ncmpBasePath} /ncmp
${dmiUrl} http://${DMI_HOST}:${DMI_PORT}
-${jsonData} {"dmiPlugin":"${dmiUrl}","dmiDataPlugin":"","dmiModelPlugin":"","createdCmHandles":[{"cmHandle":"PNFDemo","cmHandleProperties":{"Book1":"Sci-Fi Book"},"publicCmHandleProperties":{"Contact":"storeemail@bookstore.com"}}],"updatedCmHandles":[{"cmHandle":"PNFDemo","cmHandleProperties":{"Book1":"Romance Book"},"publicCmHandleProperties":{"Contact":"newemailforstore@bookstore.com"}}]}
+${jsonDataCreate} {"dmiPlugin":"${dmiUrl}","dmiDataPlugin":"","dmiModelPlugin":"","createdCmHandles":[{"cmHandle":"PNFDemo","cmHandleProperties":{"Book1":"Sci-Fi Book"},"publicCmHandleProperties":{"Contact":"storeemail@bookstore.com"}}]}
+${jsonDataUpdate} {"dmiPlugin":"${dmiUrl}","dmiDataPlugin":"","dmiModelPlugin":"","updatedCmHandles":[{"cmHandle":"PNFDemo","cmHandleProperties":{"Book1":"Romance Book"},"publicCmHandleProperties":{"Contact":"newemailforstore@bookstore.com"}}]}
*** Test Cases ***
-Register node, update data node and sync modules.
+Register data node and sync modules.
${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=${jsonData}
+ ${response}= POST On Session CPS_URL ${uri} headers=${headers} data=${jsonDataCreate}
Should Be Equal As Strings ${response.status_code} 204
+Get CM Handle details and confirm it has been registered.
+ ${uri}= Set Variable ${ncmpBasePath}/v1/ch/PNFDemo
+ ${headers}= Create Dictionary Authorization=${auth}
+ ${response}= GET On Session CPS_URL ${uri} headers=${headers}
+ ${responseJson}= Set Variable ${response.json()}
+ ${schemaCount}= Get length ${responseJson}
+ Should Be Equal As Strings ${response.status_code} 200
+ IF "${responseJson['cmHandle']}" == "PNFDemo"
+ FOR ${item} IN @{responseJson['publicCmHandleProperties']}
+ Should Be Equal As Strings "${item['Contact']}" "storeemail@bookstore.com"
+ END
+ END
+
+Update data node and sync modules.
+ ${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=${jsonDataUpdate}
+ Should Be Equal As Strings ${response.status_code} 204
+
+Get CM Handle details and confirm it has been updated.
+ ${uri}= Set Variable ${ncmpBasePath}/v1/ch/PNFDemo
+ ${headers}= Create Dictionary Authorization=${auth}
+ ${response}= GET On Session CPS_URL ${uri} headers=${headers}
+ ${responseJson}= Set Variable ${response.json()}
+ ${schemaCount}= Get length ${responseJson}
+ Should Be Equal As Strings ${response.status_code} 200
+ IF "${responseJson['cmHandle']}" == "PNFDemo"
+ FOR ${item} IN @{responseJson['publicCmHandleProperties']}
+ Should Be Equal As Strings "${item['Contact']}" "newemailforstore@bookstore.com"
+ END
+ END
+
Get modules for registered data node
${uri}= Set Variable ${ncmpBasePath}/v1/ch/PNFDemo/modules
${headers}= Create Dictionary Authorization=${auth}