Project

Profile

Help

Refactor #116

closed

The tests for pulp_rpm.plugins.importers.yum.sync cannot be run independently

Added by rbarlow almost 10 years ago. Updated over 5 years ago.

Status:
CLOSED - DUPLICATE
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

If the tests for the yum sync module are run independently, I get a permission denied error:

$ nosetests -sx plugins/test/unit/plugins/importers/yum/test_sync.py
.....E
======================================================================
ERROR: test_drpms_check_all_and_associate_positive (test.unit.plugins.importers.yum.test_sync.TestAlreadyDownloadedUnits)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/mock.py", line 1201, in patched
return func(*args, **keywargs)
File "/home/rbarlow/devel/pulp_rpm/plugins/test/unit/plugins/importers/yum/test_sync.py", line 1284, in test_drpms_check_all_and_associate_positive
result = check_all_and_associate(input_units, self.conduit)
File "/home/rbarlow/devel/pulp_rpm/plugins/pulp_rpm/plugins/importers/yum/existing.py", line 122, in check_all_and_associate
unit.metadata, relative_path)
File "/home/rbarlow/devel/pulp/server/pulp/plugins/conduits/mixins.py", line 477, in init_unit
path = content_query_manager.request_content_unit_file_path(type_id, relative_path)
File "/home/rbarlow/devel/pulp/server/pulp/server/managers/content/query.py", line 274, in request_content_unit_file_path
unit_path = os.path.join(self.get_root_content_dir(content_type), relative_path)
File "/home/rbarlow/devel/pulp/server/pulp/server/managers/content/query.py", line 250, in get_root_content_dir
os.makedirs(root)
File "/usr/lib64/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
ImporterConduitException: [Errno 13] Permission denied: '/var/lib/pulp/content/drpm'
-------------------- >> begin captured logging << --------------------
pulp.plugins.conduits.mixins: ERROR: Exception from server requesting unit filename for relative path [test-filename]
Traceback (most recent call last):
File "/home/rbarlow/devel/pulp/server/pulp/plugins/conduits/mixins.py", line 477, in init_unit
path = content_query_manager.request_content_unit_file_path(type_id, relative_path)
File "/home/rbarlow/devel/pulp/server/pulp/server/managers/content/query.py", line 274, in request_content_unit_file_path
unit_path = os.path.join(self.get_root_content_dir(content_type), relative_path)
File "/home/rbarlow/devel/pulp/server/pulp/server/managers/content/query.py", line 250, in get_root_content_dir
os.makedirs(root)
File "/usr/lib64/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/var/lib/pulp/content/drpm'
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 6 tests in 0.025s

FAILED (errors=1)

These tests should not be attempting to operate on /var/lib, and it seems that they are relying on some mock that is setup by a prior tests when run with run-tests.py.


Related issues

Is duplicate of Pulp - Refactor #132: Ensure all tests can be run independantlyCLOSED - WONTFIX

Actions
Actions #1

Updated by bmbouter almost 10 years ago

  • Status changed from NEW to 7

This is a more specific version of #132. That refactor will resolve this issue and all similar ones like it.

Actions #2

Updated by bmbouter almost 10 years ago

  • Is duplicate of Refactor #132: Ensure all tests can be run independantly added
Actions #3

Updated by bmbouter almost 10 years ago

  • Status changed from 7 to CLOSED - DUPLICATE
Actions #4

Updated by bmbouter over 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF