From ccb4a69e473cab6db7e8d52a04f9b4922528e24f Mon Sep 17 00:00:00 2001 From: Tommy Carpenter Date: Thu, 2 Jan 2020 14:38:21 -0500 Subject: [PATCH] A1 v2.1.0 * Represents a resillent version of 2.0.0 that uses Redis for persistence * Now relies on SDL and dbaas; SDL is the python interface library to dbaas * Adds a 503 http code to nearly all http methods, as A1 now depends on an upstream system * Integration tests have a copy of a dbaas helm chart, however the goal is to simplify that deployment per RIC-45 * Unit tests have a mockup of SDL, however again the goal is to simplify as SDL grows per RIC-44 Change-Id: I703a60788c98dc81218dbe5275fb3899635ec26d Signed-off-by: Tommy Carpenter --- a1/controller.py | 18 +++++-- a1/data.py | 26 ++++++---- a1/openapi.yaml | 27 +++++++++-- container-tag.yaml | 2 +- docs/release-notes.rst | 11 +++-- integration_tests/a1mediator/Chart.yaml | 2 +- .../a1mediator/templates/deployment.yaml | 5 ++ integration_tests/dbaas-service/Chart.yaml | 25 ++++++++++ integration_tests/dbaas-service/README | 1 + .../dbaas-service/templates/deployment.yaml | 39 +++++++++++++++ .../dbaas-service/templates/service.yaml | 30 ++++++++++++ integration_tests/dbaas-service/values.yaml | 30 ++++++++++++ integration_tests/getlogs.sh | 7 ++- setup.py | 17 +++++-- tests/a1test_helpers.py | 55 ++++++++++++++++++++++ tests/test_controller.py | 20 ++++++-- tests/test_data.py | 11 +++-- tox-integration.ini | 7 ++- 18 files changed, 296 insertions(+), 37 deletions(-) create mode 100644 integration_tests/dbaas-service/Chart.yaml create mode 100644 integration_tests/dbaas-service/README create mode 100644 integration_tests/dbaas-service/templates/deployment.yaml create mode 100644 integration_tests/dbaas-service/templates/service.yaml create mode 100644 integration_tests/dbaas-service/values.yaml create mode 100644 tests/a1test_helpers.py diff --git a/a1/controller.py b/a1/controller.py index cde7483..f2fdfea 100644 --- a/a1/controller.py +++ b/a1/controller.py @@ -2,8 +2,8 @@ Main a1 controller """ # ================================================================================== -# Copyright (c) 2019 Nokia -# Copyright (c) 2018-2019 AT&T Intellectual Property. +# Copyright (c) 2019-2020 Nokia +# Copyright (c) 2018-2020 AT&T Intellectual Property. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ from jsonschema import validate from jsonschema.exceptions import ValidationError import connexion from mdclogpy import Logger +from ricsdl.exceptions import RejectedByBackend, NotConnected, BackendError from a1 import a1rmr, exceptions, data @@ -38,9 +39,18 @@ def _try_func_return(func): return "", 400 except (exceptions.PolicyTypeNotFound, exceptions.PolicyInstanceNotFound): return "", 404 - except BaseException as exc: + except (RejectedByBackend, NotConnected, BackendError): + """ + These are SDL errors. At the time of development here, we do not have a good understanding which of these errors are "try again later it may work" + and which are "never going to work". There is some discussion that RejectedByBackend is in the latter category, suggesting it should map to 400, + but until we understand the root cause of these errors, it's confusing to clients to give them a 400 (a "your fault" code) because they won't know how to fix + For now, we log, and 503, and investigate the logs later to improve the handling/reporting. + """ + # mdc_logger.exception(exc) # waiting for https://jira.o-ran-sc.org/browse/RIC-39 + return "", 503 + except BaseException: # catch all, should never happen... - mdc_logger.exception(exc) + # mdc_logger.exception(exc) # waiting for https://jira.o-ran-sc.org/browse/RIC-39 return Response(status=500) diff --git a/a1/data.py b/a1/data.py index a98be5c..1f09691 100644 --- a/a1/data.py +++ b/a1/data.py @@ -7,8 +7,8 @@ For now, the database is in memory. We use dict data structures (KV) with the expectation of having to move this into Redis """ # ================================================================================== -# Copyright (c) 2019 Nokia -# Copyright (c) 2018-2019 AT&T Intellectual Property. +# Copyright (c) 2019-2020 Nokia +# Copyright (c) 2018-2020 AT&T Intellectual Property. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,6 +27,9 @@ import time from threading import Thread import msgpack from mdclogpy import Logger + +from ricsdl.syncstorage import SyncStorage + from a1.exceptions import PolicyTypeNotFound, PolicyInstanceNotFound, PolicyTypeAlreadyExists, CantDeleteNonEmptyType mdc_logger = Logger(name=__name__) @@ -35,6 +38,8 @@ mdc_logger = Logger(name=__name__) INSTANCE_DELETE_NO_RESP_TTL = int(os.environ.get("INSTANCE_DELETE_NO_RESP_TTL", 5)) INSTANCE_DELETE_RESP_TTL = int(os.environ.get("INSTANCE_DELETE_RESP_TTL", 5)) +A1NS = "A1m_ns" + class SDLWrapper: """ @@ -46,25 +51,30 @@ class SDLWrapper: """ def __init__(self): - self.POLICY_DATA = {} + self.sdl = SyncStorage() def set(self, key, value): """set a key""" - self.POLICY_DATA[key] = msgpack.packb(value, use_bin_type=True) + self.sdl.set(A1NS, {key: msgpack.packb(value, use_bin_type=True)}) def get(self, key): """get a key""" - if key in self.POLICY_DATA: - return msgpack.unpackb(self.POLICY_DATA[key], raw=False) + ret_dict = self.sdl.get(A1NS, {key}) + if key in ret_dict: + return msgpack.unpackb(ret_dict[key], raw=False) + return None def find_and_get(self, prefix): """get all k v pairs that start with prefix""" - return {k: msgpack.unpackb(v, raw=False) for k, v in self.POLICY_DATA.items() if k.startswith(prefix)} + ret_dict = self.sdl.find_and_get(A1NS, "{0}".format(prefix), atomic=True) + found = {k: msgpack.unpackb(v, raw=False) for k, v in ret_dict.items()} + # TODO: upgrade to sdl 2.0.0 which does the sorting for us + return {k: found[k] for k in sorted(found)} def delete(self, key): """ delete a key""" - del self.POLICY_DATA[key] + self.sdl.remove(A1NS, {key}) SDL = SDLWrapper() diff --git a/a1/openapi.yaml b/a1/openapi.yaml index f35a742..2aa7a94 100644 --- a/a1/openapi.yaml +++ b/a1/openapi.yaml @@ -1,6 +1,6 @@ # ================================================================================== -# Copyright (c) 2019 Nokia -# Copyright (c) 2018-2019 AT&T Intellectual Property. +# Copyright (c) 2019-2020 Nokia +# Copyright (c) 2018-2020 AT&T Intellectual Property. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ # ================================================================================== openapi: 3.0.0 info: - version: 2.0.0 + version: 2.1.0 title: RIC A1 paths: '/a1-p/healthcheck': @@ -48,6 +48,8 @@ paths: items: "$ref": "#/components/schemas/policy_type_id" example: [20000, 20020] + 503: + description: "Potentially transient backend database error. Client should attempt to retry later." '/a1-p/policytypes/{policy_type_id}': parameters: @@ -72,6 +74,8 @@ paths: '404': description: > policy type not found + '503': + description: "Potentially transient backend database error. Client should attempt to retry later." delete: description: > Delete this policy type. Can only be performed if there are no instances of this type @@ -89,6 +93,8 @@ paths: '404': description: > policy type not found + '503': + description: "Potentially transient backend database error. Client should attempt to retry later." put: description: > Create a new policy type . @@ -137,6 +143,8 @@ paths: description: "policy type successfully created" '400': description: "illegal ID, or object already existed" + '503': + description: "Potentially transient backend database error. Client should attempt to retry later." '/a1-p/policytypes/{policy_type_id}/policies': parameters: @@ -160,6 +168,8 @@ paths: items: "$ref": "#/components/schemas/policy_instance_id" example: ["3d2157af-6a8f-4a7c-810f-38c2f824bf12", "06911bfc-c127-444a-8eb1-1bffad27cc3d"] + '503': + description: "Potentially transient backend database error. Client should attempt to retry later." '/a1-p/policytypes/{policy_type_id}/policies/{policy_instance_id}': @@ -195,6 +205,8 @@ paths: '404': description: > there is no policy instance with this policy_instance_id or there is no policy type with this policy_type_id + '503': + description: "Potentially transient backend database error. Client should attempt to retry later." delete: description: > @@ -209,8 +221,9 @@ paths: policy instance deletion initiated '404': description: > - there is no policy instance with this policy_instance_id - or there is no policy type with this policy_type_id + there is no policy instance with this policy_instance_id or there is no policy type with this policy_type_id + '503': + description: "Potentially transient backend database error. Client should attempt to retry later." put: description: > @@ -243,6 +256,8 @@ paths: '404': description: > There is no policy type with this policy_type_id + '503': + description: "Potentially transient backend database error. Client should attempt to retry later." '/a1-p/policytypes/{policy_type_id}/policies/{policy_instance_id}/status': parameters: @@ -291,6 +306,8 @@ paths: '404': description: > there is no policy instance with this policy_instance_id or there is no policy type with this policy_type_id + '503': + description: "Potentially transient backend database error. Client should attempt to retry later." components: schemas: diff --git a/container-tag.yaml b/container-tag.yaml index 34c7e0c..de01844 100644 --- a/container-tag.yaml +++ b/container-tag.yaml @@ -1,4 +1,4 @@ # The Jenkins job uses this string for the tag in the image name # for example nexus3.o-ran-sc.org:10004/my-image-name:my-tag --- -tag: 2.0.0 +tag: 2.1.0 diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 785d2f4..1d2b82d 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -14,12 +14,17 @@ and this project adheres to `Semantic Versioning `__. :depth: 3 :local: -[x.x.x] - TBD -------------- +[2.1.0] - 1/8/2020 +------------------ :: - * Represents a resillent version of x.x.x that uses Redis for persistence + * Represents a resillent version of 2.0.0 that uses Redis for persistence + * Now relies on SDL and dbaas; SDL is the python interface library to dbaas + * Adds a 503 http code to nearly all http methods, as A1 now depends on an upstream system + * Integration tests have a copy of a dbaas helm chart, however the goal is to simplify that deployment per https://jira.o-ran-sc.org/browse/RIC-45 + * Unit tests have a mockup of SDL, however again the goal is to simplify as SDL grows per https://jira.o-ran-sc.org/browse/RIC-44 + [2.0.0] - 12/9/2019 diff --git a/integration_tests/a1mediator/Chart.yaml b/integration_tests/a1mediator/Chart.yaml index 28d5951..afb9d4f 100644 --- a/integration_tests/a1mediator/Chart.yaml +++ b/integration_tests/a1mediator/Chart.yaml @@ -1,4 +1,4 @@ apiVersion: v1 description: A1 Helm chart for Kubernetes name: a1mediator -version: 2.0.0 +version: 2.1.0 diff --git a/integration_tests/a1mediator/templates/deployment.yaml b/integration_tests/a1mediator/templates/deployment.yaml index a6e0786..45b1a45 100644 --- a/integration_tests/a1mediator/templates/deployment.yaml +++ b/integration_tests/a1mediator/templates/deployment.yaml @@ -36,6 +36,11 @@ spec: value: "5" - name: INSTANCE_DELETE_RESP_TTL value: "10" + - name: DBAAS_SERVICE_HOST + value: "dbaas" + - name: DBAAS_SERVICE_PORT + value: "6379" + image: "a1:latest" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: diff --git a/integration_tests/dbaas-service/Chart.yaml b/integration_tests/dbaas-service/Chart.yaml new file mode 100644 index 0000000..8d183de --- /dev/null +++ b/integration_tests/dbaas-service/Chart.yaml @@ -0,0 +1,25 @@ +# Copyright (c) 2019 AT&T Intellectual Property. +# Copyright (c) 2019 Nokia. +# +# 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. + +# +# This source code is part of the near-RT RIC (RAN Intelligent Controller) +# platform project (RICP). +# + +apiVersion: v1 +appVersion: "1.0" +description: DBaaS realized with standalone, non-persistent, non-redundant Redis +name: dbaas +version: 0.1.0 diff --git a/integration_tests/dbaas-service/README b/integration_tests/dbaas-service/README new file mode 100644 index 0000000..c15a3e0 --- /dev/null +++ b/integration_tests/dbaas-service/README @@ -0,0 +1 @@ +This was stolen from https://gerrit.o-ran-sc.org/r/gitweb?p=ric-plt/dbaas.git diff --git a/integration_tests/dbaas-service/templates/deployment.yaml b/integration_tests/dbaas-service/templates/deployment.yaml new file mode 100644 index 0000000..341d898 --- /dev/null +++ b/integration_tests/dbaas-service/templates/deployment.yaml @@ -0,0 +1,39 @@ +# Copyright (c) 2019 AT&T Intellectual Property. +# Copyright (c) 2019 Nokia. +# +# 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. + +# +# This source code is part of the near-RT RIC (RAN Intelligent Controller) +# platform project (RICP). +# + +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ .Values.backend.name }} +spec: + replicas: {{ .Values.backend.replicas }} + template: + metadata: + labels: + app: {{ .Values.backend.name }} + spec: + terminationGracePeriodSeconds: {{ .Values.backend.terminationGracePeriodSeconds }} + containers: + - image: {{ .Values.backend.image.name }}:{{ .Values.backend.image.tag }} + imagePullPolicy: {{ .Values.backend.image.imagePullPolicy }} + ports: + - containerPort: {{ .Values.backend.targetPort }} + name: {{ .Values.backend.name }} + restartPolicy: Always diff --git a/integration_tests/dbaas-service/templates/service.yaml b/integration_tests/dbaas-service/templates/service.yaml new file mode 100644 index 0000000..472aeac --- /dev/null +++ b/integration_tests/dbaas-service/templates/service.yaml @@ -0,0 +1,30 @@ +# Copyright (c) 2019 AT&T Intellectual Property. +# Copyright (c) 2019 Nokia. +# +# 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. + +# +# This source code is part of the near-RT RIC (RAN Intelligent Controller) +# platform project (RICP). +# + +apiVersion: v1 +kind: Service +metadata: + name: {{ .Chart.Name }} +spec: + selector: + app: {{ .Values.backend.name }} + ports: + - port: {{ .Values.backend.port }} + targetPort: {{ .Values.backend.targetPort }} diff --git a/integration_tests/dbaas-service/values.yaml b/integration_tests/dbaas-service/values.yaml new file mode 100644 index 0000000..053ac96 --- /dev/null +++ b/integration_tests/dbaas-service/values.yaml @@ -0,0 +1,30 @@ +# Copyright (c) 2019 AT&T Intellectual Property. +# Copyright (c) 2019 Nokia. +# +# 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. + +# +# This source code is part of the near-RT RIC (RAN Intelligent Controller) +# platform project (RICP). +# + +backend: + terminationGracePeriodSeconds: 0 + replicas: 1 + name: "redis-standalone" + port: 6379 + targetPort: 6379 + image: + name: nexus3.o-ran-sc.org:10002/o-ran-sc/ric-plt-dbaas + tag: 0.2.2 + imagePullPolicy: IfNotPresent diff --git a/integration_tests/getlogs.sh b/integration_tests/getlogs.sh index b611b85..22bbd4b 100755 --- a/integration_tests/getlogs.sh +++ b/integration_tests/getlogs.sh @@ -1,6 +1,6 @@ #!/bin/sh -echo "\n\n a1" >> log.txt -kubectl get pods --namespace=default | awk '{ print $1 }' | egrep '^a1-a1mediator-' | xargs kubectl logs > log.txt 2>&1 +echo "\n\n a1" > log.txt +kubectl get pods --namespace=default | awk '{ print $1 }' | egrep '^a1-a1mediator-' | xargs kubectl logs >> log.txt 2>&1 echo "\n\n test receiver" >> log.txt kubectl get pods --namespace=default | awk '{ print $1 }' | egrep '^testreceiver-' | xargs -I X kubectl logs X testreceiver >> log.txt 2>&1 @@ -10,3 +10,6 @@ kubectl get pods --namespace=default | awk '{ print $1 }' | egrep '^testreceiver echo "\n\n query" >> log.txt kubectl get pods --namespace=default | awk '{ print $1 }' | egrep '^testreceiver-' | xargs -I X kubectl logs X queryreceiver >> log.txt 2>&1 + +echo "\n\n sdl-redis" >> log.txt +kubectl get pods --namespace=default | awk '{ print $1 }' | egrep '^redis-standalone' | xargs kubectl logs >> log.txt 2>&1 diff --git a/setup.py b/setup.py index c2dc3f6..9c6f0bc 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ # ================================================================================== -# Copyright (c) 2019 Nokia -# Copyright (c) 2018-2019 AT&T Intellectual Property. +# Copyright (c) 2019-2020 Nokia +# Copyright (c) 2018-2020 AT&T Intellectual Property. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,13 +18,22 @@ from setuptools import setup, find_packages setup( name="a1", - version="2.0.0", + version="2.1.0", packages=find_packages(exclude=["tests.*", "tests"]), author="Tommy Carpenter", description="RIC A1 Mediator for policy/intent changes", url="https://gerrit.o-ran-sc.org/r/admin/repos/ric-plt/a1", entry_points={"console_scripts": ["run.py=a1.run:main"]}, # we require jsonschema, should be in that list, but connexion already requires a specific version of it - install_requires=["requests", "Flask", "connexion[swagger-ui]", "gevent", "msgpack", "rmr>=2.2.0", "mdclogpy"], + install_requires=[ + "requests", + "Flask", + "connexion[swagger-ui]", + "gevent", + "msgpack", + "rmr>=2.2.0", + "mdclogpy", + "ricsdl>=1.0.2,<2.0.0", + ], package_data={"a1": ["openapi.yaml"]}, ) diff --git a/tests/a1test_helpers.py b/tests/a1test_helpers.py new file mode 100644 index 0000000..57e4251 --- /dev/null +++ b/tests/a1test_helpers.py @@ -0,0 +1,55 @@ +# ================================================================================== +# Copyright (c) 2019-2020 Nokia +# Copyright (c) 2018-2020 AT&T Intellectual Property. +# +# 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. +# ================================================================================== +import msgpack +from ricsdl.exceptions import RejectedByBackend, NotConnected, BackendError + + +class MockSDLWrapper: + """ + Mock wrapper for SDL that uses a dict so we do not rely on Redis for unit tests. + Would be really nice if SDL itself came with a "standalone: dictionary" mode for this purpose... + """ + + def __init__(self): + self.POLICY_DATA = {} + + def set(self, key, value): + """set a key""" + + # these are for unit testing that the handler works on various SDL errors + if key == "a1.policy_type.111": + raise RejectedByBackend() + if key == "a1.policy_type.112": + raise NotConnected() + if key == "a1.policy_type.113": + raise BackendError() + + self.POLICY_DATA[key] = msgpack.packb(value, use_bin_type=True) + + def get(self, key): + """get a key""" + if key in self.POLICY_DATA: + return msgpack.unpackb(self.POLICY_DATA[key], raw=False) + return None + + def find_and_get(self, prefix): + """get all k v pairs that start with prefix""" + return {k: msgpack.unpackb(v, raw=False) for k, v in self.POLICY_DATA.items() if k.startswith(prefix)} + + def delete(self, key): + """ delete a key""" + del self.POLICY_DATA[key] diff --git a/tests/test_controller.py b/tests/test_controller.py index 971d547..833fc6e 100644 --- a/tests/test_controller.py +++ b/tests/test_controller.py @@ -2,8 +2,8 @@ tests for controller """ # ================================================================================== -# Copyright (c) 2019 Nokia -# Copyright (c) 2018-2019 AT&T Intellectual Property. +# Copyright (c) 2019-2020 Nokia +# Copyright (c) 2018-2020 AT&T Intellectual Property. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,11 +17,11 @@ tests for controller # See the License for the specific language governing permissions and # limitations under the License. # ================================================================================== - import time import json from rmr.rmr_mocks import rmr_mocks -from a1 import a1rmr +from a1 import a1rmr, data +from .a1test_helpers import MockSDLWrapper RCV_ID = "test_receiver" ADM_CRTL_TID = 6660666 @@ -231,6 +231,8 @@ def _verify_instance_and_status(client, expected_instance, expected_status, expe def setup_module(): """module level setup""" + data.SDL = MockSDLWrapper() # patch SDL + def noop(): pass @@ -245,6 +247,8 @@ def test_workflow(client, monkeypatch, adm_type_good, adm_instance_good): """ test a full A1 workflow """ + + # put type and instance _put_ac_type(client, adm_type_good) _put_ac_instance(client, monkeypatch, adm_instance_good) @@ -344,6 +348,14 @@ def test_bad_instances(client, monkeypatch, adm_type_good): res = client.delete(ADM_CTRL_TYPE) assert res.status_code == 204 + # test 503 handlers + res = client.put("/a1-p/policytypes/111", json=adm_type_good) + assert res.status_code == 503 + res = client.put("/a1-p/policytypes/112", json=adm_type_good) + assert res.status_code == 503 + res = client.put("/a1-p/policytypes/113", json=adm_type_good) + assert res.status_code == 503 + def test_illegal_types(client, adm_type_good): """ diff --git a/tests/test_data.py b/tests/test_data.py index 45c2eac..bf178ff 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -1,6 +1,6 @@ # ================================================================================== -# Copyright (c) 2019 Nokia -# Copyright (c) 2018-2019 AT&T Intellectual Property. +# Copyright (c) 2019-2020 Nokia +# Copyright (c) 2018-2020 AT&T Intellectual Property. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,13 +15,18 @@ # limitations under the License. # ================================================================================== from a1 import data +from .a1test_helpers import MockSDLWrapper + + +def setup_module(): + """module level setup""" + data.SDL = MockSDLWrapper() # patch SDL def test_sdl_raw(): """ test raw sdl functions """ - data.SDL = data.SDLWrapper() data.SDL.set("as.df1", "data") data.SDL.set("as.df2", "data2") assert data.SDL.get("as.df1") == "data" diff --git a/tox-integration.ini b/tox-integration.ini index 81f3bb7..49d8f65 100644 --- a/tox-integration.ini +++ b/tox-integration.ini @@ -1,6 +1,6 @@ # ================================================================================== -# Copyright (c) 2019 Nokia -# Copyright (c) 2018-2019 AT&T Intellectual Property. +# Copyright (c) 2019-2020 Nokia +# Copyright (c) 2018-2020 AT&T Intellectual Property. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ commands_pre= sleep 5 helm install --devel testreceiver -n testreceiver helm install --devel a1mediator -n a1 + helm install --devel dbaas-service -n dbaas # wait for helm charts sleep 30 ./portforward.sh @@ -57,5 +58,7 @@ commands_post= helm del --purge testreceiver helm delete a1 helm del --purge a1 + helm del dbaas + helm del --purge dbaas pkill -9 kubectl sleep 10 -- 2.16.6