Replace deprecated variables in suites/sfc (1).
[integration/test.git] / csit / suites / sfc / Clustering_Datastore / 020_simple_clustering.robot
1 *** Settings ***
2 Documentation     Test suite for GBP Tenants, Operates functions from Restconf APIs.
3 Suite Teardown    Delete All Sessions
4 Library           RequestsLibrary
5 Library           SSHLibrary
6 Library           Collections
7 Library           OperatingSystem
8 Variables         ../../../variables/Variables.py
9 Resource          ../../../libraries/Utils.robot
10
11 *** Variables ***
12 ${SFC_API}        /restconf/config/service-function:service-functions
13 ${SFC_FUNCTIONS_FILE}    ${CURDIR}/../../../variables/sfc/service-functions.json
14
15 *** Test Cases ***
16 Add Service Functions To One Node
17     [Documentation]    Add service functions from JSON file
18     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
19     ${jsonbody}    Read JSON From File    ${SFC_FUNCTIONS_FILE}
20     Add Elements To URI From File    ${SFC__API}    ${SFC_FUNCTIONS_FILE}
21     ${resp}    RequestsLibrary.Get    session    ${SFC_API}
22     Should Be Equal As Strings    ${resp.status_code}    200
23     ${result}    To JSON    ${resp.content}
24     Lists Should be Equal    ${result}    ${jsonbody}
25
26 Read Service Functions From Other Node
27     Create Session    session    http://${ODL_SYSTEM_2_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
28     ${jsonbody}    Read JSON From File    ${SFC_FUNCTIONS_FILE}
29     ${resp}    RequestsLibrary.Get    session    ${SFC_API}
30     Should Be Equal As Strings    ${resp.status_code}    200
31     ${result}    To JSON    ${resp.content}
32     Lists Should be Equal    ${result}    ${jsonbody}
33
34 *** Keywords ***
35 Read JSON From File
36     [Arguments]    ${filepath}
37     ${body}    OperatingSystem.Get File    ${filepath}
38     ${jsonbody}    To Json    ${body}
39     [Return]    ${jsonbody}