Skip to content

Commit

Permalink
[PE-37978]: Add 'amazon' to repo_filename method with tests
Browse files Browse the repository at this point in the history
Revert "[PE-37978]: Add 'amazon' to repo_filename method with tests"

This reverts commit 47f1238.

[PE-37978]: Add 'amazon' to repo_filename method with tests
  • Loading branch information
span786 committed Mar 27, 2024
1 parent 73424bd commit 613287d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

0 comments on commit 613287d

Please sign in to comment.