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

PE-37978: Add 'amazon' to repo_filename method with tests for 4.x #1857

Closed
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
2 changes: 1 addition & 1 deletion lib/beaker/host/unix/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def repo_filename(package_name, build_version)
repo_filename = "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 ['centos', 'redhat'].include?(variant)

variant = 'redhatfips' if self['packaging_platform']&.include?('redhatfips')
Expand Down
8 changes: 8 additions & 0 deletions spec/beaker/host/unix/file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ def logger
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' )
Expand Down
Loading