094595c3bc6c7b4d50299069664a7dfeabc1cabc
[it/dev.git] / xapp_onboarder / tests / constants.py
1 ################################################################################
2 #   Copyright (c) 2020 AT&T Intellectual Property.                             #
3 #                                                                              #
4 #   Licensed under the Apache License, Version 2.0 (the "License");            #
5 #   you may not use this file except in compliance with the License.           #
6 #   You may obtain a copy of the License at                                    #
7 #                                                                              #
8 #       http://www.apache.org/licenses/LICENSE-2.0                             #
9 #                                                                              #
10 #   Unless required by applicable law or agreed to in writing, software        #
11 #   distributed under the License is distributed on an "AS IS" BASIS,          #
12 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
13 #   See the License for the specific language governing permissions and        #
14 #   limitations under the License.                                             #
15 ################################################################################
16
17 controls_schema_file = {
18     "$schema": "http://json-schema.org/draft-07/schema#",
19     "$id": "#/controls",
20     "type": "object",
21     "title": "Controls Section Schema",
22     "required": [
23         "test"
24     ],
25     "properties": {
26         "test": {
27             "$id": "#/controls/test",
28             "type": "string",
29             "title": "test",
30             "default": "test",
31             "examples": [
32                 "test"
33             ]
34         }
35     }
36 }
37
38 config_file = {
39     "xapp_name": "test_xapp",
40     "version": "1.0.0",
41     "containers": [
42         {
43             "name": "mcxapp",
44             "image": {
45                 "registry": "nexus3.o-ran-sc.org:10002",
46                 "name": "o-ran-sc/ric-app-mc",
47                 "tag": "1.0.2"
48             },
49             "command": "/playpen/bin/container_start.sh"
50         }
51     ],
52     "livenessProbe": {
53         "exec": {
54             "command": ["/usr/local/bin/health_ck"]
55         },
56         "initialDelaySeconds": 5,
57         "periodSeconds": 15
58     },
59     "readinessProbe": {
60         "httpGet": {
61             "path": "ric/v1/health/alive",
62             "port": 8080
63         },
64         "initialDelaySeconds": 5,
65         "periodSeconds": 15
66     },
67     "messaging": {
68         "ports": [
69             {
70                 "name": "http",
71                 "container": "mcxapp",
72                 "port": 8080,
73                 "description": "http service"
74             },
75             {
76                 "name": "rmr_data",
77                 "container": "mcxapp",
78                 "port": 4560,
79                 "description": "rmr data port for mcxapp"
80             },
81             {
82                 "name": "rmr_route",
83                 "container": "mcxapp",
84                 "port": 4561,
85                 "description": "rmr route port for mcxapp"
86             }
87         ],
88         "maxSize": 2072,
89         "numWorkers": 1,
90         "txMessages": [
91             "RIC_SUB_REQ",
92             "RIC_SUB_DEL_REQ"
93         ],
94         "rxMessages": [
95             "RIC_SUB_RESP",
96             "RIC_SUB_FAILURE",
97             "RIC_SUB_DEL_RESP",
98             "RIC_INDICATION"
99         ],
100         "policies": [1, 2]
101     },
102     "controls": {
103         "test": "test"
104     },
105     "metrics": [
106         {
107             "objectName": "UEEventStreamingCounters",
108             "objectInstance": "SgNBAdditionRequest",
109             "name": "SgNBAdditionRequest",
110             "type": "counter",
111             "description": "The total number of SG addition request events processed"
112         },
113         {
114             "objectName": "UEEventStreamingCounters",
115             "objectInstance": "SgNBAdditionRequestAcknowledge",
116             "name": "SgNBAdditionRequestAcknowledge",
117             "type": "counter",
118             "description": "The total number of SG addition request acknowledge events processed"
119         }
120     ]
121 }
122
123 mock_json_body_url = {
124     'config-file.json_url': 'http://0.0.0.0:8080/config-file.json',
125     'controls-schema.json_url': 'http://0.0.0.0:8080/schema.json'
126 }
127
128 mock_json_body_url_without_controls = {
129     'config-file.json_url': 'http://0.0.0.0:8080/config-file.json'
130 }
131
132 mock_json_body = {
133     "config-file.json": config_file,
134     "controls-schema.json": controls_schema_file
135 }
136
137 mock_json_body_without_controls = {
138     "config-file.json": config_file
139 }
140 helm_repo_index_response = {'apiVersion': 'v1',
141                             'entries': {
142                                 'test_xapp': [{
143                                     'apiVersion': 'v1',
144                                     'appVersion': '1.0',
145                                     'created': '2020-03-12T19:10:17.178396719Z',
146                                     'description': 'test xApp Helm Chart',
147                                     'digest': 'd77dfb3f008e5174e90d79bfe982ef85b5dc5930141f6a1bd9995b2fa35',
148                                     'name': 'test_xapp',
149                                     'urls': ['charts/test-1.0.0.tgz'],
150                                     'version': '1.0.0'
151                                 }]
152                             },
153                             'generated': '2020-03-16T16:54:44Z',
154                             'serverInfo': {}
155                             }