Project

Profile

Help

Issue #1570

closed

Reading an RPM repo returns incorrect rpm_unit_counts

Added by Ichimonji10 about 8 years ago. Updated almost 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Master
Platform Release:
2.8.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

Let's say you have a repository, and you read information about that repository by issuing an HTTP GET request to /pulp/api/v2/repositories/{repo_id}/. The server will return an object like so:

{u'_href': u'/pulp/api/v2/repositories/5f6f8439-ff54-41d7-884f-345b6269615c/',
 u'_id': {u'$oid': u'56a25837e7798903cef0ad8b'},
 u'_ns': u'repos',
 u'content_unit_counts': {u'erratum': 4,
                          u'package_category': 1,
                          u'package_group': 2,
                          u'rpm': 32},
 u'description': None,
 u'display_name': u'5f6f8439-ff54-41d7-884f-345b6269615c',
 u'id': u'5f6f8439-ff54-41d7-884f-345b6269615c',
 u'last_unit_added': u'2016-01-22T16:26:39Z',
 u'last_unit_removed': None,
 u'notes': {u'_repo-type': u'rpm-repo'},
 u'scratchpad': {u'checksum_type': u'sha256'}}

Unfortunately, the ['content_unit_counts']['rpm'] section is frequently incorrect. Here is a test run from my local test system:

$ PULP_SMASH_CONFIG_FILE=$PS_CONFIG python -m unittest2 pulp_smash.tests.rpm.api_v2.test_sync_publish.SyncValidFeedTestCase
...
======================================================================
FAIL: test_unit_count_on_repo (pulp_smash.tests.rpm.api_v2.test_sync_publish.SyncValidFeedTestCase) (unit_type='rpm')
Verify that the sync added the correct number of units to the repo.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ichimonji10/code/pulp-smash/pulp_smash/tests/rpm/api_v2/test_sync_publish.py", line 209, in test_unit_count_on_repo
    self.assertEqual(counts.get(unit_type), count)
AssertionError: 34 != 32

----------------------------------------------------------------------
Ran 4 tests in 12.259s

FAILED (failures=1)

As you can see, the "rpm" section has a count of 34, not 32 as expected. You can verify these results by going to the repository and counting the number of RPMs there.


Files


Related issues

Related to Pulp - Issue #1467: Repository unit counts are not always accurate when the plugin authors forget to update themCLOSED - CURRENTRELEASEpcreechActions

Also available in: Atom PDF