Skip to content

Commit

Permalink
Fixes #36740 - applicability must mind deb's arch
Browse files Browse the repository at this point in the history
  • Loading branch information
m-bucher committed Sep 13, 2023
1 parent cfc586c commit 68fbf92
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def fetch_deb_content_ids
deb_version_compare = Arel::Nodes::NamedFunction.new('deb_version_cmp', [deb[:version], installed_deb[:version]]).gt(0)

content = deb.join(repo_deb).on(repo_deb[:deb_id].eq(deb[:id]))
.join(installed_deb).on(installed_deb[:name].eq(deb[:name]))
.join(installed_deb).on(installed_deb[:name].eq(deb[:name]), installed_deb[:architecture].eq(deb[:architecture]))
.join(host_installed_deb).on(host_installed_deb[:installed_deb_id].eq(installed_deb[:id]))
.where(deb_version_compare)
.where(host_installed_deb[:host_id].eq(self.content_facet.host.id))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ def test_applicable_differences_adds_deb_id
assert_equal [[@deb_one_new.id], []], deb_differences
end

def test_applicable_differences_should_not_mix_deb_architectures
@installed_deb1.architecture = 'i386'
@installed_deb1.save
deb_differences = ::Katello::Applicability::ApplicableContentHelper.new(@host2.content_facet, ::Katello::Deb, bound_repos(@host2)).applicable_differences
assert_equal [[], []], deb_differences
end

def test_applicable_differences_adds_and_removes_no_deb_ids
::Katello::Applicability::ApplicableContentHelper.new(@host2.content_facet, ::Katello::Deb, bound_repos(@host2)).calculate_and_import
deb_differences = ::Katello::Applicability::ApplicableContentHelper.new(@host2.content_facet, ::Katello::Deb, bound_repos(@host2)).applicable_differences
Expand Down

0 comments on commit 68fbf92

Please sign in to comment.