Skip to content

Commit

Permalink
Use forked beaker-docker to support Amazon 2023 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock committed Jan 25, 2024
1 parent 4c6406b commit ed0a356
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ group :system_tests do
gem "beaker-pe", require: false
gem "beaker-hostgenerator"
gem "beaker-rspec"
gem "beaker-docker"
gem "beaker-puppet"
gem "beaker-docker", git: 'https://github.com/treydock/beaker-docker.git', branch: 'amazon-2023'
gem "beaker-puppet", git: 'https://github.com/puppetlabs/beaker-puppet.git', ref: '6063d22b6c4449df795731f5853c3c75241240c4'
gem "beaker-puppet_install_helper", require: false
gem "beaker-module_install_helper", require: false
end
Expand Down
2 changes: 2 additions & 0 deletions data/os/Amazon.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
openondemand::manage_epel: false
2 changes: 2 additions & 0 deletions hiera.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ defaults: # Used for any hierarchy level that omits these keys.
data_hash: yaml_data # Use the built-in YAML backend.

hierarchy:
- name: 'os name'
path: "os/%{facts.os.name}.yaml"
- name: 'os family - os major version'
path: "os/%{facts.os.family}/%{facts.os.release.major}.yaml"
- name: 'os family'
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@
],
"pdk-version": "2.7.1",
"template-url": "https://github.com/treydock/pdk-templates.git#master",
"template-ref": "heads/master-0-ge8bcc28"
"template-ref": "heads/master-0-g5a59870"
}
4 changes: 1 addition & 3 deletions spec/acceptance/nodesets/amazon2023.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ HOSTS:
amazon-2023:
roles:
- agent
# Update to non-hack version once beaker-docker supports Amazon
# platform: amazon-2023-x86_64
platform: el-2023-x86_64
platform: amazon-2023-x86_64
hypervisor: docker
image: amazonlinux:2023
docker_preserve_image: true
Expand Down
12 changes: 12 additions & 0 deletions spec/shared_examples/repo_rpm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,25 @@
end
end

if facts[:os]['name'] == 'Amazon'
it { is_expected.not_to contain_class('epel') }
else
it { is_expected.to contain_class('epel') }
end

context 'when manage_dependency_repos => false' do
let(:params) { { manage_dependency_repos: false } }

it { is_expected.not_to contain_package('nodejs') }
it { is_expected.not_to contain_package('ruby') }
end

context 'when manage_epel => false' do
let(:params) { { manage_epel: false } }

it { is_expected.not_to contain_class('epel') }
end

context 'when repo_nightly => true' do
let(:params) { { repo_nightly: true } }

Expand Down
3 changes: 2 additions & 1 deletion spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
Dir["#{dir}/acceptance/shared_examples/**/*.rb"].sort.each { |f| require f }
require 'spec_helper_acceptance_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_acceptance_local.rb'))

run_puppet_install_helper
run_puppet_install_helper unless ENV['BEAKER_set'] == 'debian-12'
on hosts, 'apt install -y puppet-agent' if ENV['BEAKER_set'] == 'debian-12'
install_module_on(hosts)
install_module_dependencies_on(hosts)

Expand Down

0 comments on commit ed0a356

Please sign in to comment.