Add forgotten TCs for VTN edition
[integration/test.git] / test / csit / suites / vtn / 020__forwarding_rules_manager.txt
1 *** Settings ***
2 Documentation     Test suite for the forwarding rule manager module.
3 Suite Setup       Create Session   session   http://${CONTROLLER}:8080  auth=${AUTH}   headers=${HEADERS}
4 Suite Teardown    Delete All Sessions
5 Library           Collections
6 Library           ../../libraries/RequestsLibrary.py
7 Library           ../../libraries/Common.py
8 Variables         ../../variables/Variables.py
9
10 *** Variables ***
11 ${name}           flow1
12 ${key}            flowConfig
13 ${node_id}        00:00:00:00:00:00:00:02
14 ${REST_CONTEXT}    /controller/nb/v2/flowprogrammer
15
16 *** Test Cases ***
17 Add a flow
18     [Documentation]    Add a flow, list to validate the result.
19     [Tags]    add
20     ${node}    Create Dictionary    type    OF    id    ${node_id}
21     ${actions}    Create List    OUTPUT=1
22     ${body}    Create Dictionary    name    ${name}    installInHw    true    node
23     ...    ${node}    priority    1    etherType    0x800    nwDst
24     ...    10.0.0.1/32    actions    ${actions}
25     ${resp}    Put    session    ${REST_CONTEXT}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name}    data=${body}
26     Should Be Equal As Strings    ${resp.status_code}    201    Response status code error
27     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}
28     Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
29     ${result}    To JSON    ${resp.content}
30     ${content}    Get From Dictionary    ${result}    ${key}
31     List Should Contain Value    ${content}    ${body}
32
33 Remove a flow
34     [Documentation]    Remove a flow, list to validate the result.
35     [Tags]    remove
36     ${node}    Create Dictionary    type    OF    id    ${node_id}
37     ${actions}    Create List    OUTPUT=1
38     ${body}    Create Dictionary    name    ${name}    installInHw    true    node
39     ...    ${node}    priority    1    etherType    0x800    nwDst
40     ...    10.0.0.1/32    actions    ${actions}
41     ${resp}    Delete    session    ${REST_CONTEXT}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name}
42     Should Be Equal As Strings    ${resp.status_code}    204    Response status code error
43     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}
44     Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
45     ${result}    To JSON    ${resp.content}
46     ${content}    Get From Dictionary    ${result}    ${key}
47     List Should Not Contain Value    ${content}    ${body}