Merge "Reworked FlowConfigBlaster to be able to batch multiple flows in a single...
[integration.git] / test / csit / libraries / ConfigViaRestconf.robot
1 *** Settings ***
2 Documentation     Robot keyword library (Resource) for runtime changes to config subsystem state using restconf calls.
3 ...
4 ...               Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
5 ...
6 ...               This program and the accompanying materials are made available under the
7 ...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
8 ...               and is available at http://www.eclipse.org/legal/epl-v10.html
9 Library           ${CURDIR}/RequestsLibrary.py
10 Variables         ${CURDIR}/../variables/Variables.py
11
12 *** Keywords ***
13 Setup_Config_Via_Restconf
14     [Documentation]    Creates Requests session to be used by subsequent keywords.
15     # Do not append slash at the end uf URL, Requests would add another, resulting in error.
16     Create_Session    cvr_session    http://${CONTROLLER}:${RESTCONFPORT}/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount    headers=${HEADERS_XML}    auth=${AUTH}
17
18 Teardown_Config_Via_Restconf
19     [Documentation]    Teardown to pair with Setup (otherwise no-op).
20     Log    TODO: The following line does not seem to be implemented by RequestsLibrary. Look for a workaround.
21     # Delete_Session    cvr_session
22
23 Post_Xml_Config_Module_Via_Restconf
24     [Arguments]    ${xml_data}
25     [Documentation]    Post new XML configuration to config:modules
26     # Also no slash here
27     Post_Xml_Config_Via_Restconf    config:modules    ${xml_data}
28
29 Post_Xml_Config_Service_Via_Restconf
30     [Arguments]    ${xml_data}
31     [Documentation]    Post new XML configuration to config:services
32     Post_Xml_Config_Via_Restconf    config:services    ${xml_data}
33
34 Post_Xml_Config_Via_Restconf
35     [Arguments]    ${uri_part}    ${xml_data}
36     [Documentation]    Post XML data to given controller-config URI, check reponse text is empty and status_code is 204.
37     ${response}=    RequestsLibrary.Post    cvr_session    ${uri_part}    data=${xml_data}
38     Log    ${response.text}
39     Should_Be_Empty    ${response.text}
40     Should_Be_Equal_As_Strings    ${response.status_code}    204