diff options
author | 2024-02-06 11:54:51 +0000 | |
---|---|---|
committer | 2024-02-07 15:57:56 +0000 | |
commit | 16c87b2c530aae3ff910d3e1b0e6956a83265038 (patch) | |
tree | cd50edd8e9a3db4d90670a65c9334e576cf67aa7 /csit/tests/cps-model-sync/cps-model-sync.robot | |
parent | 8bcb8ee9f7edbf12d3300f34642e2efacabe4ea8 (diff) |
Add CSIT test: Delete CM Handle
- Add new csit test to ncmp inventory
Issue-ID: CPS-2073
Change-Id: Ie683f043b2dc1cc742945a4874f19688a8702009
Signed-off-by: halil.cakal <halil.cakal@est.tech>
Diffstat (limited to 'csit/tests/cps-model-sync/cps-model-sync.robot')
-rw-r--r-- | csit/tests/cps-model-sync/cps-model-sync.robot | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/csit/tests/cps-model-sync/cps-model-sync.robot b/csit/tests/cps-model-sync/cps-model-sync.robot index 3e8551f7f..bb881f6a6 100644 --- a/csit/tests/cps-model-sync/cps-model-sync.robot +++ b/csit/tests/cps-model-sync/cps-model-sync.robot @@ -34,14 +34,15 @@ ${auth} Basic Y3BzdXNlcjpjcHNyMGNrcyE= ${ncmpInventoryBasePath} /ncmpInventory ${ncmpBasePath} /ncmp ${dmiUrl} http://${DMI_HOST}:${DMI_PORT} -${jsonDataCreate} {"dmiPlugin":"${dmiUrl}","dmiDataPlugin":"","dmiModelPlugin":"","createdCmHandles":[{"cmHandle":"ietfYang-PNFDemo","cmHandleProperties":{"Book1":"Sci-Fi Book"},"publicCmHandleProperties":{"Contact":"storeemail@bookstore.com", "Contact2":"storeemail2@bookstore.com"}}]} -${jsonDataUpdate} {"dmiPlugin":"${dmiUrl}","dmiDataPlugin":"","dmiModelPlugin":"","updatedCmHandles":[{"cmHandle":"ietfYang-PNFDemo","cmHandleProperties":{"Book1":"Romance Book"},"publicCmHandleProperties":{"Contact":"newemailforstore@bookstore.com"}}]} +${createPayload} {"dmiPlugin":"${dmiUrl}","dmiDataPlugin":"","dmiModelPlugin":"","createdCmHandles":[{"cmHandle":"ietfYang-PNFDemo","cmHandleProperties":{"Book1":"Sci-Fi Book"},"publicCmHandleProperties":{"Contact":"storeemail@bookstore.com", "Contact2":"storeemail2@bookstore.com"}},{"cmHandle":"CmHandleForDelete"}]} +${updatePayload} {"dmiPlugin":"${dmiUrl}","dmiDataPlugin":"","dmiModelPlugin":"","updatedCmHandles":[{"cmHandle":"ietfYang-PNFDemo","cmHandleProperties":{"Book1":"Romance Book"},"publicCmHandleProperties":{"Contact":"newemailforstore@bookstore.com"}}]} +${deletePayload} {"dmiPlugin":"${dmiUrl}","dmiDataPlugin":"","dmiModelPlugin":"","removedCmHandles":["CmHandleForDelete"]} *** Test Cases *** 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=${jsonDataCreate} + ${response}= POST On Session CPS_URL ${uri} headers=${headers} data=${createPayload} Should Be Equal As Strings ${response.status_code} 200 Get CM Handle details and confirm it has been registered. @@ -60,7 +61,7 @@ Get CM Handle details and confirm it has been registered. 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} + ${response}= POST On Session CPS_URL ${uri} headers=${headers} data=${updatePayload} Should Be Equal As Strings ${response.status_code} 200 Get CM Handle details and confirm it has been updated. @@ -76,6 +77,17 @@ Get CM Handle details and confirm it has been updated. END END +Delete cm handle + ${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=${deletePayload} + Should Be Equal As Strings ${response.status_code} 200 + +Get cm handle details and confirm it has been deleted + ${uri}= Set Variable ${ncmpBasePath}/v1/ch/CmHandleForDelete + ${headers}= Create Dictionary Authorization=${auth} + ${response}= GET On Session CPS_URL ${uri} headers=${headers} expected_status=404 + Get modules for registered data node ${uri}= Set Variable ${ncmpBasePath}/v1/ch/ietfYang-PNFDemo/modules ${headers}= Create Dictionary Authorization=${auth} |