pulp_2_tests.tests.rpm.api_v2.test_comps_xml

Location: Pulp 2 TestsTestspulp_2_tests.tests.rpm.api_v2.test_comps_xml

Verify an RPM repository’s comps.xml file.

Each RPM repository has a repodata directory, in which various XML files containing metadata are present. This module houses test cases which verify the comps.xml file. For a sample comps.xml file, search through pulp_2_tests.constants.RPM_SIGNED_FEED_URL.

class pulp_2_tests.tests.rpm.api_v2.test_comps_xml.SyncRepoTestCase(*args, **kwargs)

Bases: pulp_smash.pulp2.utils.BaseAPITestCase

Sync in content from another RPM repository and publish it.

More specifically, this test case does the following:

  1. Create a repository with a feed and a distributor.
  2. Sync and publish the repository.
  3. Verify the comps.xml file available in the published repository.
classmethod setUpClass()

Create, sync and publish a repository. Fetch its comps.xml.

test_first_level_element()

Verify the top-level element is named “comps”.

test_langpacks_element()

Verify a langpacks element is in comps.xml.

Support for package langpacks has been added in Pulp 2.9. Consequently, this test is skipped on earlier versions of Pulp.

test_second_level_elements()

Verify the correct second-level elements are present.

class pulp_2_tests.tests.rpm.api_v2.test_comps_xml.UploadPackageGroupsTestCase(*args, **kwargs)

Bases: pulp_smash.pulp2.utils.BaseAPITestCase

Upload custom package groups to an RPM repository and publish it.

More specifically, this test case does the following:

  1. Create a repository without a feed.
  2. Add yum distributor to the repository.
  3. Generate several custom package groups. Upload each of them to Pulp, and import them into the repository.
  4. Publish the repository.
  5. Verify the comps.xml file available in the published repository.
classmethod setUpClass()

Create an RPM repository, upload package groups, and publish.

test_conditional_requires()

Assert requires attributes are correct on conditional packages.

This test assumes test_packagelist_values() has passed.

test_count()

Assert there is one “group” element per imported group unit.

test_default_default()

Assert that the default value of default tag is ‘false’.

test_default_uservisible()

Assert that the default value of uservisible tag is ‘false’.

test_display_order_occurences()

Assert display_order occurs once if omitted from the unit.

test_display_order_value()

Assert display_order is “1024” if omitted from the unit.

This test may be skipped if Pulp #1787 is open.

test_has_groups()

Assert that each imported group unit appears in the XML.

test_ids_alone()

Assert each “group” element has one “id” child element.

test_ids_unique()

Assert each group ID is unique.

test_one_task_per_import()

Assert only one task is spawned per package group upload.

test_packagelist_values()

Assert packagelist contains packagereq elements with correct text.

This test verifies that, for each of the 4 possible types of package in a group, the packagelist in the group XML contains exactly the package names in the uploaded unit.

test_root()

Assert the root element of the tree has a tag of “comps”.

test_single_elements()

Assert that certain tags appear under groups exactly once.

test_tasks_result()

Assert each task’s result success flag (if present) is true.

This test assumes test_one_task_per_import() passes.

test_tasks_state()

Assert each task’s state is “finished”.

This test assumes test_one_task_per_import() passes.

test_translated_string_count()

Assert that the XML has correct number of translated strings.

Some fields (name, description) are translatable. The tags for these fields are expected to appear once per translation, plus once for the untranslated string. This test verifies that this is the case.

test_translated_string_values()

Assert that the XML has correct values for translated strings.

Some fields (name, description) are translatable. The tags for these fields are expected to appear once per translation, plus once for the untranslated string. This test verifies that each translated string matches exactly the string provided when the group unit was imported.

test_verbatim_boolean_fields()

Assert boolean fields on a unit appear correctly in generated XML.

This test is similar to test_verbatim_string_fields(), but additionally verifies that boolean values are serialized as expected in the XML (i.e. as text ‘true’ or ‘false’).

test_verbatim_string_fields()

Assert string fields on a unit appear unmodified in generated XML.

This test covers fields from a group unit which are expected to be serialized as-is into top-level tags under a <group>. For example, this test asserts that the ‘name’ attribute on a group unit will appear in the generated XML as:

<group>
    <name>some-value</name>
    ...
</group>
class pulp_2_tests.tests.rpm.api_v2.test_comps_xml.UploadTwiceTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Upload a package group twice.

The first upload should create a new package group, and the second should update the existing package group. See: Pulp #2514.

test_all()

Upload a package group to a repository twice.

pulp_2_tests.tests.rpm.api_v2.test_comps_xml.setUpModule()

Possibly skip the tests in this module.

Skip tests if Pulp #2277 affects us.