diff options
Diffstat (limited to 'test/csit/tests')
7 files changed, 103 insertions, 13 deletions
diff --git a/test/csit/tests/dmaap/mrpubsub/mrpubsub.robot b/test/csit/tests/dmaap/mrpubsub/mrpubsub.robot new file mode 100755 index 000000000..c711bd754 --- /dev/null +++ b/test/csit/tests/dmaap/mrpubsub/mrpubsub.robot @@ -0,0 +1,73 @@ +*** Settings *** +Library OperatingSystem +Library RequestsLibrary +Library requests +Library Collections +Library String + +*** Variables *** +${TARGETURL_PUBLISH} http://${DMAAP_MR_IP}:3904/events/TestTopic1 +${TARGETURL_TOPICS} http://${DMAAP_MR_IP}:3904/topics +${TARGETURL_SUBSCR} http://${DMAAP_MR_IP}:3904/events/TestTopic1/CG1/C1?timeout=1000 +${TEST_DATA} {"topicName": "TestTopic1"} +${TOPIC_DATA} {"topicName":"FirstTopic","topicDescription":"This is a TestTopic","partitionCount":"1","replicationCount":"3","transactionEnabled":"true"} + +*** Test Cases *** +Run Topic Creation and Publish + [Documentation] Topic Creation + [Timeout] 1 minute + ${resp}= PostCall ${TARGETURL_PUBLISH} ${TEST_DATA} + log ${TARGETURL_PUBLISH} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + ${count}= Evaluate $resp.json().get('count') + log 'JSON Response Code:'${resp} + +Run Subscribing a message status + [Documentation] Subscribide message status + [Timeout] 1 minute + ${resp}= GetCall ${TARGETURL_SUBSCR} + log ${TARGETURL_SUBSCR} + Should Be Equal As Strings ${resp.status_code} 200 + log 'JSON Response Code :'${resp} + +Run check topics are exisiting + [Documentation] Get the count of the Topics + [Timeout] 1 minute + ${resp}= GetCall ${TARGETURL_TOPICS} + log ${TARGETURL_TOPICS} + Should Be Equal As Strings ${resp.status_code} 200 + log 'JSON Response Code :'${resp} + ${topics}= Evaluate $resp.json().get('topics') + log ${topics} + ${ListLength}= Get Length ${topics} + log ${ListLength} + List Should Contain Value ${topics} TestTopic1 + +Run Publich and Subscribe a message + [Documentation] Publish and Subscribe the message + [Timeout] 1 minute + ${resp}= PostCall ${TARGETURL_PUBLISH} ${TEST_DATA} + log ${TARGETURL_PUBLISH} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + ${sub_resp}= GetCall ${TARGETURL_SUBSCR} + log ${TARGETURL_SUBSCR} + Should Be Equal As Strings ${sub_resp.status_code} 200 + log 'JSON Response Code :'${sub_resp} + ${ListLength}= Get Length ${sub_resp.json()} + log ${ListLength} + List Should Contain Value ${sub_resp.json()} {"topicName":"TestTopic1"} case_insensitive=yes + +*** Keywords *** +PostCall + [Arguments] ${url} ${data} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests + [Return] ${resp} + +GetCall + [Arguments] ${url} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Evaluate requests.get('${url}', headers=${headers}, verify=False) requests + [Return] ${resp} diff --git a/test/csit/tests/holmes/testcase/CommonKeywords/HttpRequest.robot b/test/csit/tests/holmes/testcase/CommonKeywords/HttpRequest.robot index 5b8417404..45bec5ef5 100644 --- a/test/csit/tests/holmes/testcase/CommonKeywords/HttpRequest.robot +++ b/test/csit/tests/holmes/testcase/CommonKeywords/HttpRequest.robot @@ -30,8 +30,8 @@ httpPost [Return] ${postResponse} httpDelete - [Arguments] ${restHost} ${restUrl} ${data} + [Arguments] ${restHost} ${restUrl} ${headers} create dictionary Content-Type=application/json Accept=application/json create session microservices ${restHost} ${headers} - ${deleteResponse} delete request microservices ${restUrl} ${data} + ${deleteResponse} delete request microservices ${restUrl} [Return] ${deleteResponse} diff --git a/test/csit/tests/holmes/testcase/RuleMgt/Rule-Keywords.robot b/test/csit/tests/holmes/testcase/RuleMgt/Rule-Keywords.robot index 03f840904..182737f54 100644 --- a/test/csit/tests/holmes/testcase/RuleMgt/Rule-Keywords.robot +++ b/test/csit/tests/holmes/testcase/RuleMgt/Rule-Keywords.robot @@ -72,8 +72,8 @@ modifyRule [Return] ${response} deleteRule - [Arguments] ${jsonParam} ${codeFlag}=1 - ${response} httpDelete ${ruleMgtHost} ${ruleMgtUrl} ${jsonParam} + [Arguments] ${ruleId} ${codeFlag}=1 + ${response} httpDelete ${ruleMgtHost} ${ruleMgtUrl}/${ruleId} log ${response.content} run keyword if ${codeFlag}==1 Should be equal as strings ${response.status_code} 200 run keyword if ${codeFlag}!=1 Should be equal as strings ${response.status_code} 499 diff --git a/test/csit/tests/holmes/testcase/RuleMgt/Rule-Mgt.robot b/test/csit/tests/holmes/testcase/RuleMgt/Rule-Mgt.robot index 03ee70849..ad2a540fd 100644 --- a/test/csit/tests/holmes/testcase/RuleMgt/Rule-Mgt.robot +++ b/test/csit/tests/holmes/testcase/RuleMgt/Rule-Mgt.robot @@ -120,8 +120,8 @@ modify_rule_with_description delete_existing_rule [Documentation] Delete an existing rule. should not be empty ${RULEID} - deleteRule {"ruleid":"${RULEID}"} + deleteRule ${RULEID} delete_non_existing_rule [Documentation] Delete a non-existing rule. - deleteRule {"ruleid":"${RULEID}"} -1 + deleteRule ${RULEID} -1 diff --git a/test/csit/tests/sdc/healthCheck/__init__.robot b/test/csit/tests/sdc/healthCheck/__init__.robot new file mode 100644 index 000000000..8ee10d5f6 --- /dev/null +++ b/test/csit/tests/sdc/healthCheck/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Documentation Sdc - HealthCheck diff --git a/test/csit/tests/sdc/healthCheck/test1.robot b/test/csit/tests/sdc/healthCheck/test1.robot new file mode 100644 index 000000000..6d4dc242d --- /dev/null +++ b/test/csit/tests/sdc/healthCheck/test1.robot @@ -0,0 +1,16 @@ +*** Settings *** +Library Collections +Library OperatingSystem +Library RequestsLibrary +Library json + +*** Test Cases *** +Get Requests health check ok + [Tags] get + CreateSession sdc-be http://localhost:8080 + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Get Request sdc-be /sdc2/rest/healthCheck headers=&{headers} + Should Be Equal As Strings ${resp.status_code} 200 + @{ITEMS}= Copy List ${resp.json()['componentsInfo']} + : FOR ${ELEMENT} IN @{ITEMS} + \ Log ${ELEMENT['healthCheckComponent']} ${ELEMENT['healthCheckStatus']} diff --git a/test/csit/tests/vfc/nfvo-driver-svnfm/huawei.robot b/test/csit/tests/vfc/nfvo-driver-svnfm/huawei.robot index b1aea584a..e0679fbd8 100644 --- a/test/csit/tests/vfc/nfvo-driver-svnfm/huawei.robot +++ b/test/csit/tests/vfc/nfvo-driver-svnfm/huawei.robot @@ -1,4 +1,5 @@ *** settings *** +Resource ../../common.robot Library Collections Library RequestsLibrary Library simplejson @@ -9,7 +10,7 @@ Library HttpLibrary.HTTP *** Variables *** @{return_ok_list}= 200 201 202 204 ${queryswagger_url} /api/hwvnfm/v1/swagger.json -${createauthtoken_url} /rest/vnfmmed/v2/auth/tokens +${createauthtoken_url} /rest/plat/smapp/v1/oauth/token #json files ${hwvnfm_createtoken_json} ${SCRIPTS}/../tests/vfc/nfvo-driver-svnfm/jsoninput/hwvnfm_createtoken.json @@ -18,7 +19,7 @@ ${hwvnfm_createtoken_json} ${SCRIPTS}/../tests/vfc/nfvo-driver-svnfm/jsoninpu SwaggerFuncTest [Documentation] query swagger info rest test ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${MSB_IP}:80 headers=${headers} + Create Session web_session http://${SERVICE_IP}:8482 headers=${headers} ${resp}= Get Request web_session ${queryswagger_url} ${responese_code}= Convert To String ${resp.status_code} List Should Contain Value ${return_ok_list} ${responese_code} @@ -31,10 +32,8 @@ AuthTokenFuncTest ${json_value}= json_from_file ${hwvnfm_createtoken_json} ${json_string}= string_from_json ${json_value} ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${MSB_IP}:80 headers=${headers} + Create Session web_session http://${SERVICE_IP}:8482 headers=${headers} Set Request Body ${json_string} - ${resp}= Post Request web_session ${createauthtoken_url} ${json_string} + ${resp}= Put Request web_session ${createauthtoken_url} ${json_string} ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - ${response_json} json.loads ${resp.content} - Dictionary Should Contain Key ${response_json} token
\ No newline at end of file + List Should Contain Value ${return_ok_list} ${responese_code}
\ No newline at end of file |