diff --git a/repos/system_upgrade/common/actors/distributionsignedrpmscanner/actor.py b/repos/system_upgrade/common/actors/distributionsignedrpmscanner/actor.py index a59c461e14..84ca7dc1e5 100644 --- a/repos/system_upgrade/common/actors/distributionsignedrpmscanner/actor.py +++ b/repos/system_upgrade/common/actors/distributionsignedrpmscanner/actor.py @@ -1,6 +1,6 @@ from leapp.actors import Actor from leapp.libraries.common import rhui -from leapp.models import DistributionSignedRPM, InstalledRPM, InstalledUnsignedRPM +from leapp.models import DistributionSignedRPM, InstalledRedHatSignedRPM, InstalledRPM, InstalledUnsignedRPM from leapp.tags import FactsPhaseTag, IPUWorkflowTag DISTRIBUTION_SIGS = { @@ -31,7 +31,7 @@ class DistributionSignedRpmScanner(Actor): name = 'distribution_signed_rpm_scanner' consumes = (InstalledRPM,) - produces = (DistributionSignedRPM, InstalledUnsignedRPM,) + produces = (DistributionSignedRPM, InstalledRedHatSignedRPM, InstalledUnsignedRPM,) tags = (IPUWorkflowTag, FactsPhaseTag) def process(self): @@ -40,6 +40,7 @@ def process(self): distribution_packager = DISTRIBUTION_PACKAGERS.get(distribution, 'not-available') signed_pkgs = DistributionSignedRPM() + rh_signed_pkgs = InstalledRedHatSignedRPM() unsigned_pkgs = InstalledUnsignedRPM() env_vars = self.configuration.leapp_env_vars @@ -102,9 +103,11 @@ def has_katello_prefix(pkg): ] ): signed_pkgs.items.append(pkg) + rh_signed_pkgs.items.append(pkg) continue unsigned_pkgs.items.append(pkg) self.produce(signed_pkgs) + self.produce(rh_signed_pkgs) self.produce(unsigned_pkgs) diff --git a/repos/system_upgrade/common/actors/distributionsignedrpmscanner/tests/test_distributionsignedrpmscanner.py b/repos/system_upgrade/common/actors/distributionsignedrpmscanner/tests/test_distributionsignedrpmscanner.py index 3b55b425ee..9005cbb383 100644 --- a/repos/system_upgrade/common/actors/distributionsignedrpmscanner/tests/test_distributionsignedrpmscanner.py +++ b/repos/system_upgrade/common/actors/distributionsignedrpmscanner/tests/test_distributionsignedrpmscanner.py @@ -2,7 +2,16 @@ from leapp.libraries.common import rpms from leapp.libraries.common.config import mock_configs -from leapp.models import DistributionSignedRPM, fields, InstalledRPM, InstalledUnsignedRPM, IPUConfig, Model, RPM +from leapp.models import ( + DistributionSignedRPM, + fields, + InstalledRedHatSignedRPM, + InstalledRPM, + InstalledUnsignedRPM, + IPUConfig, + Model, + RPM +) RH_PACKAGER = 'Red Hat, Inc. ' @@ -23,6 +32,7 @@ class MockModel(Model): def test_no_installed_rpms(current_actor_context): current_actor_context.run(config_model=mock_configs.CONFIG) assert current_actor_context.consume(DistributionSignedRPM) + assert current_actor_context.consume(InstalledRedHatSignedRPM) assert current_actor_context.consume(InstalledUnsignedRPM) @@ -51,6 +61,8 @@ def test_actor_execution_with_signed_unsigned_data(current_actor_context): current_actor_context.run(config_model=mock_configs.CONFIG) assert current_actor_context.consume(DistributionSignedRPM) assert len(current_actor_context.consume(DistributionSignedRPM)[0].items) == 5 + assert current_actor_context.consume(InstalledRedHatSignedRPM) + assert len(current_actor_context.consume(InstalledRedHatSignedRPM)[0].items) == 5 assert current_actor_context.consume(InstalledUnsignedRPM) assert len(current_actor_context.consume(InstalledUnsignedRPM)[0].items) == 4 @@ -71,6 +83,8 @@ def test_all_rpms_signed(current_actor_context): current_actor_context.run(config_model=mock_configs.CONFIG_ALL_SIGNED) assert current_actor_context.consume(DistributionSignedRPM) assert len(current_actor_context.consume(DistributionSignedRPM)[0].items) == 4 + assert current_actor_context.consume(InstalledRedHatSignedRPM) + assert len(current_actor_context.consume(InstalledRedHatSignedRPM)[0].items) == 4 assert not current_actor_context.consume(InstalledUnsignedRPM)[0].items @@ -89,6 +103,8 @@ def test_katello_pkg_goes_to_signed(current_actor_context): current_actor_context.run(config_model=mock_configs.CONFIG_ALL_SIGNED) assert current_actor_context.consume(DistributionSignedRPM) assert len(current_actor_context.consume(DistributionSignedRPM)[0].items) == 1 + assert current_actor_context.consume(InstalledRedHatSignedRPM) + assert len(current_actor_context.consume(InstalledRedHatSignedRPM)[0].items) == 1 assert not current_actor_context.consume(InstalledUnsignedRPM)[0].items @@ -104,6 +120,8 @@ def test_gpg_pubkey_pkg(current_actor_context): current_actor_context.run(config_model=mock_configs.CONFIG) assert current_actor_context.consume(DistributionSignedRPM) assert len(current_actor_context.consume(DistributionSignedRPM)[0].items) == 1 + assert current_actor_context.consume(InstalledRedHatSignedRPM) + assert len(current_actor_context.consume(InstalledRedHatSignedRPM)[0].items) == 1 assert current_actor_context.consume(InstalledUnsignedRPM) assert len(current_actor_context.consume(InstalledUnsignedRPM)[0].items) == 1 @@ -159,5 +177,7 @@ def test_has_package(current_actor_context): current_actor_context.run(config_model=mock_configs.CONFIG) assert rpms.has_package(DistributionSignedRPM, 'sample01', context=current_actor_context) assert not rpms.has_package(DistributionSignedRPM, 'nosuchpackage', context=current_actor_context) + assert rpms.has_package(InstalledRedHatSignedRPM, 'sample01', context=current_actor_context) + assert not rpms.has_package(InstalledRedHatSignedRPM, 'nosuchpackage', context=current_actor_context) assert rpms.has_package(InstalledUnsignedRPM, 'sample02', context=current_actor_context) assert not rpms.has_package(InstalledUnsignedRPM, 'nosuchpackage', context=current_actor_context)