diff options
author | Toine Siebelink <toine.siebelink@est.tech> | 2024-02-08 16:40:21 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2024-02-08 16:40:21 +0000 |
commit | 4fa8d653abfd59e48d3b7461e67e5cb965ad8406 (patch) | |
tree | 3b990f45d82a17238d5d111b1e30608510dd2f84 | |
parent | 2499f273476b1a142d6913e7ca30a712bc54dbe8 (diff) | |
parent | 16c87b2c530aae3ff910d3e1b0e6956a83265038 (diff) |
Merge "Add CSIT test: Delete CM Handle"
-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 3e8551f7f5..bb881f6a67 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} |