Skip to content
Merged
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
3 changes: 3 additions & 0 deletions src/rhsmlib/facts/pkg_arches.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ def get_arches_on_debian(self) -> Dict[str, str]:
except Exception as e:
log.error("Error getting dpkg foreign architecture: %s", e)

# All debian systems supports no-architecture packages (= 'all'), too
arches.append("all")

return {"supported_architectures": ",".join(arches)}

def get_all(self) -> Dict[str, str]:
Expand Down
8 changes: 4 additions & 4 deletions test/rhsmlib/facts/test_pkg_arches.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,28 @@ def test_single_arch_on_debian(self, MockCheckOutput):
collector = pkg_arches.SupportedArchesCollector(collected_hw_info={"distribution.name": "Debian"})
MockCheckOutput.side_effect = self.helper_dpkg_no_foreign
fact = collector.get_all()
self.assertEqual(fact["supported_architectures"], "amd64")
self.assertEqual(fact["supported_architectures"], "amd64,all")

@patch("subprocess.check_output")
def test_single_arch_on_ubuntu(self, MockCheckOutput):
collector = pkg_arches.SupportedArchesCollector(collected_hw_info={"distribution.name": "Ubuntu"})
MockCheckOutput.side_effect = self.helper_dpkg_no_foreign
fact = collector.get_all()
self.assertEqual(fact["supported_architectures"], "amd64")
self.assertEqual(fact["supported_architectures"], "amd64,all")

@patch("subprocess.check_output")
def test_multi_arch_on_ubuntu(self, MockCheckOutput):
collector = pkg_arches.SupportedArchesCollector(collected_hw_info={"distribution.name": "Debian"})
MockCheckOutput.side_effect = self.helper_dpkg_foreign
fact = collector.get_all()
self.assertEqual(fact["supported_architectures"], "amd64,i386")
self.assertEqual(fact["supported_architectures"], "amd64,i386,all")

@patch("subprocess.check_output")
def test_multi_arch_on_debian(self, MockCheckOutput):
collector = pkg_arches.SupportedArchesCollector(collected_hw_info={"distribution.name": "Ubuntu"})
MockCheckOutput.side_effect = self.helper_dpkg_foreign
fact = collector.get_all()
self.assertEqual(fact["supported_architectures"], "amd64,i386")
self.assertEqual(fact["supported_architectures"], "amd64,i386,all")

@patch("subprocess.check_output")
def test_none_arch_on_redhat(self, MockCheckOutput):
Expand Down