Bug 672803

Summary: TestProductRepo needs to be configured to not use real directories
Product: [Retired] Pulp Reporter: Jay Dobies <jason.dobies>
Component: z_otherAssignee: Jason Connor <jconnor>
Status: CLOSED NOTABUG QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: mmccune
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-26 13:33:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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.