diff options
Diffstat (limited to 'csit')
-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} |