1390e9fbdcf17ff906e972cc29970a71a0b24108
[integration/csit.git] / tests / vfc / nfvo-catalog / test.robot
1 *** settings ***
2 Resource    ../../common.robot
3 Library     Collections
4 Library     RequestsLibrary
5 Library     OperatingSystem
6 Library     json
7 Library     HttpLibrary.HTTP
8
9 *** Variables ***
10 ${catalog_port}            8806
11 ${cataloghealthcheck_url}         /api/catalog/v1/health_check
12 ${vnfpkgmhealthcheck_url}         /api/vnfpkgm/v1/health_check
13 ${nsdhealthcheck_url}         /api/nsd/v1/health_check
14 ${parserhealthcheck_url}         /api/parser/v1/health_check
15
16 *** Test Cases ***
17 Check Health Catalog
18     Log   Check Health Catalog
19     [Documentation]    check health for catalog by MSB
20     Check Health    ${cataloghealthcheck_url}
21
22 Check Health Vnfpkgm
23     Log   Check Health Vnfpkgm
24     [Documentation]    check health for Vnfpkgm by MSB
25     Check Health    ${vnfpkgmhealthcheck_url}
26
27 Check Health Nsd
28     Log   Check Health Nsd
29     [Documentation]    check health for Nsd by MSB
30     Check Health    ${nsdhealthcheck_url}
31
32 Check Health Parser
33     Log   Check Health Parser
34     [Documentation]    check health for Parser by MSB
35     Check Health    ${parserhealthcheck_url}
36
37 *** Keywords ***
38 Check Health
39     [Arguments]  ${url}
40     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
41     Create Session    web_session    http://${CATALOG_IP}:${catalog_port}    headers=${headers}
42     ${resp}=  Get Request    web_session    ${url}
43     Should Be Equal As Strings    200    ${resp.status_code}
44     ${response_json}    json.loads    ${resp.content}    
45     Should Be Equal As Strings    active    ${response_json['status']}