-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |