Step 1: Move vm scripts to the right place
[integration/test.git] / tools / Robot_Tool / suites / cluster / 015__FRM.txt
1 *** Settings ***
2 Documentation     Introducing switches to both the controllers C1  and C2
3 Suite Teardown    Delete All Sessions
4 Library           SSHLibrary
5 Library           Collections
6 Library           RequestsLibrary
7 Library           ../../libraries/Common.py
8 Variables         ../../variables/Variables.py
9
10 *** Variables ***
11 ${node1}   "00:00:00:00:00:00:00:01"
12 ${node2}   "00:00:00:00:00:00:00:02"
13 ${node3}   "00:00:00:00:00:00:00:03"
14 ${key}            flowConfig
15 ${name}           flow1
16 ${REST_CONTEXT_P}    /controller/nb/v2/flowprogrammer
17 ${REST_CONTEXT_ST}    /controller/nb/v2/statistics
18 ${CONTROLLER1}    10.125.136.38:6633
19 ${CONTROLLER2}    10.125.136.43:6633
20 ${Controller1_IP}    10.125.136.38
21 ${Controller2_IP}    10.125.136.43
22 ${node_id}        00:00:00:00:00:00:00:02
23 ${FLOW}           "10.0.0.1"
24
25
26 *** Test Cases ***
27 Add a flow in C1
28     [Documentation]     Adding a flow, list to validate the result in C1
29     [Tags]    add
30     ${node}    Create Dictionary    type    OF    id    ${node_id}
31     ${actions}    Create List    OUTPUT=1
32     ${body}    Create Dictionary    name    ${name}    installInHw    true    node
33     ...    ${node}    priority    1    etherType    0x800    nwDst
34     ...    10.0.0.1/32    actions    ${actions}
35     Create Session    session    http://${Controller1_IP}:8080   auth=${AUTH}   headers=${HEADERS}
36     ${resp}    Put    session    ${REST_CONTEXT_P}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name}    data=${body}
37     Should Be Equal As Strings    ${resp.status_code}    201
38
39
40 Check flow stats in C1
41     [Documentation]    Checking the flow stats and validating the result in C1
42     [Tags]   get
43     Sleep   10
44     Create Session    session    http://${Controller1_IP}:8080   auth=${AUTH}   headers=${HEADERS}
45     ${resp}    Get    session    ${REST_CONTEXT_ST}/${CONTAINER}/flow
46     Should Be Equal As Strings    ${resp.status_code}    200 
47     Log    ${resp.content}
48     Should Contain    ${resp.content}    ${FLOW}
49
50
51 Check flow stats in C2
52     [Documentation]    Checking the flow stats and validating the result in C2
53     [Tags]   get
54     Sleep   10
55     Create Session    session    http://${Controller2_IP}:8080   auth=${AUTH}   headers=${HEADERS}
56     ${resp}    Get    session    ${REST_CONTEXT_ST}/${CONTAINER}/flow
57     Should Be Equal As Strings    ${resp.status_code}    200 
58     Log    ${resp.content}
59     Should Contain    ${resp.content}    ${FLOW}
60