diff --git a/lib/beaker/host/unix/file.rb b/lib/beaker/host/unix/file.rb index 97f86313c..4b4e5bd90 100644 --- a/lib/beaker/host/unix/file.rb +++ b/lib/beaker/host/unix/file.rb @@ -113,7 +113,7 @@ def repo_filename(package_name, build_version) repo_filename = format("pl-%s-%s-", package_name, build_version) case variant - when /fedora|el|redhat|centos|cisco_nexus|cisco_ios_xr|opensuse|sles/ + when /amazon|fedora|el|redhat|centos|cisco_nexus|cisco_ios_xr|opensuse|sles/ variant = 'el' if %w[centos redhat].include?(variant) variant = 'redhatfips' if self['packaging_platform']&.include?('redhatfips') diff --git a/spec/beaker/host/unix/file_spec.rb b/spec/beaker/host/unix/file_spec.rb index b1c4a7161..fda772e9b 100644 --- a/spec/beaker/host/unix/file_spec.rb +++ b/spec/beaker/host/unix/file_spec.rb @@ -133,6 +133,14 @@ def to_s expect(filename).to be === correct end + it 'builds the filename correctly for amazon-based platforms' do + @platform = 'amazon-2023-x86_64' + allow(instance).to receive(:is_pe?).and_return(true) + filename = instance.repo_filename('pkg_name', 'pkg_version') + correct = 'pl-pkg_name-pkg_version-amazon-2023-x86_64.repo' + expect(filename).to be === correct + end + it 'builds the filename correctly for debian-based platforms' do @platform = 'debian-8-x86_64' filename = instance.repo_filename('pkg_name', 'pkg_version10')