Skip to content

Commit

Permalink
prepare puppet classes needed for FAM tests in setup_fam
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Oct 22, 2024
1 parent 36649e0 commit 84e1f22
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/foreman/sys/test_fam.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,30 @@ def setup_fam(module_target_sat, module_sca_manifest, install_import_ansible_rol
f'''sed -i 's|subscription_manifest_path:.*|subscription_manifest_path: "data/{module_sca_manifest.name}"|g' {config_file}'''
)

repo_path = '/fake_puppet1/system/releases/p/puppetlabs/'
module_tarball = 'puppetlabs-ntp-3.0.3.tar.gz'
local_path = '/tmp'
module_target_sat.execute(
f'curl --output {local_path}/{module_tarball} {settings.robottelo.repos_hosting_url}{repo_path}{module_tarball}',
)
module_target_sat.execute(
f'puppet module install --ignore-dependencies {local_path}/{module_tarball}'
)

module_target_sat.execute(
'mkdir -p /etc/puppetlabs/code/environments/production/modules/prometheus/'
)
module_target_sat.execute(
'echo "class prometheus(){}" > /etc/puppetlabs/code/environments/production/modules/prometheus/init.pp'
)
for puppetclass in ['haproxy_exporter', 'redis_exporter', 'statsd_exporter']:
module_target_sat.execute(
f'echo "class prometheus::{puppetclass}(){{}}" > /etc/puppetlabs/code/environments/production/modules/prometheus/{puppetclass}.pp'
)

smart_proxy = module_target_sat.api.SmartProxy().search(query={'search': f'name={module_target_sat.hostname}'})[0].read()
smart_proxy.import_puppetclasses()


@pytest.mark.pit_server
@pytest.mark.run_in_one_thread
Expand Down

0 comments on commit 84e1f22

Please sign in to comment.