exception - Exceptions

DTS exceptions.

The exceptions all have different severities expressed as an integer. The highest severity of all raised exceptions is used as the exit code of DTS.

class ErrorSeverity

Bases: IntEnum

The severity of errors that occur during DTS execution.

All exceptions are caught and the most severe error is used as return code.

NO_ERR = 0
GENERIC_ERR = 1
CONFIG_ERR = 2
REMOTE_CMD_EXEC_ERR = 3
SSH_ERR = 4
INTERNAL_ERR = 5
DPDK_BUILD_ERR = 10
TESTCASE_VERIFY_ERR = 20
BLOCKING_TESTSUITE_ERR = 25
__new__(value)
exception DTSError

Bases: Exception

The base exception from which all DTS exceptions are subclassed.

Do not use this exception, only use subclassed exceptions.

severity: ClassVar[ErrorSeverity] = 1
exception SSHConnectionError

Bases: DTSError

An unsuccessful SSH connection.

severity: ClassVar[ErrorSeverity] = 4
__init__(host: str, errors: list[str] | None = None)

Define the meaning of the first two arguments.

Parameters:
  • host (str) – The hostname to which we’re trying to connect.

  • errors (list[str] | None) – Any errors that occurred during the connection attempt.

exception SSHTimeoutError

Bases: _SSHTimeoutError

The execution of a command on a non-interactive SSH session timed out.

exception InteractiveSSHTimeoutError

Bases: _SSHTimeoutError

The execution of a command on an interactive SSH session timed out.

exception SSHSessionDeadError

Bases: _SSHSessionDeadError

Non-interactive SSH session has died.

exception InteractiveSSHSessionDeadError

Bases: _SSHSessionDeadError

Interactive SSH session as died.

exception ConfigurationError

Bases: DTSError

An invalid configuration.

severity: ClassVar[ErrorSeverity] = 2
exception RemoteCommandExecutionError

Bases: DTSError

An unsuccessful execution of a remote command.

severity: ClassVar[ErrorSeverity] = 3
__init__(command: str, command_stderr: str, command_return_code: int)

Define the meaning of the first two arguments.

Parameters:
  • command (str) – The executed command.

  • command_stderr (str) – The stderr of the executed command.

  • command_return_code (int) – The return code of the executed command.

command: str

The executed command.

exception InteractiveCommandExecutionError

Bases: DTSError

An unsuccessful execution of a remote command in an interactive environment.

severity: ClassVar[ErrorSeverity] = 3
exception RemoteFileNotFoundError

Bases: DTSError

A remote file or directory is requested but doesn’t exist.

severity: ClassVar[ErrorSeverity] = 3
exception DPDKBuildError

Bases: DTSError

A DPDK build failure.

severity: ClassVar[ErrorSeverity] = 10
exception TestCaseVerifyError

Bases: DTSError

A test case failure.

severity: ClassVar[ErrorSeverity] = 20
exception BlockingTestSuiteError

Bases: DTSError

A failure in a blocking test suite.

severity: ClassVar[ErrorSeverity] = 25
__init__(suite_name: str) None

Define the meaning of the first argument.

Parameters:

suite_name (str) – The blocking test suite.

exception InternalError

Bases: DTSError

An internal error or bug has occurred in DTS.

severity: ClassVar[ErrorSeverity] = 5