Step 1: Move vm scripts to the right place
[integration/test.git] / tools / Robot_Tool / suites / cluster / 025__c2_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 recovers from failure
24     [Documentation]    C1 recovers from failure
25     Switch Connection    2
26     Write    cd controller-base/opendaylight
27     Write    ./run.sh -start
28     Sleep    60
29     Read
30
31 C2 fails
32     [Documentation]    C2 fails suddenly
33     Open Connection    ${Controller2_IP}    prompt=$
34     Login With Public Key    odluser   ${USER_HOME}/.ssh/id_rsa   any
35     Write    cd controller-base/opendaylight
36     Write    ./run.sh -stop
37     Sleep    5
38     Read
39
40 C1 takes over and verifying the bridges
41     [Documentation]    C1 is taking over from C2 
42     Switch Connection    1
43     ${stdout}=    Execute Command    sudo ovs-vsctl show
44     Read
45     Should Contain X Times    ${stdout}    Controller "tcp:${CONTROLLER1}"  3
46     Should Contain X Times    ${stdout}    Controller "tcp:${CONTROLLER2}"  3
47
48 Verifying the topology in C1
49     [Documentation]    Get Topology for C1 and validate the result.
50     [Tags]    get
51     Create Session    session    http://${Controller1_IP}:8080   headers=${HEADERS}    auth=${auth}
52     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}
53     Should Be Equal As Strings    ${resp.status_code}    200 
54     Log    ${resp.content}
55     Should Contain X Times  ${resp.content}   ${node1}   4
56     Should Contain X Times  ${resp.content}   ${node2}   2
57     Should Contain X Times  ${resp.content}   ${node3}   2
58
59 Check flow in flow stats in C1
60     [Documentation]    Checking the flow stats and validating the result in C1
61     [Tags]   get
62     Sleep   10
63     ${resp}    Get    session    ${REST_CONTEXT_ST}/${CONTAINER}/flow
64     Should Be Equal As Strings    ${resp.status_code}    200 
65     Log    ${resp.content}
66     Should Contain    ${resp.content}    ${FLOW}
67
68
69
70
71