X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=it%2Fdep.git;a=blobdiff_plain;f=smo-install%2Ftest%2Fpythonsdk%2Fsrc%2Forantests%2Fnetwork_slicing%2Fpreparation%2Faai_preparation.py;fp=smo-install%2Ftest%2Fpythonsdk%2Fsrc%2Forantests%2Fnetwork_slicing%2Fpreparation%2Faai_preparation.py;h=6ba270f0f845e8e302fd7a98c72f3f6be936e513;hp=0000000000000000000000000000000000000000;hb=bc6231f7d4d44ab5f269683c42eb90c2ce4ec9a6;hpb=f97b292fa01903c18b71ec8a549824c7ec3bea93 diff --git a/smo-install/test/pythonsdk/src/orantests/network_slicing/preparation/aai_preparation.py b/smo-install/test/pythonsdk/src/orantests/network_slicing/preparation/aai_preparation.py new file mode 100644 index 00000000..6ba270f0 --- /dev/null +++ b/smo-install/test/pythonsdk/src/orantests/network_slicing/preparation/aai_preparation.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 +### +# ============LICENSE_START=================================================== +# ORAN SMO PACKAGE - PYTHONSDK TESTS +# ================================================================================ +# Copyright (C) 2022 AT&T Intellectual Property. All rights +# reserved. +# ============================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END===================================================== +# +### +"""Configure AAI for Network Slicing option2 test.""" +import logging +import logging.config + +from onapsdk.aai.business.customer import Customer +from onapsdk.configuration import settings + +logging.config.dictConfig(settings.LOG_CONFIG) +logger = logging.getLogger("####################### Start AAI Preparation") + +class AaiPreparation(): + """Can be used to prepare AAI for Network Slicing usecase option2.""" + + @classmethod + def prepare_aai(cls): + """Prepare AAI for network slicing use case.""" + logger.info("####################### Start to prepare AAI") + aai = Customer("5GCustomer", "5GCustomer", "INFRA") + aai.create("5GCustomer", "5GCustomer", "INFRA") + aai.subscribe_service("5G") + + @classmethod + def cleanup_aai(cls): + """Clean up AAI settings.""" + logger.info("####################### Start to clean up AAI settings") + aai = Customer.get_by_global_customer_id("5GCustomer") + aai.delete()