CxtAdmDriver unit tests try to open files on the system

Bug #1423261 reported by Eric Harney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Eric Harney

Bug Description

Something is not mocked out properly here:

$ ./run_tests.sh -V cinder.tests.targets.test_cxt_driver
Traceback (most recent call last):
_StringException: Traceback (most recent call last):
  File "/home/eharney/src/cinder-trunk2/cinder/tests/targets/test_cxt_driver.py", line 203, in test_ensure_export
    self.fake_volumes_dir)
  File "/home/eharney/src/cinder-trunk2/cinder/volume/targets/iscsi.py", line 240, in ensure_export
    chap_auth = self._get_target_chap_auth(context, iscsi_name)
  File "/home/eharney/src/cinder-trunk2/cinder/volume/targets/cxt.py", line 113, in _get_target_chap_auth
    with open(volume_path, 'r') as f:
IOError: [Errno 13] Permission denied: '/var/lib/cinder/volumes/cxt/testvol'
Traceback (most recent call last):
_StringException: Empty attachments:
  stderr
  stdout

Traceback (most recent call last):
  File "/home/eharney/src/cinder-trunk2/cinder/tests/targets/test_cxt_driver.py", line 203, in test_ensure_export
    self.fake_volumes_dir)
  File "/home/eharney/src/cinder-trunk2/cinder/volume/targets/iscsi.py", line 240, in ensure_export
    chap_auth = self._get_target_chap_auth(context, iscsi_name)
  File "/home/eharney/src/cinder-trunk2/cinder/volume/targets/cxt.py", line 113, in _get_target_chap_auth
    with open(volume_path, 'r') as f:
IOError: [Errno 13] Permission denied: '/var/lib/cinder/volumes/cxt/testvol'

Traceback (most recent call last):
_StringException: Empty attachments:
  stderr
  stdout

Traceback (most recent call last):
  File "/home/eharney/src/cinder-trunk2/cinder/tests/targets/test_cxt_driver.py", line 203, in test_ensure_export
    self.fake_volumes_dir)
  File "/home/eharney/src/cinder-trunk2/cinder/volume/targets/iscsi.py", line 240, in ensure_export
    chap_auth = self._get_target_chap_auth(context, iscsi_name)
  File "/home/eharney/src/cinder-trunk2/cinder/volume/targets/cxt.py", line 113, in _get_target_chap_auth
    with open(volume_path, 'r') as f:
IOError: [Errno 13] Permission denied: '/var/lib/cinder/volumes/cxt/testvol'

Ran 6 tests in 9.478s

FAILED (failures=1)

Tags: drivers tests
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/157089

Changed in cinder:
assignee: nobody → Eric Harney (eharney)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/157089
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=dead95c68b0fe3fcad84af69cc5e715fabccde22
Submitter: Jenkins
Branch: master

commit dead95c68b0fe3fcad84af69cc5e715fabccde22
Author: Eric Harney <email address hidden>
Date: Wed Feb 18 13:04:09 2015 -0500

    Tests: Fix cxt target tests opening files

    This fixes the test_ensure_export test so that it does
    not try to open files from /var/lib/cinder/.

    Closes-Bug: #1423261

    Change-Id: I79ed64918b2ae7fb5ea8b5cedeb1dca83898c759

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → kilo-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: kilo-3 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.