Migrate Get Requests invocations(libraries)
[integration/test.git] / csit / suites / packetcable / PCMM / 010__pcmm_rest_call.robot
1 *** Settings ***
2 Documentation       Checking packetcable:ccap resconf is working
3
4 Library             OperatingSystem
5 Library             String
6 Library             RequestsLibrary
7 Library             ../../../libraries/Common.py
8 Variables           ../../../variables/Variables.py
9 Resource            ../../../libraries/PacketcableVersion.robot
10 Resource            ../../../libraries/TemplatedRequests.robot
11
12 Suite Setup         Create Session And Init Variables
13 Suite Teardown      Delete All Sessions
14
15
16 *** Variables ***
17 ${CCAP_ID1}     93b7d8de-15fb-11e5-b60b-1697f925ec7b
18 ${CCAP_ID2}     dc13b3fc-15fe-11e5-b60b-1697f925ec7b
19 ${CCAP_IP1}     192.168.1.101
20 ${CCAP_IP2}     192.168.1.102
21
22
23 *** Test Cases ***
24 Add CCAP
25     [Documentation]    Add Single CCAP
26     [Tags]    packetcable pcmm reset call
27     ${Data}    OperatingSystem.Get File    ${PACKETCABLE_RESOURCE_DIR}/add_ccap.json
28     ${Data}    Replace String    ${Data}    {ccapId-1}    ${CCAP_ID1}
29     ${Data}    Replace String    ${Data}    {ccapIp-1}    ${CCAP_IP1}
30     log    ${Data}
31     log    ${ODLREST_CCAPS}/${CCAP_TOKEN}/${CCAP_ID1}
32     ${resp}    RequestsLibrary.Put Request    ODLSession    ${ODLREST_CCAPS}/${CCAP_TOKEN}/${CCAP_ID1}    data=${Data}
33     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
34
35 Get CCAP
36     [Documentation]    Get Single CCAP
37     [Tags]    packetcable pcmm reset call
38     log    ${ODLREST_CCAPS}/${CCAP_TOKEN}/${CCAP_ID1}
39     ${resp}    RequestsLibrary.Get Request    ODLSession    ${ODLREST_CCAPS}/${CCAP_TOKEN}/${CCAP_ID1}
40     Should be Equal As Strings    ${resp.status_code}    200
41
42 Delete CAPP
43     [Documentation]    Delete Single CCAP
44     [Tags]    packetcable pcmm reset call
45     log    ${ODLREST_CCAPS}/${CCAP_TOKEN}/${CCAP_ID1}
46     ${resp}    RequestsLibrary.Delete Request    ODLSession    ${ODLREST_CCAPS}/${CCAP_TOKEN}/${CCAP_ID1}
47     Should be Equal As Strings    ${resp.status_code}    200
48
49 Add Multiple.CCAPs
50     [Documentation]    Add Multiple CCAPs
51     [Tags]    packetcable pcmm reset call
52     ${Data}    OperatingSystem.Get File    ${PACKETCABLE_RESOURCE_DIR}/add_multi_ccaps.json
53     ${Data}    Replace String    ${Data}    {ccapId-1}    ${CCAP_ID1}
54     ${Data}    Replace String    ${Data}    {ccapIp-1}    ${CCAP_IP1}
55     ${Data}    Replace String    ${Data}    {ccapId-2}    ${CCAP_ID2}
56     ${Data}    Replace String    ${Data}    {ccapIp-2}    ${CCAP_IP2}
57     log    ${Data}
58     ${resp}    RequestsLibrary.Put Request    ODLSession    ${ODLREST_CCAPS}    data=${Data}
59     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
60
61 Get ALL.CCAPs
62     [Documentation]    Get ALL CCAPs
63     [Tags]    packetcable pcmm reset call
64     ${resp}    RequestsLibrary.Get Request    ODLSession    ${ODLREST_CCAPS}
65     Should be Equal As Strings    ${resp.status_code}    200
66
67 Delete All.CCAPs
68     [Documentation]    Delete ALL CCAPs
69     [Tags]    packetcable pcmm reset call
70     ${resp}    RequestsLibrary.Delete Request    ODLSession    ${ODLREST_CCAPS}
71     Should be Equal As Strings    ${resp.status_code}    200