Merge "Update manifest"
[integration.git] / test / csit / tests / dcaegen2 / prh_testcases / resources / prh_keywords.robot
1 *** Settings ***
2 Documentation     The main interface for interacting with PRH. It handles low level stuff like managing the http request library
3 Library           PrhLibrary.py
4 Library           RequestsLibrary
5
6 *** Variables ***
7
8 *** Keywords ***
9 PRH Suite Setup
10     [Documentation]    Start DMaaP and AAI Mockup Server
11     ${ret}=    Setup DMaaP Server
12     Should Be Equal As Strings    ${ret}    true
13     ${ret}=    Setup AAI Server
14     Should Be Equal As Strings    ${ret}    true
15
16 PRH Suite Shutdown
17     [Documentation]    Shutdown DMaaP and AAI Mockup Server
18     ${ret}=    Shutdown DMaap Server
19     Should Be Equal As Strings    ${ret}    true
20     ${ret}=    Shutdown AAI Server
21     Should Be Equal As Strings    ${ret}    true
22
23 Get event from DMaaP
24     [Arguments]    ${ip}    ${endpoint}
25     [Documentation]    Get an event from DMaaP
26     ${url}=    Catenate    SEPARATOR=    ${ip}    ${endpoint}
27     Log    Creating session ${url}
28     Create Session    prh-d1    ${url}
29     ${resp}=    Get Request    prh-d1    ${url}
30     Log    Received response from dcae ${resp.json()}
31     [Return]    ${resp}
32
33 Send patch from AAI
34     [Arguments]    ${ip}    ${endpoint}
35     [Documentation]    Get patch from AAI
36     ${url}=    Catenate    SEPARATOR=    ${ip}    ${endpoint}
37     Log    Creating session ${url}
38     Create Session    prh-d1    ${url}
39     ${resp}=    Patch Request    prh-d1    ${url}
40     Log    ${resp}
41     [Return]    ${resp}
42
43 Get json from AAI
44     [Arguments]    ${ip}    ${endpoint}
45     [Documentation]    Get json from AAI
46     ${url}=    Catenate    SEPARATOR=    ${ip}    ${endpoint}
47     Log    Creating session ${url}
48     Create Session    prh-d1    ${url}
49     ${resp}=    Get Request    prh-d1    ${url}
50     Log    Received response from dcae ${resp.json()}
51     [Return]    ${resp}
52
53 Post json to DMaaP
54     [Arguments]    ${ip}    ${endpoint}    ${PNF_READY}
55     [Documentation]    Get json from AAI
56     ${url}=    Catenate    SEPARATOR=    ${ip}    ${endpoint}
57     Log    Creating session ${url}
58     Create Session    prh-d1    ${url}
59     ${resp}=    Post Request    prh-d1    ${url}    data=${PNF_READY}
60     Log    ${resp}
61     [Return]    ${resp}