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

Add support for Ubuntu 24.04 #257

Merged
merged 1 commit into from
May 31, 2024
Merged
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion lib/beaker-puppet/install_utils/puppet5.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,12 @@ def install_from_build_data_url(project_name, sha_yaml_url, local_hosts = nil)

install_targets.each do |host|
artifact_url, repoconfig_url = host_urls(host, build_details, base_url)
if repoconfig_url.nil?
if host.platform.variant == 'ubuntu' && host.platform.version.to_f >= 24.04
# install the specific artifact we built, not based on how its repos are configured
tmp_file = host.tmpfile('puppet-agent')
on(host, "curl -L --output #{tmp_file} #{artifact_url}")
host.install_local_package(tmp_file)
elsif repoconfig_url.nil?
install_artifact_on(host, artifact_url, project_name)
else
install_repo_configs_on(host, repoconfig_url)
Expand Down
19 changes: 18 additions & 1 deletion spec/beaker-puppet/install_utils/puppet5_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def logger
describe ClassMixedWithDSLInstallUtils do
let(:hosts) do
make_hosts({ pe_ver: '3.0',
platform: 'linux',
platform: Beaker::Platform.new('redhat-9-x86_64'),
roles: ['agent'],
type: 'foss', }, 4)
end
Expand Down Expand Up @@ -363,6 +363,23 @@ def run_shared_test_steps
end.to raise_error(Beaker::DSL::Outcomes::FailTest, /project_name.*#{sha_yaml_url}/)
end

it 'installs the artifact on newer Ubuntu hosts' do
artifact_url = 'https://builds.example.com/puppet-agent.deb'
project_name = 'fake_project_66'
allow(subject).to receive(:fetch_build_details)
allow(subject).to receive(:configure_type_defaults_on)
allow(subject).to receive(:host_urls) { [artifact_url, ''] }

hosts = [make_host('host.example.com', platform: Beaker::Platform.new('ubuntu-24.04-x86_64'))]
allow(subject).to receive(:hosts).and_return(hosts)
hosts.each do |host|
allow(host).to receive(:tmpfile).and_return('/tmp/puppet-agent.GcHvLR')
allow(subject).to receive(:on).with(host, /^curl/)
expect(host).to receive(:install_local_package).with('/tmp/puppet-agent.GcHvLR')
end
subject.install_from_build_data_url(project_name, 'sha_yaml_url')
end

it 'runs host.install_package instead of #install_artifact_on if theres a repo_config' do
repoconfig_url = 'pants/man/shoot/to/the/stars'
project_name = 'fake_project_66'
Expand Down