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 19, 2024
1 parent 6a59883 commit 2bfb720
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions tests/foreman/longrun/test_remoteexecution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
"""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
invocation_command = module_target_sat.cli_factory.job_invocation(
{
'job-template': 'Run Command - Script Default',
'inputs': 'command=sleep 600',
'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 2bfb720

Please sign in to comment.