[dts] [PATCH v2 10/19] add some exceptions to support framwork to handle virtual test exceptions

Jiajia, Sun sunx.jiajia at intel.com
Fri May 22 11:04:03 CEST 2015


From: sjiajiax <sunx.jiajia at intel.com>

Signed-off-by: sjiajiax <sunx.jiajia at intel.com>
---
 framework/exception.py | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/framework/exception.py b/framework/exception.py
index be38c16..7ec03c2 100644
--- a/framework/exception.py
+++ b/framework/exception.py
@@ -46,3 +46,72 @@ class SSHConnectionException(Exception):
 
     def __str__(self):
         return 'Error trying to connect with %s' % self.host
+
+
+class SSHSessionDeadException(Exception):
+
+    """
+    SSH session is not alive.
+    It can no longer be used.
+    """
+
+    def __init__(self, host):
+        self.host = host
+
+    def __str__(self):
+        return 'SSH session with %s has been dead' % self.host
+
+
+class StartVMFailedException(Exception):
+
+    """
+    Start VM failed.
+    """
+
+    def __init__(self, error):
+        self.error = error
+
+    def __str__(self):
+        return repr(self.error)
+
+
+class ConfigParseException(Exception):
+
+    """
+    Configuration file parse failure exception.
+    """
+
+    def __init__(self, conf_file):
+        self.config = conf_file
+
+    def __str__(self):
+        return "Faile to parse config file [%s]" % (self.config)
+
+
+class VirtConfigParseException(Exception):
+    pass
+
+
+class PortConfigParseException(Exception):
+    pass
+
+
+class VirtConfigParamException(Exception):
+
+    """
+    Virtualizatoin param execution exception.
+    """
+    def __init__(self, param):
+        self.param = param
+
+    def __str__(self):
+        return "Faile to execute param [%s]" % (self.param)
+
+
+class VirtDutConnectException(Exception):
+    pass
+
+
+class VirtDutInitException(Exception):
+    def __init__(self, vm_dut):
+        self.vm_dut = vm_dut
-- 
1.9.3



More information about the dts mailing list