1 # Copyright (c) 2019 AT&T Intellectual Property.
2 # Copyright (c) 2020 HCL Technologies Limited.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 Library XML use_lxml=True
17 Library NcclientLibrary
19 Resource /robot/resources/global_properties.robot
20 Resource /robot/resources/ric/ric_utils.robot
23 ${XAppNS} urn:o-ran:ric:xapp-desc:1.0
24 ${NetconfNS} urn:ietf:params:xml:ns:netconf:base:1.0
25 ${ricXML} = <ric xmlns="${XAppNS}"></ric>
26 ${configXML} <config xmlns="${NetconfNS}">${ricXML}</config>
27 ${O1MEDIATOR_ENDPOINT} ${GLOBAL_O1MEDIATOR_SERVER_PROTOCOL}://${GLOBAL_O1MEDIATOR_HTTP_SERVER}:${GLOBAL_O1MEDIATOR_SERVER_PORT}
30 Run o1mediator Health Check
31 [Documentation] Runs O1Mediator Health check
32 ${resp} = Run Keyword Run o1mediator GET Request
34 Run o1mediator GET Request
35 [Documentation] Make an HTTP GET request against the XApp manager
36 [Arguments] ${path}=${EMPTY}
37 ${session} = Create Session roboo1mediatorGet ${O1MEDIATOR_ENDPOINT}
38 ${headers} = Create Dictionary Accept=application/json Content-Type=application/json
39 ${resp} = Get Request roboo1mediatorGet ${O1MEDIATOR_ENDPOINT} headers=${headers}
47 ... ${host}=service-ricplt-o1mediator-tcp-netconf.ricplt
49 ... ${hostkey_verify}=${False}
51 ${status} = Connect host=${host}
54 ... password=${password}
55 ... key_filename=${key}
56 ... look_for_keys=False
61 [Arguments] ${session}
62 # this doesn't actually seem to result in filtered XML,
63 # but it matches what the O1 CLI does.
64 ${filter} = Parse XML ${ricXML}
65 ${config} = Get ${session} filter_criteria=${filter}
68 Retrieve O1 Running Configuration
69 [Arguments] ${session}
70 ${config} = Get Config ${session} running
73 Deploy An XApp Using O1
74 [Arguments] ${session} ${app} ${version}
75 ${xappCreateXML} = Generate XApp Deployment XML ${app} ${version} create
76 Edit Config ${session} running ${xappCreateXML}
78 Remove An XApp Using O1
79 [Arguments] ${session} ${app} ${version}
80 ${xappDeleteXML} = Generate XApp Deployment XML ${app} ${version} delete
81 Edit Config ${session} running ${xappDeleteXML}
84 [Arguments] ${session}
85 Close Session ${session}
88 Generate XApp Deployment XML
89 [Arguments] ${name} ${version} ${operation}
90 ${XML} = Parse XML ${configXML}
92 ... <xapps xmlns="${XAppNS}"></xapps>
94 Add Element ${XML} <xapp xmlns:xc="${NetconfNS}" xc:operation="${operation}"></xapp>
97 ... <name>${name}</name>
98 ... xpath=ric/xapps/xapp
99 Add Element ${XML} <release-name>xapp-${name}</release-name>
100 ... xpath=ric/xapps/xapp
101 Add Element ${XML} <version>${version}</version>
102 ... xpath=ric/xapps/xapp
103 Add Element ${XML} <namespace>${GLOBAL_XAPP_NAMESPACE}</namespace>
104 ... xpath=ric/xapps/xapp