Skip to content

Commit

Permalink
capsule upgrade playbook naming change (#10425)
Browse files Browse the repository at this point in the history
* capsule upgrade playbook naming change

* Update tests/foreman/api/test_remoteexecution.py

Co-authored-by: Gaurav Talreja <[email protected]>

* Apply suggestions from code review

Co-authored-by: Gaurav Talreja <[email protected]>

* Update test_remoteexecution.py

Co-authored-by: Gaurav Talreja <[email protected]>
  • Loading branch information
pondrejk and Gauravtalreja1 committed Dec 19, 2022
1 parent 1d62430 commit ffc8e50
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
11 changes: 7 additions & 4 deletions tests/foreman/api/test_remoteexecution.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from robottelo.api.utils import wait_for_tasks
from robottelo.hosts import get_sat_version
from robottelo.utils.issue_handlers import is_open

CAPSULE_TARGET_VERSION = f'6.{get_sat_version().minor}.z'

Expand All @@ -36,14 +37,16 @@ def test_positive_run_capsule_upgrade_playbook(module_capsule_configured, target
:expectedresults: Capsule is upgraded successfully
:BZ: 2152951
:CaseImportance: Medium
"""
template_name = (
'Smart Proxy Upgrade Playbook' if is_open('BZ:2152951') else 'Capsule Upgrade Playbook'
)
template_id = (
target_sat.api.JobTemplate()
.search(query={'search': 'name="Capsule Upgrade Playbook"'})[0]
.id
target_sat.api.JobTemplate().search(query={'search': f'name="{template_name}"'})[0].id
)

module_capsule_configured.add_rex_key(satellite=target_sat)
job = target_sat.api.JobInvocation().run(
synchronous=False,
Expand Down
11 changes: 7 additions & 4 deletions tests/foreman/destructive/test_remoteexecution.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

from robottelo.config import get_credentials
from robottelo.hosts import get_sat_version
from robottelo.utils.issue_handlers import is_open

CAPSULE_TARGET_VERSION = f'6.{get_sat_version().minor}.z'

Expand All @@ -41,14 +42,16 @@ def test_negative_run_capsule_upgrade_playbook_on_satellite(target_sat):
:expectedresults: Should fail
:BZ: 2152951
:CaseImportance: Medium
"""
template_name = (
'Smart Proxy Upgrade Playbook' if is_open('BZ:2152951') else 'Capsule Upgrade Playbook'
)
template_id = (
target_sat.api.JobTemplate()
.search(query={'search': 'name="Capsule Upgrade Playbook"'})[0]
.id
target_sat.api.JobTemplate().search(query={'search': f'name="{template_name}"'})[0].id
)

target_sat.add_rex_key(satellite=target_sat)
with pytest.raises(TaskFailedError) as error:
target_sat.api.JobInvocation().run(
Expand Down

0 comments on commit ffc8e50

Please sign in to comment.