Add new tests to validate O1
[it/dep.git] / smo-install / test / pythonsdk / src / orantests / test_a1sim.py
1 #!/usr/bin/env python3
2 ###
3 # ============LICENSE_START=======================================================
4 # ORAN SMO PACKAGE - PYTHONSDK TESTS
5 # ================================================================================
6 # Copyright (C) 2021-2022 AT&T Intellectual Property. All rights
7 #                             reserved.
8 # ================================================================================
9 # Licensed under the Apache License, Version 2.0 (the "License");
10 # you may not use this file except in compliance with the License.
11 # You may obtain a copy of the License at
12 #
13 # http://www.apache.org/licenses/LICENSE-2.0
14 #
15 # Unless required by applicable law or agreed to in writing, software
16 # distributed under the License is distributed on an "AS IS" BASIS,
17 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 # See the License for the specific language governing permissions and
19 # limitations under the License.
20 # ============LICENSE_END============================================
21 # ===================================================================
22 #
23 ###
24
25 """A1Sim tests module."""
26 import logging
27 from onapsdk.configuration import settings
28 from oransdk.a1sim.a1sim import A1sim
29 from oransdk.utils.jinja import jinja_env
30
31 BASIC_AUTH = {}
32
33 logging.config.dictConfig(settings.LOG_CONFIG)
34 logger = logging.getLogger("test DMAAP")
35
36 def test_a1sim():
37     """Test the A1 sims."""
38     logger.info("Get ric version for ost")
39     a1sim = A1sim()
40     a1sim.check_version(settings.A1SIM_OSC_URL)
41     a1sim.check_status(settings.A1SIM_OSC_URL)
42     a1sim.get_policy_number(settings.A1SIM_OSC_URL)
43
44     data = jinja_env().get_template("OSC/policy_type.json.j2").render()
45     a1sim.create_policy_type(settings.A1SIM_OSC_URL, 1, data)