From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id EC3915A41 for ; Fri, 22 May 2015 11:04:43 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 22 May 2015 02:04:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,474,1427785200"; d="scan'208";a="733612489" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga002.jf.intel.com with ESMTP; 22 May 2015 02:04:42 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t4M94eX9003045; Fri, 22 May 2015 17:04:40 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t4M94bHY014391; Fri, 22 May 2015 17:04:40 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t4M94bie014387; Fri, 22 May 2015 17:04:37 +0800 From: "Jiajia, Sun" To: dts@dpdk.org Date: Fri, 22 May 2015 17:04:03 +0800 Message-Id: <1432285452-14286-11-git-send-email-sunx.jiajia@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1432285452-14286-1-git-send-email-sunx.jiajia@intel.com> References: <1432285452-14286-1-git-send-email-sunx.jiajia@intel.com> Subject: [dts] [PATCH v2 10/19] add some exceptions to support framwork to handle virtual test exceptions X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2015 09:04:44 -0000 From: sjiajiax Signed-off-by: sjiajiax --- 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