Step 2: Move test folder to root
[integration/test.git] / tools / Robot_Tool / suites / cluster / 010__bridge_topology.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 ${REST_CONTEXT}    /controller/nb/v2/topology
15 ${REST_CONTEXT_ST}    /controller/nb/v2/statistics
16 ${CONTROLLER1}    10.125.136.38:6633
17 ${CONTROLLER2}    10.125.136.43:6633
18 ${Controller1_IP}    10.125.136.38
19 ${Controller2_IP}    10.125.136.43
20 ${CTRL_USER}      odluser
21 ${FLOW}           "10.0.0.1"
22
23 *** Test Cases ***
24 Switches are introduced to both the controllers C1 & C2
25     [Documentation]    Switches are introduced to both the controllers C1 & C2
26     [Tags]    Set-Bridges
27     Switch Connection    1
28     ${stdout1}=    Execute Command    sudo ovs-vsctl set-controller s1 tcp:${CONTROLLER1} tcp:${CONTROLLER2}
29     ${stdout2}=    Execute Command    sudo ovs-vsctl set-controller s2 tcp:${CONTROLLER1} tcp:${CONTROLLER2}
30     ${stdout2}=    Execute Command    sudo ovs-vsctl set-controller s3 tcp:${CONTROLLER1} tcp:${CONTROLLER2}
31     ${stdout}=    Execute Command   sudo ovs-vsctl show
32     Should Contain X Times    ${stdout}    Controller "tcp:${CONTROLLER1}"  3
33     Should Contain X Times    ${stdout}    Controller "tcp:${CONTROLLER2}"  3
34     ${stdout}=    Execute Command   sudo ovs-vsctl get-controller "s1"
35     Should Contain     ${stdout}    ${CONTROLLER1}
36     Should Contain     ${stdout}    ${CONTROLLER2}
37     ${stdout}=    Execute Command   sudo ovs-vsctl get-controller "s2"
38     Should Contain     ${stdout}    ${CONTROLLER1}
39     Should Contain     ${stdout}    ${CONTROLLER2}
40     ${stdout}=    Execute Command   sudo ovs-vsctl get-controller "s3"
41     Should Contain     ${stdout}    ${CONTROLLER1}
42     Should Contain     ${stdout}    ${CONTROLLER2}
43
44
45 Verifying the topology in C1
46     [Documentation]    Get Topology for C1 and validate the result.
47     [Tags]    get
48     Create Session    session    http://${Controller1_IP}:8080   headers=${HEADERS}    auth=${auth}
49     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}
50     Sleep    10
51     Should Be Equal As Strings    ${resp.status_code}    200 
52     Log    ${resp.content}
53     Should Contain X Times  ${resp.content}   ${node1}   4
54     Should Contain X Times  ${resp.content}   ${node2}   2
55     Should Contain X Times  ${resp.content}   ${node3}   2
56
57 Verifying the topology in C2
58     [Documentation]    Get Topology for C2 and validate the result.
59     [Tags]    get
60     Create Session    session    http://${Controller2_IP}:8080   headers=${HEADERS}    auth=${auth}
61     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}
62     Sleep    10
63     Should Be Equal As Strings    ${resp.status_code}    200 
64     Log    ${resp.content}
65     Should Contain X Times  ${resp.content}   ${node1}   4
66     Should Contain X Times  ${resp.content}   ${node2}   2
67     Should Contain X Times  ${resp.content}   ${node3}   2
68