forked from TrueCloudLab/frostfs-testcases
Remove step for iptables installation
Installation of iptables was implemented in environment preparation pipeline and tests do not need to worry about it. Removed conditions that were checking pytest mode vs robot mode, because we got rid of robot tests in this branch of codebase. Signed-off-by: Vladimir Domnich <v.domnich@yadro.com>
This commit is contained in:
parent
0ca45d1ba8
commit
d935c2cafa
4 changed files with 29 additions and 54 deletions
|
@ -100,26 +100,24 @@ def _configure_aws_cli(cmd: str, key_id: str, access_key: str, out_format: str =
|
|||
|
||||
def _attach_allure_log(cmd: str, output: str, return_code: int, start_time: datetime,
|
||||
end_time: datetime) -> None:
|
||||
if 'robot' not in sys.modules:
|
||||
command_attachment = (
|
||||
f"COMMAND: '{cmd}'\n"
|
||||
f'OUTPUT:\n {output}\n'
|
||||
f'RC: {return_code}\n'
|
||||
f'Start / End / Elapsed\t {start_time.time()} / {end_time.time()} / {end_time - start_time}'
|
||||
)
|
||||
with allure.step(f'COMMAND: {shorten(cmd, width=60, placeholder="...")}'):
|
||||
allure.attach(command_attachment, 'Command execution', allure.attachment_type.TEXT)
|
||||
command_attachment = (
|
||||
f"COMMAND: '{cmd}'\n"
|
||||
f'OUTPUT:\n {output}\n'
|
||||
f'RC: {return_code}\n'
|
||||
f'Start / End / Elapsed\t {start_time.time()} / {end_time.time()} / {end_time - start_time}'
|
||||
)
|
||||
with allure.step(f'COMMAND: {shorten(cmd, width=60, placeholder="...")}'):
|
||||
allure.attach(command_attachment, 'Command execution', allure.attachment_type.TEXT)
|
||||
|
||||
|
||||
def log_command_execution(cmd: str, output: Union[str, dict]) -> None:
|
||||
logger.info(f'{cmd}: {output}')
|
||||
if 'robot' not in sys.modules:
|
||||
with suppress(Exception):
|
||||
json_output = json.dumps(output, indent=4, sort_keys=True)
|
||||
output = json_output
|
||||
command_attachment = (
|
||||
f"COMMAND: '{cmd}'\n"
|
||||
f'OUTPUT:\n {output}\n'
|
||||
)
|
||||
with allure.step(f'COMMAND: {shorten(cmd, width=60, placeholder="...")}'):
|
||||
allure.attach(command_attachment, 'Command execution', allure.attachment_type.TEXT)
|
||||
with suppress(Exception):
|
||||
json_output = json.dumps(output, indent=4, sort_keys=True)
|
||||
output = json_output
|
||||
command_attachment = (
|
||||
f"COMMAND: '{cmd}'\n"
|
||||
f'OUTPUT:\n {output}\n'
|
||||
)
|
||||
with allure.step(f'COMMAND: {shorten(cmd, width=60, placeholder="...")}'):
|
||||
allure.attach(command_attachment, 'Command execution', allure.attachment_type.TEXT)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue