Bug 672803 - TestProductRepo needs to be configured to not use real directories
Summary: TestProductRepo needs to be configured to not use real directories
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Jason Connor
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-26 13:19 UTC by Jay Dobies
Modified: 2014-03-31 01:39 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-01-26 13:33:13 UTC


Attachments (Terms of Use)

Description Jay Dobies 2011-01-26 13:19:17 UTC
This has come up in the past but we keep getting sloppy and not doing it. Directories should be configurable so that we can mock them out entirely during test runs. There is no reason a test case should affect "real" files and directories on the filesystem. They should be configured to write to temporary directories where permissions aren't an issue and the risk of affecting live data is minimized.

The following was seen by a pulp user trying to run the tests.

(tests that passed not included in this paste)...
======================================================================
ERROR: test_create_product_repo (test_product_repo.TestProductRepo)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/workspace/pulp/test/unit/test_product_repo.py", line 63, in
test_create_product_repo
    self.rapi.create_product_repo(content_set, cert_data,
groupid="test-product")
  File "/workspace/pulp/test/unit/../../src/pulp/server/compat.py", line
40, in _decorator
    return decorator(*args,**kwargs)
  File "/workspace/pulp/test/unit/../../src/pulp/server/auditing.py",
line 204, in _audit
    result = method(*args, **kwargs)
  File "/workspace/pulp/test/unit/../../src/pulp/server/api/repo.py",
line 321, in create_product_repo
    cert_files = self._write_certs_to_disk(groupid, cert_data)
  File "/workspace/pulp/test/unit/../../src/pulp/server/api/repo.py",
line 290, in _write_certs_to_disk
    os.makedirs(cert_dir)
  File "/usr/lib64/python2.6/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/etc/pki/content/test-product'

Comment 1 Jay Dobies 2011-01-26 13:33:13 UTC
I'm going to close as not a bug. I think the user was running out of test as the working directory which was causing the config override to not be picked up.


Note You need to log in before you can comment on or make changes to this bug.