Skip to content

Commit

Permalink
[6.15] negative test for webhook task (SatelliteQE#13049)
Browse files Browse the repository at this point in the history
negative test for webhook task
  • Loading branch information
pondrejk authored and shweta83 committed Apr 10, 2024
1 parent 4b76bd2 commit 54f4fbe
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/foreman/api/test_webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,28 @@ def test_positive_event_triggered(self, module_org, target_sat, setting_update):
repo.sync()
assert_event_triggered(shell, hook.event)
target_sat.wait_for_tasks(f'Deliver webhook {hook.name}')

@pytest.mark.parametrize('setting_update', ['safemode_render=False'], indirect=True)
def test_negative_event_task_failed(self, module_org, target_sat, setting_update):
"""Create a webhook with unreachable target and assert the associated task
failed
:id: d4a49556-9413-46e8-bcb5-7afd0184bdb2
:expectedresults: Deliver webhook task fails
:CaseImportance: High
"""
hook = target_sat.api.Webhooks(
event='actions.katello.repository.sync_succeeded',
http_method='GET',
target_url="http://localhost/target",
).create()
repo = target_sat.api.Repository(
organization=module_org, content_type='yum', url=settings.repos.yum_0.url
).create()
with target_sat.session.shell() as shell:
shell.send('foreman-tail')
repo.sync()
assert_event_triggered(shell, hook.event)
target_sat.wait_for_tasks(f'Deliver webhook {hook.name}', must_succeed=False)

0 comments on commit 54f4fbe

Please sign in to comment.