Upgrade RF syntax for v3.2 compatibility
[integration/test.git] / csit / suites / groupbasedpolicy / GBP / 3-node / gbp2-multitenant / 001_set_odl.robot
1 *** Settings ***
2 Documentation     Test suite for GBP Tenants, Operates functions from Restconf APIs.
3 Suite Setup       Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
4 Suite Teardown    Delete All Sessions
5 Default Tags      multi-tenant    setup    multi-tenant-setup
6 Library           RequestsLibrary
7 Library           OperatingSystem
8 Variables         ../../../../../variables/Variables.py
9 Resource          ../../../../../libraries/Utils.robot
10 Resource          ../Variables.robot
11
12 *** Variables ***
13
14 *** Test Cases ***
15 Put Tunnels
16     [Documentation]    Send tunnel augmentation to ODL
17     ${json_to_edit}    OperatingSystem.Get File    ${TUNNELS_FILE}
18     ${edited_json}    Replace String    ${json_to_edit}    _CLASSIFIER1    ${GBP1}
19     ${edited_json}    Replace String    ${edited_json}    _CLASSIFIER2    ${GBP2}
20     ${edited_json}    Replace String    ${edited_json}    _CLASSIFIER3    ${GBP3}
21     Add Elements To URI And Verify    ${TUNNELS_PATH}    ${edited_json}    ${HEADERS_YANG_JSON}
22
23 Register Endpoints
24     [Documentation]    Endpoints registration
25     @{endpoint_files} =    OperatingSystem.List Files In Directory    ${ENDPOINTS_GBP2_DIR}    vethl*.*json    absolute
26     FOR    ${endpoint_file}    IN    @{endpoint_files}
27         Post Elements To URI From File    ${ENDPOINT_REG_PATH}    ${endpoint_file}    ${HEADERS_YANG_JSON}
28     END
29
30 Put Tenants
31     [Documentation]    Send GBP policy to ODL
32     Add Elements To URI From File    ${TENANT1_PATH}    ${TENANT1_FILE}    ${HEADERS_YANG_JSON}
33     Add Elements To URI From File    ${TENANT2_PATH}    ${TENANT2_FILE}    ${HEADERS_YANG_JSON}