4e229b8aacc2d224eced5f759f52af3b162f5e3d
[integration/test.git] / tools / Robot_Tool / suites / cluster / 020__c1_fails.txt
1 *** Settings ***
2 Documentation     controller1 fails
3 Library           SSHLibrary
4 Library           Collections
5 Library           RequestsLibrary
6 Library           ../../libraries/Common.py
7 Variables         ../../variables/Variables.py
8
9 *** Variables ***
10 ${node1}   "00:00:00:00:00:00:00:01"
11 ${node2}   "00:00:00:00:00:00:00:02"
12 ${node3}   "00:00:00:00:00:00:00:03"
13 ${REST_CONTEXT}    /controller/nb/v2/topology
14 ${REST_CONTEXT_ST}    /controller/nb/v2/statistics
15 ${CONTROLLER1}    10.125.136.38:6633
16 ${CONTROLLER2}    10.125.136.43:6633
17 ${Controller1_IP}    10.125.136.38
18 ${Controller2_IP}    10.125.136.43
19 ${CTRL_USER}      odluser
20 ${FLOW}           "10.0.0.1"
21
22 *** Test Cases ***
23 C1 fails
24     [Documentation]    C1 fails suddenly
25     Open Connection    ${Controller1_IP}    prompt=$
26     Login With Public Key    odluser   ${USER_HOME}/.ssh/id_rsa   any
27     Write    cd controller-base/opendaylight
28     Write    ./run.sh -stop
29     Sleep    5
30     Read
31
32 C2 takes over and verifying the bridges
33     [Documentation]    C2 is taking over from c1 failure 
34     Switch Connection    1
35     ${stdout}=    Execute Command    sudo ovs-vsctl show
36     Read
37     Should Contain X Times    ${stdout}    Controller "tcp:${CONTROLLER2}"  3
38     Sleep    5
39     Should Contain X Times    ${stdout}    is_connected: true    3
40
41 Verifying the topology in C2
42     [Documentation]    Get Topology for C2 and validate the result.
43     [Tags]    get
44     Create Session    session    http://${Controller2_IP}:8080   headers=${HEADERS}    auth=${auth}
45     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}
46     Should Be Equal As Strings    ${resp.status_code}    200 
47     Log    ${resp.content}
48     Should Contain X Times  ${resp.content}   ${node1}   4
49     Should Contain X Times  ${resp.content}   ${node2}   2
50     Should Contain X Times  ${resp.content}   ${node3}   2
51
52 Check flow in flow stats in C2
53     [Documentation]    Checking the flow stats and validating the result in C2
54     [Tags]   get
55     Sleep   10
56     Create Session    session    http://${Controller2_IP}:8080   headers=${HEADERS}    auth=${auth}
57     ${resp}    Get    session    ${REST_CONTEXT_ST}/${CONTAINER}/flow
58     Should Be Equal As Strings    ${resp.status_code}    200 
59     Log    ${resp.content}
60     Should Contain    ${resp.content}    ${FLOW}
61
62
63
64
65
66
67