maximesson | 181070f | 2020-08-07 14:18:32 +0200 | [diff] [blame^] | 1 | *** Settings *** |
| 2 | Suite Setup Suite Setup |
| 3 | Suite Teardown Suite Teardown |
| 4 | Library OperatingSystem |
| 5 | Library RequestsLibrary |
| 6 | Library Process |
| 7 | Library ONAPLibrary.Utilities |
| 8 | |
| 9 | *** Variables *** |
| 10 | ${GLOBAL_APPLICATION_ID} csit-vCPE |
| 11 | ${GLOBAL_MSO_USERNAME} InfraPortalClient |
| 12 | ${GLOBAL_MSO_PASSWORD} password1$ |
| 13 | |
| 14 | *** Test Cases *** |
| 15 | SO ServiceInstance health check |
| 16 | ${auth}= Create List ${GLOBAL_MSO_USERNAME} ${GLOBAL_MSO_PASSWORD} |
| 17 | ${session}= Create Session so http://${SO_IP}:8080 |
| 18 | ${uuid}= Generate UUID4 |
| 19 | ${headers}= Create Dictionary Accept=text/html Content-Type=text/html X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} |
| 20 | ${resp}= Get Request so /ecomp/mso/infra/globalhealthcheck headers=${headers} |
| 21 | &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json |
| 22 | ${resp}= Get Request so /ecomp/mso/infra/orchestrationRequests/v2 headers=${headers} |
| 23 | Should Not Contain ${resp.content} null |
| 24 | |
| 25 | *** Keywords *** |
| 26 | Run Docker |
| 27 | [Arguments] ${image} ${name} ${parameters}=${EMPTY} |
| 28 | ${result}= Run Process docker run --name ${name} ${parameters} -d ${image} shell=True |
| 29 | Should Be Equal As Integers ${result.rc} 0 |
| 30 | Log ${result.stdout} |
| 31 | ${result}= Run Process docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${name} shell=True |
| 32 | Should Be Equal As Integers ${result.rc} 0 |
| 33 | Log ${result.stdout} |
| 34 | [Return] ${result.stdout} |
| 35 | |
| 36 | Kill Docker |
| 37 | [Arguments] ${name} |
| 38 | ${result}= Run Process docker logs ${name} shell=True |
| 39 | Should Be Equal As Integers ${result.rc} 0 |
| 40 | Log ${result.stdout} |
| 41 | ${result}= Run Process docker kill ${name} shell=True |
| 42 | Should Be Equal As Integers ${result.rc} 0 |
| 43 | Log ${result.stdout} |
| 44 | ${result}= Run Process docker rm ${name} shell=True |
| 45 | Should Be Equal As Integers ${result.rc} 0 |
| 46 | Log ${result.stdout} |
| 47 | |
| 48 | CheckUrl |
| 49 | [Arguments] ${url} |
| 50 | Create Session session ${url} disable_warnings=True |
| 51 | ${resp}= Get Request session / |
| 52 | Should Be Equal As Integers ${resp.status_code} 200 |
| 53 | |
| 54 | Suite Setup |
| 55 | ${SO_IP}= Run Docker nexus3.onap.org:10001/openecomp/mso i-so |
| 56 | Wait Until Keyword Succeeds 1 min 5 sec CheckUrl http://${SO_IP}:8080 |
| 57 | Set Suite Variable ${SO_IP} |
| 58 | |
| 59 | Suite Teardown |
| 60 | Kill Docker i-so |