From 920aa926a2a78dc7f1ba63e648d124a405962017 Mon Sep 17 00:00:00 2001 From: Eli Halych Date: Thu, 28 Jan 2021 16:11:39 +0000 Subject: Wrapper for simulators Implemented using Avionix. Supports Helm 3 only. The local directory path was defined relative to the package. Remote charts that are described locally are used. Starting the simulator is provided as a regular HTTP or HTTPS request. Issue-ID: INT-1829 Signed-off-by: Eli Halych Change-Id: Ia17c4043bedd853bf2c068e53d51cd2808a3c0db --- src/onaptests/utils/exceptions.py | 4 ++++ src/onaptests/utils/simulators.py | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 src/onaptests/utils/simulators.py (limited to 'src/onaptests/utils') diff --git a/src/onaptests/utils/exceptions.py b/src/onaptests/utils/exceptions.py index e453d67..c12ee2f 100644 --- a/src/onaptests/utils/exceptions.py +++ b/src/onaptests/utils/exceptions.py @@ -74,3 +74,7 @@ class EnvironmentPreparationException(OnapTestException): class SubstepExecutionException(OnapTestException): """Exception raised if substep execution fails.""" + +class EnvironmentCleanupException(OnapTestException): + """Test environment cleanup exception.""" + error_message="Test couldn't finish a cleanup" diff --git a/src/onaptests/utils/simulators.py b/src/onaptests/utils/simulators.py new file mode 100644 index 0000000..08acdbd --- /dev/null +++ b/src/onaptests/utils/simulators.py @@ -0,0 +1,13 @@ +"""Standard functions for the simulator wrapper.""" +from importlib.resources import path + +def get_local_dir(): + """Get the default path for helm charts. + + Returns: + chart_directory (Path): + local helm chart folder relative to the package. + """ + with path('onaptests', 'templates') as templates: + chart_directory = templates / 'helm_charts' + return chart_directory -- cgit 1.2.3-korg