aboutsummaryrefslogtreecommitdiffstats
path: root/opnfv/utils
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-11-17 15:43:03 +0100
committerMorgan Richomme <morgan.richomme@orange.com>2016-11-21 17:31:34 +0100
commit23fa2fcb5517fafafe6e5263088ceddbb51c3d55 (patch)
tree44ccdb9ff64a5e23f31521d12cb5a8bb53661c5d /opnfv/utils
parent9de1ded9cf18dfce75d1a85c54242c74e3133fcd (diff)
Add Exceptions and Constants in opnfv module
JIRA: FUNCTEST-497 Change-Id: I4bc0d545058c4778b632911bb317789110de29d1 Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'opnfv/utils')
-rw-r--r--opnfv/utils/OPNFVExceptions.py126
-rw-r--r--opnfv/utils/constants.py15
2 files changed, 141 insertions, 0 deletions
diff --git a/opnfv/utils/OPNFVExceptions.py b/opnfv/utils/OPNFVExceptions.py
new file mode 100644
index 0000000..03b3ea9
--- /dev/null
+++ b/opnfv/utils/OPNFVExceptions.py
@@ -0,0 +1,126 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2016 Orange and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# This class defines Python OPNFV exceptions
+#
+
+
+class OPNFVException(Exception):
+ def __call__(self, *args):
+ return self.__class__(*(self.args + args))
+
+
+# ************************************
+# Generic
+# ************************************
+class OPNFVSUTNotReachable(OPNFVException):
+ """Target System Under Test is not reachable"""
+ pass
+
+
+class OPNFVCiExecutionError(OPNFVException):
+ """Error occurs during CI exection"""
+ pass
+
+
+class TestDashboardError(OPNFVException):
+ """Impossible to report results to dashboard"""
+ pass
+
+
+class TestReportingError(OPNFVException):
+ """Impossible to report results to reporting"""
+ pass
+
+
+# ************************************
+# Exceptions related to test DB
+# ************************************
+class TestDbNotReachable(OPNFVException):
+ """Test database is not reachable"""
+ pass
+
+
+class UnknownScenario(OPNFVException):
+ """Test scenario is unknown"""
+ pass
+
+
+class UnknownPod(OPNFVException):
+ """Test POD is unknown"""
+ pass
+
+
+class UnknownProject(OPNFVException):
+ """Project is unknown"""
+ pass
+
+
+class UnknownTestCase(OPNFVException):
+ """Test case is unknown"""
+ pass
+
+
+class UnknownVersion(OPNFVException):
+ """Version is unknown"""
+ pass
+
+
+class UnknownInstaller(OPNFVException):
+ """Installer is not supported"""
+ pass
+
+
+# *******************
+# Test project errors
+# *******************
+class FunctestExecutionError(OPNFVException):
+ """Internal Functest error"""
+ pass
+
+
+class YardstickExecutionError(OPNFVException):
+ """Internal Yardstick error"""
+ pass
+
+
+# **********************************
+# Errors related to Feature projects
+# **********************************
+class TestCaseNotRunnable(OPNFVException):
+ """test case incompatible with SUT, scenario, installer"""
+ pass
+
+
+class FeatureTestIntegrationError(OPNFVException):
+ """Impossible to integrate Feature test"""
+ pass
+
+
+class FeatureTestExecutionError(OPNFVException):
+ """Error during Feature test execution"""
+ pass
+
+
+# *********************************
+# Errors related to VNF on boarding
+# *********************************
+class VNFTestNotRunnable(OPNFVException):
+ """VNF test is not compatible with SUT, scenario, installer"""
+ pass
+
+
+class VNFIntegrationError(OPNFVException):
+ """Impossible to integrate the VNF test"""
+ pass
+
+
+class VNFExecutionError(OPNFVException):
+ """Error during VNF test execution"""
+ pass
diff --git a/opnfv/utils/constants.py b/opnfv/utils/constants.py
new file mode 100644
index 0000000..29f0d02
--- /dev/null
+++ b/opnfv/utils/constants.py
@@ -0,0 +1,15 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2016 Orange and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+
+INSTALLERS = ['apex', 'fuel', 'compass', 'joid']
+VERSIONS = ['arno', 'brahmaputra', 'colorado', 'danube']
+
+EXIT_OK = 0
+EXIT_RUN_ERROR = -1
+EXIT_PUSH_TO_TEST_DB_ERROR = -2