Skip to content

Commit

Permalink
rex longrun job
Browse files Browse the repository at this point in the history
  • Loading branch information
pondrejk committed Mar 18, 2024
1 parent 6a59883 commit 9424185
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions tests/foreman/longrun/test_remoteexecution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"""Test module for Remote Execution
:Requirement: Remoteexecution
:CaseAutomation: Automated
:CaseComponent: RemoteExecution
:Team: Endeavour
:CaseImportance: High
"""
import pytest


@pytest.mark.rhel_ver_list([9])
def test_positive_run_long_job(module_org, rex_contenthost, module_target_sat):
"""Run a long running job
:id: 76934868-89e6-4eb6-905e-d0d5ededc077
:expectedresults: Verify the long job was successfully ran and not terminated too soon
:parametrized: yes
"""
client = rex_contenthost
command = 'echo "Hello"; sleep 300; echo "Almost there"; sleep 300; echo "Done"'
invocation_command = module_target_sat.cli_factory.job_invocation(
{
'job-template': 'Run Command - Script Default',
'inputs': f'command={command}',
'search-query': f"name ~ {client.hostname}",
}
)
result = module_target_sat.cli.JobInvocation.info({'id': invocation_command['id']})
try:
assert result['success'] == '1'
except AssertionError as err:
raise AssertionError(
'host output: {}'.format(
' '.join(
module_target_sat.cli.JobInvocation.get_output(
{'id': invocation_command['id'], 'host': client.hostname}
)
)
)
) from err

0 comments on commit 9424185

Please sign in to comment.