From 613287d3cbb48c73c2187e3e0268c25fb42a3235 Mon Sep 17 00:00:00 2001 From: Saurabh Pandit Date: Fri, 22 Mar 2024 20:35:18 +0530 Subject: [PATCH] [PE-37978]: Add 'amazon' to repo_filename method with tests Revert "[PE-37978]: Add 'amazon' to repo_filename method with tests" This reverts commit 47f1238c9b3b1d0e50c55b5546d85d986dfe942c. [PE-37978]: Add 'amazon' to repo_filename method with tests --- lib/beaker/host/unix/file.rb | 2 +- spec/beaker/host/unix/file_spec.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/beaker/host/unix/file.rb b/lib/beaker/host/unix/file.rb index 89ee3127b..74a209976 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 = "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') diff --git a/spec/beaker/host/unix/file_spec.rb b/spec/beaker/host/unix/file_spec.rb index fd792c437..e8427534b 100644 --- a/spec/beaker/host/unix/file_spec.rb +++ b/spec/beaker/host/unix/file_spec.rb @@ -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' )