Step 1: Move vm scripts to the right place
[integration/test.git] / test / tools / Robot_Tool / suites / ha / 025__two_controllers_fail.txt
1 *** Settings ***
2 Documentation     ODL controller clustering test case using the gherkin syntax.
3 ...
4 ...               This test has a workflow similar to the keyword-driven
5 ...               examples. The difference is that the keywords use higher
6 ...               abstraction level and their arguments are embedded into
7 ...               the keyword names.
8 ...
9 ...               This kind of _gherkin_ syntax has been made popular by
10 ...               [http://cukes.info|Cucumber]. It works well especially when
11 ...               tests act as examples that need to be easily understood also
12 ...               by the business people.
13 Resource          resource.txt
14 Library           Selenium2Library
15 Library           SSHLibrary
16 Library           Collections
17 Library           RequestsLibrary
18 Library           ../../libraries/Common.py
19 Variables         ../../variables/Variables.py
20
21
22 *** Test Cases ***
23 Controller1 and Controller2 fail
24     Given C1 a controller in cluster of two controllers
25     And C2 a controllers in cluster of two controllers
26     And all switches are introduced to both controllers
27     When C1 goes down
28     And C2 goes down
29     Then the system does not work any more
30
31
32 *** Keywords ***
33 C1 goes down
34     Open Connection    ${Controller1_IP}    prompt=>
35     Login    ${VM USERNAME}    ${VM PASSWORD}
36     Write    cd controller-base/opendaylight
37     Write    sudo ./run.sh -stop
38     Set Selenium Speed    ${DELAY2}
39     Open Browser    ${LOGIN URL1}    ${BROWSER}
40     Maximize Browser Window
41     Set Selenium Speed    ${DELAY}
42     Location Should Be    ${ERROR URL1}
43     Title Should Be    Problem loading page
44     [Teardown]    Close Browser
45
46 C2 goes down
47     Open Connection    ${Controller2_IP}    prompt=>
48     Login    ${VM USERNAME}    ${VM PASSWORD}
49     Write    cd controller-base/opendaylight
50     Write    sudo ./run.sh -stop
51     Set Selenium Speed    ${DELAY2}
52     Open Browser    ${LOGIN URL2}    ${BROWSER}
53     Maximize Browser Window
54     Set Selenium Speed    ${DELAY}
55     Location Should Be    ${ERROR URL2}
56     Title Should Be    Problem loading page
57     [Teardown]    Close Browser
58
59
60 C1 a controller in cluster of two controllers
61 #    Open Connection    ${Controller1_IP}    prompt=>
62 #    Login    ${VM USERNAME}    ${VM PASSWORD}
63 #    Write    cd controller-base/opendaylight
64 #    Write    sudo ./run.sh -Dsupernodes=${Controller1_IP}:${Controller2_IP} -start
65     Open Connection    ${HOST}
66     Login    ${VM USERNAME}    ${VM PASSWORD}
67     ${stdout}=    Execute Command    sudo ovs-vsctl show
68     Should Contain X Times    ${stdout}    Controller "tcp:${CONTROLLER1}"  3
69     
70
71
72 C2 a controller in cluster of two controllers
73 #    Open Connection    ${Controller2_IP}    prompt=>
74 #    Login    ${VM USERNAME}    ${VM PASSWORD}
75 #    Write    cd controller-base/opendaylight
76 #    Write    sudo ./run.sh -Dsupernodes=${Controller1_IP}:${Controller2_IP} -start
77     Open Connection    ${HOST}
78     Login    ${VM USERNAME}    ${VM PASSWORD}
79     ${stdout}=    Execute Command    sudo ovs-vsctl show
80     Should Contain X Times    ${stdout}    Controller "tcp:${CONTROLLER2}"  3    
81
82
83 all switches are introduced to both controllers
84     Open Connection    ${HOST}
85     Login    ${VM USERNAME}    ${VM PASSWORD}
86 #   ${stdout1}=    Execute Command    sudo ovs-vsctl set-controller s1 tcp:${CONTROLLER1} tcp:${CONTROLLER2}
87 #   ${stdout2}=    Execute Command    sudo ovs-vsctl set-controller s2 tcp:${CONTROLLER1} tcp:${CONTROLLER2}
88 #   ${stdout2}=    Execute Command    sudo ovs-vsctl set-controller s3 tcp:${CONTROLLER1} tcp:${CONTROLLER2}
89     ${stdout}=    Execute Command   sudo ovs-vsctl show
90     Should Contain X Times    ${stdout}    Controller "tcp:${CONTROLLER1}"  3
91     Should Contain X Times    ${stdout}    Controller "tcp:${CONTROLLER2}"  3
92     Should Contain     ${stdout}    Bridge "s1"
93     Should Contain     ${stdout}    Bridge "s2"
94     Should Contain     ${stdout}    Bridge "s3"
95     Should Contain X Times    ${stdout}    is_connected: true    6
96     ${stdout}=    Execute Command   sudo ovs-vsctl get-controller "s1"
97     Should Contain     ${stdout}    ${CONTROLLER1}
98     Should Contain     ${stdout}    ${CONTROLLER2}
99     ${stdout}=    Execute Command   sudo ovs-vsctl get-controller "s2"
100     Should Contain     ${stdout}    ${CONTROLLER1}
101     Should Contain     ${stdout}    ${CONTROLLER2}
102     ${stdout}=    Execute Command   sudo ovs-vsctl get-controller "s3"
103     Should Contain     ${stdout}    ${CONTROLLER1}
104     Should Contain     ${stdout}    ${CONTROLLER2}
105                 
106
107 the system does not work any more
108     Open Connection    ${HOST}
109     Login    ${VM USERNAME}    ${VM PASSWORD}
110     ${stdout}=    Execute Command   sudo ovs-vsctl show
111     Should Not Contain    ${stdout}    is_connected: true 
112
113