Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing foreman_ygg_worker, etc. #16690

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions tests/foreman/cli/test_remoteexecution.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,7 @@ def test_positive_run_job_in_chosen_directory(

:parametrized: yes
"""

client_repo = ohsnap.dogfood_repository(
settings.ohsnap,
product='client',
Expand All @@ -1112,6 +1113,7 @@ def test_positive_run_job_in_chosen_directory(
'location-ids': smart_proxy_location.id,
}
)

# register host with pull provider rex
result = rhel_contenthost.register(
module_org,
Expand Down Expand Up @@ -1220,27 +1222,34 @@ def test_positive_run_job_on_host_registered_to_pull_provider(
'location-ids': smart_proxy_location.id,
}
)
os_version = rhel_contenthost.os_version.major
repos = {
9: f'repo=https://download.copr.fedorainfracloud.org/results/@theforeman/client-nightly-staging-scratch-30b5701e-4697-5db3-abae-64a36197d5fb/rhel-9-x86_64/,repo=https://download.copr.fedorainfracloud.org/results/@theforeman/client-nightly-staging-scratch-6201a5d7-2c12-5ca4-b5bb-a592db86e283/rhel-9-x86_64/,repo={client_repo.baseurl},repo={settings.repos.rhel9_os.appstream},repo={settings.repos.rhel9_os.baseos}',
8: f'repo=https://download.copr.fedorainfracloud.org/results/@theforeman/client-nightly-staging-scratch-30b5701e-4697-5db3-abae-64a36197d5fb/rhel-8-x86_64/,repo=https://download.copr.fedorainfracloud.org/results/@theforeman/client-nightly-staging-scratch-6201a5d7-2c12-5ca4-b5bb-a592db86e283/rhel-8-x86_64/,repo={client_repo.baseurl},repo={settings.repos.rhel8_os.appstream},repo={settings.repos.rhel8_os.baseos}',
7: f'repo=https://download.copr.fedorainfracloud.org/results/@theforeman/client-nightly-staging-scratch-30b5701e-4697-5db3-abae-64a36197d5fb/rhel-7-x86_64/,https://download.copr.fedorainfracloud.org/results/@theforeman/client-nightly-staging-scratch-6201a5d7-2c12-5ca4-b5bb-a592db86e283/rhel-7-x86_64/,repo={client_repo.baseurl},repo={settings.repos.rhel7_os}',
}
service_name = 'yggdrasild'
# register host with pull provider rex (SAT-1677)
result = rhel_contenthost.register(
module_org,
smart_proxy_location,
module_ak_with_cv.name,
module_capsule_configured_mqtt,
setup_remote_execution_pull=True,
repo_data=f'repo={client_repo.baseurl}',
repo_data=repos[os_version],
ignore_subman_errors=True,
force=True,
)

assert result.status == 0, f'Failed to register host: {result.stderr}'
# check mqtt client is running
result = rhel_contenthost.execute('systemctl status yggdrasild')
result = rhel_contenthost.execute(f'systemctl status {service_name}')
assert result.status == 0, f'Failed to start yggdrasil on client: {result.stderr}'
# run script provider rex command
invocation_command = module_target_sat.cli_factory.job_invocation(
{
'job-template': 'Service Action - Script Default',
'inputs': 'action=status, service=yggdrasild',
'inputs': f'action=status, service={service_name}',
'search-query': f"name ~ {rhel_contenthost.hostname}",
}
)
Expand Down
Loading