1 # Copyright (c) 2019 AT&T Intellectual Property.
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
20 ${XAppNS} urn:o-ran:ric:xapp-desc:1.0
21 ${NetconfNS} urn:ietf:params:xml:ns:netconf:base:1.0
22 ${ricXML} = <ric xmlns="${XAppNS}"></ric>
23 ${configXML} <config xmlns="${NetconfNS}">${ricXML}</config>
31 ... ${host}=service-ricplt-o1mediator-tcp-netconf.ricplt
33 ... ${hostkey_verify}=${False}
35 ${status} = Connect host=${host}
38 ... password=${password}
39 ... key_filename=${key}
40 ... look_for_keys=False
45 [Arguments] ${session}
46 # this doesn't actually seem to result in filtered XML,
47 # but it matches what the O1 CLI does.
48 ${filter} = Parse XML ${ricXML}
49 ${config} = Get ${session} filter_criteria=${filter}
52 Retrieve O1 Running Configuration
53 [Arguments] ${session}
54 ${config} = Get Config ${session} running
57 Deploy An XApp Using O1
58 [Arguments] ${session} ${app} ${version}
59 ${xappCreateXML} = Generate XApp Deployment XML ${app} ${version} create
60 Edit Config ${session} running ${xappCreateXML}
62 Remove An XApp Using O1
63 [Arguments] ${session} ${app} ${version}
64 ${xappDeleteXML} = Generate XApp Deployment XML ${app} ${version} delete
65 Edit Config ${session} running ${xappDeleteXML}
68 [Arguments] ${session}
69 Close Session ${session}
72 Generate XApp Deployment XML
73 [Arguments] ${name} ${version} ${operation}
74 ${XML} = Parse XML ${configXML}
76 ... <xapps xmlns="${XAppNS}"></xapps>
78 Add Element ${XML} <xapp xmlns:xc="${NetconfNS}" xc:operation="${operation}"></xapp>
81 ... <name>${name}</name>
82 ... xpath=ric/xapps/xapp
83 Add Element ${XML} <release-name>xapp-${name}</release-name>
84 ... xpath=ric/xapps/xapp
85 Add Element ${XML} <version>${version}</version>
86 ... xpath=ric/xapps/xapp
87 Add Element ${XML} <namespace>${GLOBAL_XAPP_NAMESPACE}</namespace>
88 ... xpath=ric/xapps/xapp