aboutsummaryrefslogtreecommitdiffstats
path: root/tests/vfc/nfvo-catalog/test.robot
blob: 1390e9fbdcf17ff906e972cc29970a71a0b24108 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
*** settings ***
Resource    ../../common.robot
Library     Collections
Library     RequestsLibrary
Library     OperatingSystem
Library     json
Library     HttpLibrary.HTTP

*** Variables ***
${catalog_port}            8806
${cataloghealthcheck_url}         /api/catalog/v1/health_check
${vnfpkgmhealthcheck_url}         /api/vnfpkgm/v1/health_check
${nsdhealthcheck_url}         /api/nsd/v1/health_check
${parserhealthcheck_url}         /api/parser/v1/health_check

*** Test Cases ***
Check Health Catalog
    Log   Check Health Catalog
    [Documentation]    check health for catalog by MSB
    Check Health    ${cataloghealthcheck_url}

Check Health Vnfpkgm
    Log   Check Health Vnfpkgm
    [Documentation]    check health for Vnfpkgm by MSB
    Check Health    ${vnfpkgmhealthcheck_url}

Check Health Nsd
    Log   Check Health Nsd
    [Documentation]    check health for Nsd by MSB
    Check Health    ${nsdhealthcheck_url}

Check Health Parser
    Log   Check Health Parser
    [Documentation]    check health for Parser by MSB
    Check Health    ${parserhealthcheck_url}

*** Keywords ***
Check Health
    [Arguments]  ${url}
    ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
    Create Session    web_session    http://${CATALOG_IP}:${catalog_port}    headers=${headers}
    ${resp}=  Get Request    web_session    ${url}
    Should Be Equal As Strings    200    ${resp.status_code}
    ${response_json}    json.loads    ${resp.content}    
    Should Be Equal As Strings    active    ${response_json['status']}