3f94fa8f9616eb7a367e565eba640c8fc3141145
[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=${node}
33     ...     priority=1    etherType=0x800    nwDst=10.0.0.1/32    actions=${actions}
34     Create Session    session    http://${Controller1_IP}:8080   auth=${AUTH}   headers=${HEADERS}
35     ${resp}    Put    session    ${REST_CONTEXT_P}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name}    data=${body}
36     Should Be Equal As Strings    ${resp.status_code}    201
37
38
39 Check flow stats in C1
40     [Documentation]    Checking the flow stats and validating the result in C1
41     [Tags]   get
42     Sleep   10
43     Create Session    session    http://${Controller1_IP}:8080   auth=${AUTH}   headers=${HEADERS}
44     ${resp}    Get    session    ${REST_CONTEXT_ST}/${CONTAINER}/flow
45     Should Be Equal As Strings    ${resp.status_code}    200 
46     Log    ${resp.content}
47     Should Contain    ${resp.content}    ${FLOW}
48
49
50 Check flow stats in C2
51     [Documentation]    Checking the flow stats and validating the result in C2
52     [Tags]   get
53     Sleep   10
54     Create Session    session    http://${Controller2_IP}:8080   auth=${AUTH}   headers=${HEADERS}
55     ${resp}    Get    session    ${REST_CONTEXT_ST}/${CONTAINER}/flow
56     Should Be Equal As Strings    ${resp.status_code}    200 
57     Log    ${resp.content}
58     Should Contain    ${resp.content}    ${FLOW}
59