Step 1: Move vm scripts to the right place
[integration/test.git] / test / csit / suites / packetcable / PCMM / 010__pcmm_rest_call.robot
1 *** Settings ***
2 Documentation     Checking Network created in OVSDB are pushed to OpenDaylight
3 Suite Setup       Create Session    ODLSession    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
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
11 *** Variables ***
12 ${ODLREST_CAPP}    /restconf/config/packetcable:ccap
13 ${PACKETCABLE_CONFIG_DIR}    ${CURDIR}/../../../variables/packetcable
14 ${CCAP_ID1}       93b7d8de-15fb-11e5-b60b-1697f925ec7b
15 ${CCAP_ID2}       dc13b3fc-15fe-11e5-b60b-1697f925ec7b
16 ${CCAP_IP1}       192.168.1.101
17 ${CCAP_IP2}       192.168.1.102
18
19 *** Test Cases ***
20 Add CCAP
21     [Documentation]    Add Single CCAP
22     [Tags]    PacketCable PCMM Reset Call
23     ${Data}    OperatingSystem.Get File    ${PACKETCABLE_CONFIG_DIR}/add_ccap.json
24     ${Data}    Replace String    ${Data}    {ccapId-1}    ${CCAP_ID1}
25     ${Data}    Replace String    ${Data}    {ccapIp-1}    ${CCAP_IP1}
26     log    ${Data}
27     ${resp}    RequestsLibrary.Put    ODLSession    ${ODLREST_CAPP}/ccaps/${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     ${resp}    RequestsLibrary.Get    ODLSession    ${ODLREST_CAPP}/ccaps/${CCAP_ID1}
34     Should be Equal As Strings    ${resp.status_code}    200
35
36 Delete CAPP
37     [Documentation]    Delete Single CCAP
38     [Tags]    PacketCable PCMM Reset Call
39     ${resp}    RequestsLibrary.Delete    ODLSession    ${ODLREST_CAPP}/ccaps/${CCAP_ID1}
40     Should be Equal As Strings    ${resp.status_code}    200
41
42 Add Multiple.CCAPs
43     [Documentation]    Add Multiple CCAPs
44     [Tags]    PacketCable PCMM Reset Call
45     ${Data}    OperatingSystem.Get File    ${PACKETCABLE_CONFIG_DIR}/add_multi_ccaps.json
46     ${Data}    Replace String    ${Data}    {ccapId-1}    ${CCAP_ID1}
47     ${Data}    Replace String    ${Data}    {ccapIp-1}    ${CCAP_IP1}
48     ${Data}    Replace String    ${Data}    {ccapId-2}    ${CCAP_ID2}
49     ${Data}    Replace String    ${Data}    {ccapIp-2}    ${CCAP_IP2}
50     log    ${Data}
51     ${resp}    RequestsLibrary.Put    ODLSession    ${ODLREST_CAPP}    data=${Data}    headers=${HEADERS}
52     Should be Equal As Strings    ${resp.status_code}    200
53
54 Get ALL.CCAPs
55     [Documentation]    Get ALL CCAPs
56     [Tags]    PacketCable PCMM Reset Call
57     ${resp}    RequestsLibrary.Get    ODLSession    ${ODLREST_CAPP}
58     Should be Equal As Strings    ${resp.status_code}    200
59
60 Delete All.CCAPs
61     [Documentation]    Delete ALL CCAPs
62     [Tags]    PacketCable PCMM Reset Call
63     ${resp}    RequestsLibrary.Delete    ODLSession    ${ODLREST_CAPP}
64     Should be Equal As Strings    ${resp.status_code}    200