aboutsummaryrefslogtreecommitdiffstats
path: root/test/csit
diff options
context:
space:
mode:
authorlizi <li.zi30@zte.com.cn>2017-09-29 17:10:07 +0800
committerlizi <li.zi30@zte.com.cn>2017-09-29 17:39:05 +0800
commit38ba5ef51dce55a9e313577b7a7273ebf57bad3d (patch)
treeb14f3e79faf5aee86d47ba60aaf6da60d4c05951 /test/csit
parent3654df092c284009aecbf5d2111ff4bdad163881 (diff)
Add csit usecase for external system(VIM).
Change-Id: I17cb92d9bc20f90eb8344fe04771cb7223ed3658 Issue-ID: AAI-406 Signed-off-by: lizi <li.zi30@zte.com.cn>
Diffstat (limited to 'test/csit')
-rw-r--r--test/csit/tests/aai/resources/api_suite/vim.robot65
1 files changed, 65 insertions, 0 deletions
diff --git a/test/csit/tests/aai/resources/api_suite/vim.robot b/test/csit/tests/aai/resources/api_suite/vim.robot
new file mode 100644
index 000000000..9a7fc1f93
--- /dev/null
+++ b/test/csit/tests/aai/resources/api_suite/vim.robot
@@ -0,0 +1,65 @@
+*** Settings ***
+Library OperatingSystem
+Library RequestsLibrary
+Library requests
+Library Collections
+
+*** Variables ***
+${TARGETURL} https://${HOST_IP}:8443/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/VIM-test1/RegionOne1
+${VIMDATA} {"cloud-owner": "VIM-test1", "cloud-region-id": "RegionOne1", "cloud-type": "openstack", "owner-defined-type": "owner-defined-type", "cloud-region-version": "v1.0", "cloud-zone": "cloud zone", "complex-name": "complex name", "cloud-extra-info": "{}", "esr-system-info-list": { "esr-system-info": [{"esr-system-info-id": "vim-esr-system-info-id", "service-url": "http://10.12.25.2:5000/v3", "user-name": "demo", "password": "onapdemo", "system-type": "VIM", "ssl-insecure": true, "cloud-domain": "Default"}]}}
+
+*** Test Cases ***
+
+Run AAI Put VIM
+ [Documentation] Create an VIM object
+ ${resp}= PutWithCert ${TARGETURL} ${VIMDATA}
+ log ${TARGETURL}
+ log ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 201
+
+Run AAI Get VIM
+ [Documentation] Get the VIM object just created
+ ${resp} GetWithCert ${TARGETURL}
+ log ${resp}
+ log ${resp.json()}
+ Should Be Equal As Strings ${resp.status_code} 200
+ ${resource_version}= Evaluate $resp.json().get('resource-version')
+ Set Global Variable ${resource_version}
+
+Run AAI Delete VIM
+ [Documentation] Delete the VIM just created
+ ${resp}= DeleteWithCert ${TARGETURL}?resource-version=${resource_version}
+ log ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 204
+
+*** Keywords ***
+PutWithCert
+ [Arguments] ${url} ${data}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=integration-aai X-FromAppId=integration-aai Authorization=Basic QUFJOkFBSQ==
+ ${certinfo}= Evaluate ('${CURDIR}/aai.crt', '${CURDIR}/aai.key')
+ ${resp}= Evaluate requests.put('${url}', data='${data}', headers=${headers}, cert=${certinfo}, verify=False) requests
+ [return] ${resp}
+
+PostWithCert
+ [Arguments] ${url} ${data}
+ ${auth}= Create List AAI AAI
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=integration-aai X-FromAppId=integration-aai Authorization=Basic QUFJOkFBSQ==
+ ${certinfo}= Evaluate ('${CURDIR}/aai.crt', '${CURDIR}/aai.key')
+ ${resp}= Evaluate requests.post('${url}', data='${data}', headers=${headers}, cert=${certinfo}, verify=False) requests
+ [return] ${resp}
+
+GetWithCert
+ [Arguments] ${url}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=integration-aai X-FromAppId=integration-aai Authorization=Basic QUFJOkFBSQ==
+ ${certinfo}= Evaluate ('${CURDIR}/aai.crt', '${CURDIR}/aai.key')
+ ${resp}= Evaluate requests.get('${url}', headers=${headers}, cert=${certinfo}, verify=False) requests
+ [return] ${resp}
+
+DeleteWithCert
+ [Arguments] ${url}
+ ${auth}= Create List AAI AAI
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=integration-aai X-FromAppId=integration-aai Authorization=Basic QUFJOkFBSQ==
+ ${certinfo}= Evaluate ('${CURDIR}/aai.crt', '${CURDIR}/aai.key')
+ ${resp}= Evaluate requests.delete('${url}', headers=${headers}, cert=${certinfo}, verify=False) requests
+ [return] ${resp}
+