summaryrefslogtreecommitdiffstats
path: root/csit
diff options
context:
space:
mode:
Diffstat (limited to 'csit')
-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}