Skip to content

Commit

Permalink
test timeout_to_kill
Browse files Browse the repository at this point in the history
  • Loading branch information
pondrejk committed May 23, 2024
1 parent 2618e01 commit c1d5063
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/foreman/cli/test_remoteexecution.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,40 @@ def test_positive_run_default_job_template(
assert 'Exit' in out
assert 'Internal Server Error' not in out

@pytest.mark.tier3
@pytest.mark.rhel_ver_list([8])
def test_positive_timeout_to_kill(self, module_org, rex_contenthost, module_target_sat):
"""Use timeout to kill setting to cancel the job
:id: 580f886b-ac24-4afa-9aca-e9afc5cfdc9c
:expectedresults: Verify the job was killed after specified times
:parametrized: yes
"""
client = rex_contenthost
command = 'sleep 160'
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}",
'timeout_to_kill': '5',
}
)
sleep(10)
assert_job_invocation_status(
module_target_sat, invocation_command['id'], client.hostname, 'failed'
)
out = module_target_sat.cli.JobInvocation.get_output(
{
'id': invocation_command['id'],
'host': client.hostname,
'organization-id': module_org.id,
}
)
assert 'Timeout for execution passed, trying to stop the job' in out

@pytest.mark.tier3
@pytest.mark.pit_client
@pytest.mark.pit_server
Expand Down

0 comments on commit c1d5063

Please sign in to comment.