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