Compare commits
1 commit
master
...
fix-proces
Author | SHA1 | Date | |
---|---|---|---|
87fe062478 |
1 changed files with 8 additions and 3 deletions
|
@ -1,10 +1,11 @@
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from frostfs_testlib.shell import CommandOptions, CommandResult, InteractiveInput, Shell
|
from frostfs_testlib.shell import CommandOptions, CommandResult, InteractiveInput, Shell
|
||||||
|
from frostfs_testlib.utils.datetime_utils import parse_time
|
||||||
|
|
||||||
|
|
||||||
class CliCommand:
|
class CliCommand:
|
||||||
|
TIMEOUT_INACCURACY = 10
|
||||||
WALLET_SOURCE_ERROR_MSG = "Provide either wallet or wallet_config to specify wallet location"
|
WALLET_SOURCE_ERROR_MSG = "Provide either wallet or wallet_config to specify wallet location"
|
||||||
WALLET_PASSWD_ERROR_MSG = "Provide either wallet_password or wallet_config to specify password"
|
WALLET_PASSWD_ERROR_MSG = "Provide either wallet_password or wallet_config to specify password"
|
||||||
|
|
||||||
|
@ -59,14 +60,18 @@ class CliCommand:
|
||||||
return f"{self.cli_exec_path} {self.__base_params} {command or ''} {param_str}"
|
return f"{self.cli_exec_path} {self.__base_params} {command or ''} {param_str}"
|
||||||
|
|
||||||
def _execute(self, command: Optional[str], **params) -> CommandResult:
|
def _execute(self, command: Optional[str], **params) -> CommandResult:
|
||||||
timeout = int(params["timeout"].rstrip("s")) if params.get("timeout") else None
|
if timeout := params.get("timeout"):
|
||||||
|
timeout = parse_time(timeout) + self.TIMEOUT_INACCURACY
|
||||||
|
|
||||||
return self.shell.exec(
|
return self.shell.exec(
|
||||||
self._format_command(command, **params),
|
self._format_command(command, **params),
|
||||||
CommandOptions(timeout=timeout),
|
CommandOptions(timeout=timeout),
|
||||||
)
|
)
|
||||||
|
|
||||||
def _execute_with_password(self, command: Optional[str], password, **params) -> CommandResult:
|
def _execute_with_password(self, command: Optional[str], password, **params) -> CommandResult:
|
||||||
timeout = int(params["timeout"].rstrip("s")) if params.get("timeout") else None
|
if timeout := params.get("timeout"):
|
||||||
|
timeout = parse_time(timeout) + self.TIMEOUT_INACCURACY
|
||||||
|
|
||||||
return self.shell.exec(
|
return self.shell.exec(
|
||||||
self._format_command(command, **params),
|
self._format_command(command, **params),
|
||||||
CommandOptions(
|
CommandOptions(
|
||||||
|
|
Loading…
Add table
Reference in a new issue