DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Juraj Linkeš" <juraj.linkes@pantheon.tech>
To: thomas@monjalon.net, david.marchand@redhat.com,
	Honnappa.Nagarahalli@arm.com, ohilyard@iol.unh.edu,
	lijuan.tu@intel.com
Cc: dev@dpdk.org, "Juraj Linkeš" <juraj.linkes@pantheon.tech>
Subject: [RFC PATCH v1 08/15] dts: merge DTS framework/exception.py to DPDK
Date: Wed,  6 Apr 2022 14:55:59 +0000	[thread overview]
Message-ID: <20220406145606.2913834-9-juraj.linkes@pantheon.tech> (raw)
In-Reply-To: <20220406145606.2913834-1-juraj.linkes@pantheon.tech>

---
 dts/framework/exception.py | 148 +++++++++++++++++++++++++++++++++++++
 1 file changed, 148 insertions(+)
 create mode 100644 dts/framework/exception.py

diff --git a/dts/framework/exception.py b/dts/framework/exception.py
new file mode 100644
index 0000000000..fb0fa72e42
--- /dev/null
+++ b/dts/framework/exception.py
@@ -0,0 +1,148 @@
+"""
+User-defined exceptions used across the framework.
+"""
+from typing import Any
+
+
+class TimeoutException(Exception):
+
+    """
+    Command execution timeout.
+    """
+
+    def __init__(self, command, output):
+        self.command = command
+        self.output = output
+
+    def __str__(self):
+        msg = "TIMEOUT on %s" % (self.command)
+        return msg
+
+    def get_output(self):
+        return self.output
+
+
+class VerifyFailure(Exception):
+
+    """
+    To be used within the test cases to verify if a command output
+    is as it was expected.
+    """
+
+    def __init__(self, value):
+        self.value = value
+
+    def __str__(self):
+        return repr(self.value)
+
+
+class VerifySkip(Exception):
+
+    """
+    To be used within the test cases to verify if case should be skipped.
+    """
+
+    def __init__(self, value):
+        self.value = value
+
+    def __str__(self):
+        return repr(self.value)
+
+
+class SSHConnectionException(Exception):
+
+    """
+    SSH connection error.
+    """
+
+    def __init__(self, host):
+        self.host = host
+
+    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 ParameterInvalidException(Exception):
+    pass
+
+
+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):
+
+    """
+    Virtualization 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
+
+
+class VirtDeviceCreateException(Exception):
+    pass
+
+
+class VirtVmOperationException(Exception):
+    pass
+
+
+class VirtHostPrepareException(Exception):
+    pass
-- 
2.20.1


  parent reply	other threads:[~2022-04-06 14:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-06 14:55 [RFC PATCH v1 00/15] merge DTS core files " Juraj Linkeš
2022-04-06 14:55 ` [RFC PATCH v1 01/15] dts: merge DTS dep/tclclient.tgz " Juraj Linkeš
2022-04-06 14:55 ` [RFC PATCH v1 02/15] dts: merge DTS dep/tgen.tgz " Juraj Linkeš
2022-04-06 14:55 ` [RFC PATCH v1 03/15] dts: merge DTS dts " Juraj Linkeš
2022-04-06 14:55 ` [RFC PATCH v1 04/15] dts: merge DTS framework/__init__.py " Juraj Linkeš
2022-04-06 14:55 ` [RFC PATCH v1 05/15] dts: merge DTS framework/asan_test.py " Juraj Linkeš
2022-04-06 14:55 ` [RFC PATCH v1 06/15] dts: merge DTS framework/checkCase.py " Juraj Linkeš
2022-04-06 14:55 ` [RFC PATCH v1 07/15] dts: merge DTS framework/dts.py " Juraj Linkeš
2022-04-06 14:55 ` Juraj Linkeš [this message]
2022-04-06 14:56 ` [RFC PATCH v1 09/15] dts: merge DTS framework/logger.py " Juraj Linkeš
2022-04-06 14:56 ` [RFC PATCH v1 10/15] dts: merge DTS framework/packet.py " Juraj Linkeš
2022-04-06 14:56 ` [RFC PATCH v1 11/15] dts: merge DTS framework/project_dpdk.py " Juraj Linkeš
2022-04-06 14:56 ` [RFC PATCH v1 12/15] dts: merge DTS framework/serializer.py " Juraj Linkeš
2022-04-06 14:56 ` [RFC PATCH v1 13/15] dts: merge DTS framework/utils.py " Juraj Linkeš
2022-04-06 14:56 ` [RFC PATCH v1 14/15] dts: merge DTS main.py " Juraj Linkeš
2022-04-06 14:56 ` [RFC PATCH v1 15/15] dts: merge DTS version.py " Juraj Linkeš
2022-04-07  5:04 ` [RFC PATCH v1 00/15] merge DTS core files " Jerin Jacob
2022-04-07  7:33   ` Thomas Monjalon
2022-04-11  7:41     ` Juraj Linkeš
2022-04-11 17:55       ` Honnappa Nagarahalli
2022-04-11 18:20         ` Owen Hilyard
2022-04-11 19:06   ` Honnappa Nagarahalli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220406145606.2913834-9-juraj.linkes@pantheon.tech \
    --to=juraj.linkes@pantheon.tech \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=lijuan.tu@intel.com \
    --cc=ohilyard@iol.unh.edu \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).