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 22, 2024
1 parent 9e10133 commit c8e03a2
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 = 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')
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 @@ -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')
Expand Down

0 comments on commit c8e03a2

Please sign in to comment.