def test_unit_applicable_updated_rpm_already_installed(self): # Errata refers to RPMs already installed, i.e. the consumer has these exact NEVRA already errata_obj = self.get_test_errata_object() errata_unit = Unit(TYPE_ID_ERRATA, {"id":errata_obj["id"]}, errata_obj, None) existing_units = [errata_unit] test_repo = profiler_mocks.get_repo("test_repo_id") conduit = profiler_mocks.get_profiler_conduit(existing_units=existing_units, repo_bindings=[test_repo]) example_errata = {"unit_key":errata_unit.unit_key, "type_id":TYPE_ID_ERRATA} prof = RPMErrataProfiler() report = prof.unit_applicable(self.test_consumer_been_updated, example_errata, None, conduit) self.assertFalse(report.applicable)
def test_unit_applicable_false(self): # Errata refers to RPMs which are NOT part of our test consumer's profile errata_obj = self.get_test_errata_object_unrelated() errata_unit = Unit(TYPE_ID_ERRATA, {"id":errata_obj["id"]}, errata_obj, None) existing_units = [errata_unit] test_repo = profiler_mocks.get_repo("test_repo_id") conduit = profiler_mocks.get_profiler_conduit(existing_units=existing_units, repo_bindings=[test_repo]) example_errata = {"unit_key":errata_unit.unit_key, "type_id":TYPE_ID_ERRATA} prof = RPMErrataProfiler() report = prof.unit_applicable(self.test_consumer, example_errata, None, conduit) self.assertFalse(report.applicable)
def test_unit_applicable_same_name_diff_arch(self): # Errata refers to RPMs that are x86_64, the test consumer is i386 # the rpms installed share the same name as the errata, but the client arch is different # so this errata is marked as unapplicable errata_obj = self.get_test_errata_object() errata_unit = Unit(TYPE_ID_ERRATA, {"id":errata_obj["id"]}, errata_obj, None) existing_units = [errata_unit] test_repo = profiler_mocks.get_repo("test_repo_id") conduit = profiler_mocks.get_profiler_conduit(existing_units=existing_units, repo_bindings=[test_repo]) example_errata = {"unit_key":errata_unit.unit_key, "type_id":TYPE_ID_ERRATA} prof = RPMErrataProfiler() report = prof.unit_applicable(self.test_consumer_i386, example_errata, None, conduit) self.assertFalse(report.applicable)