Change URI to specific ovsdb node
[integration/test.git] / tools / Robot_Tool / suites / base / arp_handler.txt
1 *** Settings ***
2 Documentation     Test suite for the arp handler module.
3 Suite Teardown    Delete All Sessions
4 Library           Collections
5 Library           RequestsLibrary
6 Library           ../../libraries/Common.py
7 Variables         ../../variables/Variables.py
8
9 *** Variables ***
10 ${name}           test
11 ${key}            subnetConfig
12 ${REST_CONTEXT}    /controller/nb/v2/subnetservice
13
14 *** Test Cases ***
15 Add a subnet
16     [Documentation]    Add a subnet, list to validate the result.
17     [Tags]    add
18     ${body}    Create Dictionary    name=${name}    subnet=10.0.0.254/8
19     ${headers}    Create Dictionary    Content-Type=application/json
20     Create Session    session    http://${CONTROLLER}:8080    headers=${headers}    auth=${auth}
21     ${resp}    Put    session    ${REST_CONTEXT}/${CONTAINER}/subnet/${name}    data=${body}
22     Should Be Equal As Strings    ${resp.status_code}    201    Response status code error
23     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/subnets
24     Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
25     ${result}    To JSON    ${resp.content}
26     ${content}    Get From Dictionary    ${result}    ${key}
27     List Should Contain Value    ${content}    ${body}
28
29 Remove a subnet
30     [Documentation]    Remove a subnet, list to validate the result.
31     [Tags]    remove
32     ${body}    Create Dictionary    name=${name}    subnet=10.0.0.254/8
33     ${headers}    Create Dictionary    Content-Type=application/json
34     Create Session    session    http://${CONTROLLER}:8080    headers=${headers}    auth=${auth}
35     ${resp}    Delete    session    ${REST_CONTEXT}/${CONTAINER}/subnet/${name}
36     Should Be Equal As Strings    ${resp.status_code}    204    Response status code error
37     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/subnets
38     Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
39     ${result}    To JSON    ${resp.content}
40     ${content}    Get From Dictionary    ${result}    ${key}
41     List Should Not Contain Value    ${content}    ${body}