Remove suites for netvirt
[integration/test.git] / csit / suites / groupbasedpolicy / GBPSFC / 6-node / __init__.robot
1 *** Settings ***
2 Documentation       Setup/teardown for GBPSFC 6-node topology
3
4 Library             SSHLibrary
5 Library             RequestsLibrary
6 Resource            ../../../../libraries/Utils.robot
7 Resource            ../../../../libraries/GBP/ConnUtils.robot
8 Resource            Variables.robot
9 Variables           ../../../../variables/Variables.py
10
11 Suite Setup         Setup Everything
12 Suite Teardown      Teardown Everything
13
14
15 *** Variables ***
16 ${timeout}      10s
17
18
19 *** Keywords ***
20 Setup Everything
21     [Documentation]    Initial setup of remote VM. Copying of scripts and installation python packages to virtual env if missing.
22     Create Session    session    http://${ODL}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
23     Wait Until Keyword Succeeds
24     ...    10x
25     ...    30 s
26     ...    Get Data From URI
27     ...    session
28     ...    ${OF_OVERLAY_CONFIG_PATH}
29     ...    headers=${headers}
30     Delete All Sessions
31     FOR    ${GBPSFC}    IN    @{GBPSFCs}
32         ConnUtils.Connect and Login    ${GBPSFC}    timeout=${timeout}
33         # TODO if something extra needs to be installed, please do it in virt-env
34         ${stderr}    SSHLibrary.Execute Command
35         ...    virtualenv --system-site-packages ${VE_DIR}
36         ...    return_stdout=False
37         ...    return_stderr=True
38         ...    return_rc=False
39         Should Be Empty    ${stderr}
40         SSHLibrary.Put File
41         ...    ${CURDIR}/../../common_scripts/*
42         ...    ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER}/
43         ...    mode=0755
44         ${stdout}    ${stderr}    ${rc}    ConnUtils.Execute in VE
45         ...    pip freeze | grep ipaddr -q || pip install ipaddr
46         ...    timeout=${timeout}
47         Should Be Equal As Numbers    ${rc}    0
48         SSHLibrary.Close Connection
49     END
50     Set ODL Variables
51
52 Teardown Everything
53     [Documentation]    Clearing remote VM - removing copied scripts.
54     Log    stop_suite_in_6_node
55     FOR    ${GBPSFC}    IN    @{GBPSFCs}
56         ConnUtils.Connect and Login    ${GBPSFC}    timeout=${timeout}
57         SSHLibrary.Execute Command    sudo rm -rf ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER}
58         SSHLibrary.Close Connection
59     END