aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/utils
diff options
context:
space:
mode:
authorEli Halych <illia.halych@t-mobile.pl>2021-01-28 16:11:39 +0000
committerEli Halych <illia.halych@t-mobile.pl>2021-02-22 14:08:46 +0000
commit920aa926a2a78dc7f1ba63e648d124a405962017 (patch)
tree5ccfcd42da8c0fefd506cb65c6e3da8ecf26364c /src/onaptests/utils
parentca74c6ae7ad7dfd03f547fcd706bdfcdde1b20b4 (diff)
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 <illia.halych@t-mobile.pl> Change-Id: Ia17c4043bedd853bf2c068e53d51cd2808a3c0db
Diffstat (limited to 'src/onaptests/utils')
-rw-r--r--src/onaptests/utils/exceptions.py4
-rw-r--r--src/onaptests/utils/simulators.py13
2 files changed, 17 insertions, 0 deletions
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