Delete flows at the end
[integration/test.git] / test / csit / suites / base / 035__forwarding_manager.txt
1 *** Settings ***
2 Documentation     Test suite for the forwarding manager module.
3 Suite Setup       Create Session   session   http://${CONTROLLER}:8080   auth=${AUTH}   headers=${HEADERS}
4 Suite Teardown    Delete All Sessions
5 Library           SSHLibrary
6 Library           Collections
7 Library           ../../libraries/RequestsLibrary.py
8 Library           ../../libraries/Common.py
9 Variables         ../../variables/Variables.py
10
11 *** Variables ***
12 ${name}           test_route1
13 ${key}            staticRoute
14 ${REST_CONTEXT}    /controller/nb/v2/staticroute
15
16 *** Test Cases ***
17 Add a static route
18     [Documentation]    Add a static route, list to validate the result.
19     [Tags]    add
20     ${body}    Create Dictionary    name    ${name}    prefix    192.168.1.0/24    nextHop
21     ...    10.0.0.2
22     ${resp}    Put    session    ${REST_CONTEXT}/${CONTAINER}/route/${name}    data=${body}
23     Should Be Equal As Strings    ${resp.status_code}    201    Response status code error
24     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/routes
25     Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
26     ${result}    To JSON    ${resp.content}
27     ${content}    Get From Dictionary    ${result}    ${key}
28     List Should Contain Value    ${content}    ${body}
29     Sleep    2
30 Remove a static route
31     [Documentation]    Remove a static route, list to validate the result.
32     [Tags]    remove
33     ${body}    Create Dictionary    name    ${name}    prefix    192.168.1.0/24    nextHop
34     ...    10.0.0.2
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}
42 Remove flows
43     [Documentation]    Remove flows generated by simple fwd
44     [Tags]   Get
45     Write   dpctl del-flows
46     Sleep   1
47     Read
48