From 6b0530ff269b0ac7d4c8cfeb72720e8b34265c6c Mon Sep 17 00:00:00 2001 From: Daniel Alley Date: Thu, 1 Aug 2019 15:57:45 -0400 Subject: [PATCH] Take copied modulemd_defaults into consideration for module errata copy re: #5055 https://pulp.plan.io/issues/5055 --- .gitignore | 1 + pulp_2_tests/constants.py | 3 ++- .../tests/rpm/api_v2/test_modularity.py | 17 +++++++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index d571174..bedc2da 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ __pycache__/ /build/ /dist/ /pulp_2_tests.egg-info/ +.idea/ diff --git a/pulp_2_tests/constants.py b/pulp_2_tests/constants.py index d0a0358..59613e2 100644 --- a/pulp_2_tests/constants.py +++ b/pulp_2_tests/constants.py @@ -149,7 +149,8 @@ 'errata_id': 'RHEA-2012:0059', 'modules_count': 2, 'rpm_count': 2, - 'total_available_units': 5, + 'module_defaults_count': 2, + 'total_available_units': 7, } ) """The information about a Modular Errata with RPM artifacts. diff --git a/pulp_2_tests/tests/rpm/api_v2/test_modularity.py b/pulp_2_tests/tests/rpm/api_v2/test_modularity.py index 8393b7f..1cf390d 100644 --- a/pulp_2_tests/tests/rpm/api_v2/test_modularity.py +++ b/pulp_2_tests/tests/rpm/api_v2/test_modularity.py @@ -1441,6 +1441,7 @@ class ModularErrataCopyTestCase(unittest.TestCase): Recursive copy of ``RHEA-2012:0059`` should copy: * 2 modules: ``duck`` and ``kangaroo``. + * 2 modulemd_defaults ``duck`` and ``kangaroo``. * 2 RPMS: ``kangaroo-0.3-1.noarch.rpm``, and ``duck-0.7-1.noarch.rpm``. Exercise the use of ``recursive`` and ``recursive_conservative``. @@ -1450,8 +1451,8 @@ class ModularErrataCopyTestCase(unittest.TestCase): def setUpClass(cls): """Create class-wide variables.""" cls.cfg = config.get_config() - if cls.cfg.pulp_version < Version('2.19'): - raise unittest.SkipTest('This test requires Pulp 2.19 or newer.') + if cls.cfg.pulp_version < Version('2.21'): + raise unittest.SkipTest('This test requires Pulp 2.21 or newer.') cls.client = api.Client(cls.cfg, api.json_handler) def test_recursive_noconservative_nodependency(self): @@ -1502,6 +1503,12 @@ def make_assertions_dependency(self, repo): repo['content_unit_counts'] ) + self.assertEqual( + repo['content_unit_counts']['modulemd_defaults'], + MODULE_FIXTURES_ERRATA['module_defaults_count'], + repo['content_unit_counts'] + ) + # older RPM package already present has to be added to total of RPM # packages after copy. self.assertEqual( @@ -1524,6 +1531,12 @@ def make_assertions_nodependency(self, repo): repo['content_unit_counts'] ) + self.assertEqual( + repo['content_unit_counts']['modulemd_defaults'], + MODULE_FIXTURES_ERRATA['module_defaults_count'], + repo['content_unit_counts'] + ) + self.assertEqual( repo['total_repository_units'], MODULE_FIXTURES_ERRATA['total_available_units'],