summaryrefslogtreecommitdiffstats
path: root/robot/testsuites/healthcheck/Valet-Test.robot
blob: c626cef5bb96fce222386934f88a24b7aab74d7e (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
*** Settings ***
Library           OperatingSystem
Library           RequestsLibrary
Library           json

*** Variables ***
${Valet_Host}=     http://10.12.6.165
${Endpoint_API}=   /api/valet/alive
${Endpoint_Ping}=   /api/valet/ping
${Endpoint_Health}=  /api/valet/healthcheck
${Valet_Port} =    8080
${Valet_Url}=      /api/valet
${Create_EP}=      /placement/v1/
${Authorization}=    ${BASIC} ${AUTHVALUE}
${BASIC}=          basic
${AUTHVALUE}=      UWLoPObt6Bb837uJ4jbDYRoQ7zu7svyxeJh4NGY6IT/QjIOOsNA+AaHIGP/G0Bp7dWJLiEytrjPC+NjIGfeRrA==
${Reg_Id}=         aic6
${Vf_Mod_Id}=      vf_module_uuid-006
${Vf_Mod_Name}=    test_stack_006
${Stack_Name}=     test_stack_006
${Vnf_Id}=         vnf_id_test-006
${Create_Group_EP}=    /groups/v1/
${Req_ID}=         GPlcp
${Tenant_ID}=      00000000000000000000000000000000
${Vnf_Name}=       vnf_name_test-006
${Name}=           new_rule_1
${Prior_req_id}=    testrackdiv01
${Type}=           affinity
${Level}=          rack

*** Test Cases ***
HealthCheck API
    [Documentation]    GET Call to confirm that Valet API is running
   
    Create Session   Valet     ${Valet_Host}:${Valet_Port} 
    &{headers}=      Create Dictionary    Content-Type=application/json  
   # ${StepName}    Set Variable    healthcheck
    Log to Console    ******************
    Log to Console    Sending Get Call to check Valet API status
    Log to Console    ${Valet_Host}:${Valet_Port} is URL
    #Log to Console   ${headers}
    ${resp}=     Get Request     Valet    ${Endpoint_API}    headers=${headers}
    Sleep     30s 
    Log to Console     Response from Server ${resp}
    Log to Console     ${resp.status_code}
    Should Be Equal As Integers    ${resp.status_code}    200
    Log to Console     HealthCheck API Test case is Successful
    

HealthCheck Communication
    [Documentation]    GET Call to confirm that the API is running and communicating with Music
     Create Session   Valet     ${Valet_Host}:${Valet_Port} 
    &{headers}=      Create Dictionary    Content-Type=application/json  
   # ${StepName}    Set Variable    healthcheck
    Log to Console    ******************
    Log to Console    Sending Get Call to confirm that the API is running and communicating with Music
   Log to Console    ${Valet_Host}:${Valet_Port} is URL
   # Log to Console    Header is ${headers}
    ${resp}=     Get Request     Valet    ${Endpoint_Ping}    headers=${headers}
    Sleep     30s 
    Log to Console     Response from Server ${resp}
    Log to Console     ${resp.status_code}
    Should Be Equal As Integers    ${resp.status_code}    200
    Log to Console     HealthCheck Communication Test case is Successful

HealthCheck API and Engine       
    [Documentation]    GET Cal to confirm that API and Engine both are running, and able to communicate with each other through Music
     Create Session   Valet     ${Valet_Host}:${Valet_Port} 
    &{headers}=      Create Dictionary    Content-Type=application/json  
   # ${StepName}    Set Variable    healthcheck
    Log to Console    ******************
    Log to Console    Sending Get Call to confirm that the API is running and communicating with Music
    Log to Console    ${Valet_Host}:${Valet_Port} is URL
    #Log to Console    Header is  ${headers}
    ${resp}=     Get Request     Valet    ${Endpoint_Health}    headers=${headers}
    Sleep     30s 
    Log to Console     Response from Server ${resp}
    Log to Console     ${resp.status_code}
    Should Be Equal As Integers    ${resp.status_code}    200
    Log to Console     HealthCheck API and Engine Test case is Successful