4fa42217c7b44b86fc48e444ae77f7181de2fcaa
[integration/test.git] / csit / suites / genius / __init__.robot
1 *** Settings ***
2 Documentation     Test suite for Inventory Scalability
3 Suite Setup       Start Suite
4 Suite Teardown    Stop Suite
5 Library           SSHLibrary
6 Variables         ../../variables/Variables.py
7 Resource          ../../libraries/Utils.robot
8 Library           re
9 Library           Collections
10 Library           string
11 Resource          ../../libraries/KarafKeywords.robot
12
13 *** Variables ***
14
15 *** Keywords ***
16 Start Suite
17     [Documentation]    Test suit for vpn service using mininet OF13 and OVS 2.3.1
18     Log    Start the tests
19     ${conn_id_1}=    Open Connection    ${TOOLS_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=30s
20     Set Global Variable    ${conn_id_1}
21     Login With Public Key    ${TOOLS_SYSTEM_USER}    ${USER_HOME}/.ssh/${SSH_KEY}    any
22     Log    ${conn_id_1}
23     Execute Command    sudo ovs-vsctl add-br BR1
24     Execute Command    sudo ovs-vsctl set bridge BR1 protocols=OpenFlow13
25     Execute Command    sudo ovs-vsctl set-controller BR1 tcp:${ODL_SYSTEM_IP}:6633
26     Execute Command    sudo ifconfig BR1 up
27     Execute Command    sudo ovs-vsctl add-port BR1 tap8ed70586-6c -- set Interface tap8ed70586-6c type=tap
28     Execute Command    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
29     ${output_1}    Execute Command    sudo ovs-vsctl show
30     Log    ${output_1}
31     ${check}    Wait Until Keyword Succeeds    30    10    check establishment    ${conn_id_1}    6633
32     log    ${check}
33     ${check_2}    Wait Until Keyword Succeeds    30    10    check establishment    ${conn_id_1}    6640
34     log    ${check_2}
35     Log    >>>>>Switch 2 configuration <<<<<
36     ${conn_id_2}=    Open Connection    ${TOOLS_SYSTEM_2_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=30s
37     Set Global Variable    ${conn_id_2}
38     Login With Public Key    ${TOOLS_SYSTEM_USER}    ${USER_HOME}/.ssh/${SSH_KEY}    any
39     Log    ${conn_id_2}
40     Execute Command    sudo ovs-vsctl add-br BR2
41     Execute Command    sudo ovs-vsctl set bridge BR2 protocols=OpenFlow13
42     Execute Command    sudo ovs-vsctl set-controller BR2 tcp:${ODL_SYSTEM_IP}:6633
43     Execute Command    sudo ifconfig BR2 up
44     Execute Command    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
45     ${output_2}    Execute Command    sudo ovs-vsctl show
46     Log    ${output_2}
47
48 Stop Suite
49     Log    Stop the tests
50     Switch Connection    ${conn_id_1}
51     Log    ${conn_id_1}
52     Execute Command    sudo ovs-vsctl del-br BR1
53     Execute Command    sudo ovs-vsctl del-manager
54     Write    exit
55     close connection
56     Switch Connection    ${conn_id_2}
57     Log    ${conn_id_2}
58     Execute Command    sudo ovs-vsctl del-br BR2
59     Execute Command    sudo ovs-vsctl del-manager
60     Write    exit
61     close connection
62
63 check establishment
64     [Arguments]    ${conn_id}    ${port}
65     Switch Connection    ${conn_id}
66     ${check_establishment}    Execute Command    netstat -anp | grep ${port}
67     Should contain    ${check_establishment}    ESTABLISHED
68     [Return]    ${check_establishment}