Allow containers to speciify command and arguement list
[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": ["/bin/sh"],
50             "args": ["-c", "/playpen/bin/container_start.sh"]
51         }
52     ],
53     "livenessProbe": {
54         "exec": {
55             "command": ["/usr/local/bin/health_ck"]
56         },
57         "initialDelaySeconds": 5,
58         "periodSeconds": 15
59     },
60     "readinessProbe": {
61         "httpGet": {
62             "path": "ric/v1/health/alive",
63             "port": 8080
64         },
65         "initialDelaySeconds": 5,
66         "periodSeconds": 15
67     },
68     "messaging": {
69         "ports": [
70             {
71                 "name": "http",
72                 "container": "mcxapp",
73                 "port": 8080,
74                 "description": "http service"
75             },
76             {
77                 "name": "rmr_data",
78                 "container": "mcxapp",
79                 "port": 4560,
80                 "description": "rmr data port for mcxapp"
81             },
82             {
83                 "name": "rmr_route",
84                 "container": "mcxapp",
85                 "port": 4561,
86                 "description": "rmr route port for mcxapp"
87             }
88         ],
89         "maxSize": 2072,
90         "numWorkers": 1,
91         "txMessages": [
92             "RIC_SUB_REQ",
93             "RIC_SUB_DEL_REQ"
94         ],
95         "rxMessages": [
96             "RIC_SUB_RESP",
97             "RIC_SUB_FAILURE",
98             "RIC_SUB_DEL_RESP",
99             "RIC_INDICATION"
100         ],
101         "policies": [1, 2]
102     },
103     "controls": {
104         "test": "test"
105     },
106     "metrics": [
107         {
108             "objectName": "UEEventStreamingCounters",
109             "objectInstance": "SgNBAdditionRequest",
110             "name": "SgNBAdditionRequest",
111             "type": "counter",
112             "description": "The total number of SG addition request events processed"
113         },
114         {
115             "objectName": "UEEventStreamingCounters",
116             "objectInstance": "SgNBAdditionRequestAcknowledge",
117             "name": "SgNBAdditionRequestAcknowledge",
118             "type": "counter",
119             "description": "The total number of SG addition request acknowledge events processed"
120         }
121     ]
122 }
123
124 mock_json_body_url = {
125     'config-file.json_url': 'http://0.0.0.0:8080/config-file.json',
126     'controls-schema.json_url': 'http://0.0.0.0:8080/schema.json'
127 }
128
129 mock_json_body_url_without_controls = {
130     'config-file.json_url': 'http://0.0.0.0:8080/config-file.json'
131 }
132
133 mock_json_body = {
134     "config-file.json": config_file,
135     "controls-schema.json": controls_schema_file
136 }
137
138 mock_json_body_without_controls = {
139     "config-file.json": config_file
140 }
141 helm_repo_index_response = {'apiVersion': 'v1',
142                             'entries': {
143                                 'test_xapp': [{
144                                     'apiVersion': 'v1',
145                                     'appVersion': '1.0',
146                                     'created': '2020-03-12T19:10:17.178396719Z',
147                                     'description': 'test xApp Helm Chart',
148                                     'digest': 'd77dfb3f008e5174e90d79bfe982ef85b5dc5930141f6a1bd9995b2fa35',
149                                     'name': 'test_xapp',
150                                     'urls': ['charts/test-1.0.0.tgz'],
151                                     'version': '1.0.0'
152                                 }]
153                             },
154                             'generated': '2020-03-16T16:54:44Z',
155                             'serverInfo': {}
156                             }