Upgrade RF syntax for v3.2 compatibility
[integration/test.git] / csit / suites / groupbasedpolicy / GBPSFC / 6-node / demo-symmetric-chain / 010_set_odl.robot
1 *** Settings ***
2 Documentation     Test suite for setting up infrastructure for demo-symmetric-chain
3 Suite Setup       Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
4 Suite Teardown    Delete All Sessions
5 Library           RequestsLibrary
6 Library           OperatingSystem
7 Variables         ../../../../../variables/Variables.py
8 Resource          ../../../../../libraries/SSHKeywords.robot
9 Resource          ../Variables.robot
10 Resource          ../../../../../libraries/GBP/OpenFlowUtils.robot
11
12 *** Test Cases ***
13 Put Service Functions
14     [Documentation]    Register Service Functions to ODL
15     ${json_to_edit}    OperatingSystem.Get File    ${SF_FILE}
16     ${edited_json}    Replace String    ${json_to_edit}    _SF1    ${GBPSFC3}
17     ${edited_json}    Replace String    ${edited_json}    _SF2    ${GBPSFC5}
18     Add Elements To URI And Verify    ${SF_PATH}    ${edited_json}    ${HEADERS_YANG_JSON}
19
20 Put Service Function Forwarders
21     [Documentation]    Register Service Function Forwarders to ODL
22     ${json_to_edit}    OperatingSystem.Get File    ${SFF_FILE}
23     ${edited_json}    Replace String    ${json_to_edit}    _SFF1    ${GBPSFC2}
24     ${edited_json}    Replace String    ${edited_json}    _SFF2    ${GBPSFC4}
25     Add Elements To URI And Verify    ${SFF_PATH}    ${edited_json}    ${HEADERS_YANG_JSON}
26
27 Wait For Manager and Switch Connected on GBPSFC2
28     [Documentation]    Making sure that manager is connected for further processing.
29     SSHLibrary.Open Connection    ${GBPSFC2}
30     SSHKeywords.Flexible Mininet Login
31     Wait Until Keyword Succeeds    2min    3s    Manager and Switch Connected    sw_name=sw2
32     SSHLibrary.Close Connection
33
34 Wait For Manager and Switch Connected on GBPSFC4
35     [Documentation]    Making sure that manager is connected for further processing.
36     SSHLibrary.Open Connection    ${GBPSFC4}
37     SSHKeywords.Flexible Mininet Login
38     Wait Until Keyword Succeeds    2min    3s    Manager and Switch Connected    sw_name=sw4
39     SSHLibrary.Close Connection
40
41 Put Service Function Chains
42     [Documentation]    Register Service Function Chains to ODL
43     Add Elements To URI From File And Verify    ${SFC_PATH}    ${SFC_SYMM_FILE}    ${HEADERS_YANG_JSON}
44
45 Put Service Function Paths
46     [Documentation]    Register Service Function Paths to ODL
47     Add Elements To URI From File And Verify    ${SFP_PATH}    ${SFP_SYMM_FILE}    ${HEADERS_YANG_JSON}
48
49 Put Tunnels
50     [Documentation]    Send tunnel augmentation to ODL
51     ${json_to_edit}    OperatingSystem.Get File    ${TUNNELS_FILE}
52     ${edited_json}    Replace String    ${json_to_edit}    _CLASSIFIER1    ${GBPSFC1}
53     ${edited_json}    Replace String    ${edited_json}    _CLASSIFIER2    ${GBPSFC6}
54     Add Elements To URI And Verify    ${TUNNELS_PATH}    ${edited_json}    ${HEADERS_YANG_JSON}
55
56 Put Tenant
57     [Documentation]    Send Tenant Data to ODL
58     Add Elements To URI From File And Verify    ${TENANT_PATH}    ${TENANT_SYMM_FILE}    ${HEADERS_YANG_JSON}
59
60 Register Endpoints
61     [Documentation]    Endpoints registration
62     @{endpoint_files} =    OperatingSystem.List Files In Directory    ${ENDPOINTS_SYMM_DIR}    vethl*.*json    absolute
63     FOR    ${endpoint_file}    IN    @{endpoint_files}
64         Post Elements To URI From File    ${ENDPOINT_REG_PATH}    ${endpoint_file}    ${HEADERS_YANG_JSON}
65     END
66     ${resp}    RequestsLibrary.Get Request    session    ${ENDPOINTS_OPER_PATH}
67     Log    ${resp.content}