aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dcaegen2-services-pmsh/testcases/pmsh.robot
blob: 74a575cd5840d94e0f3978bdcdc5abf97dfe2635 (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
*** Settings ***
Documentation     Testing PMSH functionality
Library           OperatingSystem
Library           RequestsLibrary
Library           String

Test Setup        Create Session  pmsh_session  ${PMSH_BASE_URL}
Test Teardown     Delete All Sessions


*** Variables ***
${PMSH_BASE_URL}                    https://${PMSH_IP}:8443
${HEALTHCHECK_ENDPOINT}             /healthcheck


*** Test Cases ***
Verify Health Check returns 200 when a REST GET request to healthcheck url
    [Tags]                          PMSH_01
    [Documentation]                 Verify Health Check returns 200 when a REST GET request to healthcheck url
    [Timeout]                       1 minute
    ${resp}=                        Get Request                      pmsh_session  ${HEALTHCHECK_ENDPOINT}
    VerifyResponse                  ${resp.status_code}              200

Verify Health Check response includes healthy status
    [Tags]                          PMSH_02
    [Documentation]                 Verify Health Check response includes healthy status
    [Timeout]                       1 minute
    ${resp}=                        Get Request                      pmsh_session  ${HEALTHCHECK_ENDPOINT}
    VerifyResponseContains          ${resp.text}                  healthy

*** Keywords ***
VerifyResponse
    [Arguments]                     ${actual_response_value}         ${expected_response_value}
    Should Be Equal As Strings      ${actual_response_value}         ${expected_response_value}

VerifyResponseContains
    [Arguments]                     ${response_content}             ${string_to_check_for}
    Should Contain                  ${response_content}             ${string_to_check_for}