← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1630420] Re: config_drive unit tests (libvirt driver) aren't mocking genisoimage

 

Reviewed:  https://review.openstack.org/383524
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=b90df7c9c7042d2a8f104f66220f81ecb2951597
Submitter: Jenkins
Branch:    master

commit b90df7c9c7042d2a8f104f66220f81ecb2951597
Author: Diana Clarke <diana.joan.clarke@xxxxxxxxx>
Date:   Thu Oct 6 21:52:03 2016 -0400

    Patch mkisofs calls
    
    The nova unit tests recently started to fail on systems lacking mkisofs
    (like mac osx). Skip these mkisofs calls by patching _make_iso9660.
    
    Change-Id: I350aafa878616f74df506c1bc9ee5f26ea06fe97
    Closes-Bug: #1630420


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1630420

Title:
  config_drive unit tests (libvirt driver) aren't mocking genisoimage

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  I was running unit tests on a bare bones vm that didn't have
  genisoimage installed and the test_rescue_config_drive test failed.

  ==============================
  Failed 1 tests - output below:
  ==============================

  nova.tests.unit.virt.libvirt.test_driver.LibvirtDriverTestCase.test_rescue_config_drive
  ---------------------------------------------------------------------------------------

  Captured traceback:
  ~~~~~~~~~~~~~~~~~~~
      Traceback (most recent call last):
        File "nova/tests/unit/virt/libvirt/test_driver.py", line 16420, in test_rescue_config_drive
          instance, exists=lambda name: name != 'disk.config.rescue')
        File "/home/auggy/nova/.tox/py27/local/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
          return func(*args, **keywargs)
        File "nova/tests/unit/virt/libvirt/test_driver.py", line 16374, in _test_rescue
          network_info, image_meta, rescue_password)
        File "nova/virt/libvirt/driver.py", line 2531, in rescue
          self._create_domain(xml, post_xml_callback=gen_confdrive)
        File "/home/auggy/nova/.tox/py27/local/lib/python2.7/site-packages/mock/mock.py", line 1062, in __call__
          return _mock_self._mock_call(*args, **kwargs)
        File "/home/auggy/nova/.tox/py27/local/lib/python2.7/site-packages/mock/mock.py", line 1128, in _mock_call
          ret_val = effect(*args, **kwargs)
        File "nova/tests/unit/virt/libvirt/test_driver.py", line 16368, in fake_create_domain
          post_xml_callback()
        File "nova/virt/libvirt/driver.py", line 3130, in _create_configdrive
          cdb.make_drive(config_drive_local_path)
        File "nova/virt/configdrive.py", line 143, in make_drive
          self._make_iso9660(path, tmpdir)
        File "nova/virt/configdrive.py", line 97, in _make_iso9660
          run_as_root=False)
        File "nova/utils.py", line 296, in execute
          return processutils.execute(*cmd, **kwargs)
        File "/home/auggy/nova/.tox/py27/local/lib/python2.7/site-packages/oslo_concurrency/processutils.py", line 363, in execute
          env=env_variables)
        File "/home/auggy/nova/.tox/py27/local/lib/python2.7/site-packages/eventlet/green/subprocess.py", line 54, in __init__
          subprocess_orig.Popen.__init__(self, args, 0, *argss, **kwds)
        File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
          errread, errwrite)
        File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
          raise child_exception
      OSError: [Errno 2] No such file or directory

  
  When I installed genisoimage, the test passed.

  genisoimage is the default value for mkisofs_cmd (configurable). It's
  called in the _make_iso9660 method for creating an image. Besides the
  issue of shelling out to a process going beyond the scope of what a
  unit test should cover, this also creates a hard dependency on
  genisoimage.

  Other areas in the code mock the call to genisoimage. This test should do something similar.
  https://github.com/openstack/nova/blob/master/nova/tests/unit/test_configdrive2.py#L49

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1630420/+subscriptions


References