X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=csit%2Ftests%2Fcps-model-sync%2Fcps-model-sync.robot;h=dfad9486148a4455a344c11b8d4b5afc508ac29c;hb=e557338803286d8aaa0f877aa25d52d18735f309;hp=5021f77e9079179f1269d5953c895c1791c1c91a;hpb=d042fcdae75be100f840b6313e078eab278d87ef;p=cps.git diff --git a/csit/tests/cps-model-sync/cps-model-sync.robot b/csit/tests/cps-model-sync/cps-model-sync.robot index 5021f77e9..dfad94861 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}