Skip to content

Commit

Permalink
fixes in capsule upgrade playbook tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pondrejk committed Oct 17, 2022
1 parent 8d54e9d commit 875979e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tests/foreman/api/test_remoteexecution.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import pytest

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


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


@pytest.mark.tier4
Expand Down
14 changes: 9 additions & 5 deletions tests/foreman/destructive/test_remoteexecution.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
from nailgun import client
from nailgun.entity_mixins import TaskFailedError

from robottelo.hosts import get_sat_version

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

pytestmark = pytest.mark.destructive

Expand All @@ -41,7 +42,6 @@ def test_negative_run_capsule_upgrade_playbook_on_satellite(target_sat):
:CaseImportance: Medium
"""
sat = target_sat.nailgun_host
template_id = (
target_sat.api.JobTemplate()
.search(query={'search': 'name="Capsule Upgrade Playbook"'})[0]
Expand All @@ -58,15 +58,19 @@ def test_negative_run_capsule_upgrade_playbook_on_satellite(target_sat):
'whitelist_options': "repositories-validqqate,repositories-setup",
},
'targeting_type': "static_query",
'search_query': f"name = {sat.name}",
'search_query': f"name = {target_sat.hostname}",
}
)
assert 'A sub task failed' in error.value.args[0]
job = target_sat.api.JobInvocation().search(
query={'search': f'host={sat.name},status=failed,description="Capsule Upgrade Playbook"'}
query={
'search': f'host={target_sat.hostname},'
'status=failed,description="Capsule Upgrade Playbook"'
}
)[0]
host = target_sat.api.Host().search(query={'search': target_sat.hostname})
response = client.get(
f'{target_sat.url}/api/job_invocations/{job.id}/hosts/{sat.id}',
f'{target_sat.url}/api/job_invocations/{job.id}/hosts/{host[0].id}',
auth=(target_sat.username, target_sat.password),
verify=False,
)
Expand Down

0 comments on commit 875979e

Please sign in to comment.