Change URI to specific ovsdb node
[integration/test.git] / tools / Robot_Tool / suites / base / forwarding_manager.txt
1 *** Settings ***
2 Documentation     Test suite for the forwarding manager 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_route1
11 ${key}            staticRoute
12 ${REST_CONTEXT}    /controller/nb/v2/staticroute
13
14 *** Test Cases ***
15 Add a static route
16     [Documentation]    Add a static route, list to validate the result.
17     [Tags]    add
18     ${body}    Create Dictionary    name=${name}    prefix=192.168.1.0/24    nextHop=10.0.0.2
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}/route/${name}    data=${body}
22     Should Be Equal As Strings    ${resp.status_code}    201    Response status code error
23     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/routes
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}    prefix=192.168.1.0/24    nextHop=10.0.0.2
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}/route/${name}
36     Should Be Equal As Strings    ${resp.status_code}    204    Response status code error
37     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/routes
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}