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