unit tests failed with Mac OSX

Bug #1188972 reported by Haomai Wang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Haomai Wang

Bug Description

Because of `dd` usage is different from Linux.
*BSD systems `dd` command use b, k, m, g, or w for "bs" option.
Linux `dd` command use c =1, w =2, b =512, kB =1000, K =1024, MB =1000*1000, M =1024*1024, xM =M GB =1000*1000*1000, G =1024*1024*1024, and so on for T, P, E, Z, Y for "bs" option.

I think it may necessary to choose the common sign for tests.

OS: Mac osx

./run_tests.sh

======================================================================
ERROR: cinder.tests.test_scality.ScalityDriverTestCase.test_create_snapshot
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:''

Traceback (most recent call last):
  File "/Users/wanghaomai/github/cinder/cinder/tests/test_scality.py", line 167, in test_create_snapshot
    self._driver.create_snapshot(self.TEST_SNAPSHOT)
  File "/Users/wanghaomai/github/cinder/cinder/volume/drivers/scality.py", line 168, in create_snapshot
    self._copy_file(volume_path, snapshot_path)
  File "/Users/wanghaomai/github/cinder/cinder/volume/drivers/scality.py", line 117, in _copy_file
    run_as_root=True)
  File "/Users/wanghaomai/github/cinder/cinder/tests/test_scality.py", line 89, in _execute_wrapper
    utils.execute(cmd, *args, **kwargs)
  File "/Users/wanghaomai/github/cinder/cinder/utils.py", line 193, in execute
    cmd=' '.join(cmd))
ProcessExecutionError: Unexpected error while running command.
Command: dd if=/tmp/fake_mount/volumes/volume_name of=/tmp/fake_mount/volumes/snapshot_name bs=1M conv=fsync,nocreat,notrunc
Exit code: 1
Stdout: ''
Stderr: 'dd: bs: illegal numeric value\n'

======================================================================
ERROR: cinder.tests.test_scality.ScalityDriverTestCase.test_delete_snapshot
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:''

Traceback (most recent call last):
  File "/Users/wanghaomai/github/cinder/cinder/tests/test_scality.py", line 175, in test_delete_snapshot
    self._driver.create_snapshot(self.TEST_SNAPSHOT)
  File "/Users/wanghaomai/github/cinder/cinder/volume/drivers/scality.py", line 168, in create_snapshot
    self._copy_file(volume_path, snapshot_path)
  File "/Users/wanghaomai/github/cinder/cinder/volume/drivers/scality.py", line 117, in _copy_file
    run_as_root=True)
  File "/Users/wanghaomai/github/cinder/cinder/tests/test_scality.py", line 89, in _execute_wrapper
    utils.execute(cmd, *args, **kwargs)
  File "/Users/wanghaomai/github/cinder/cinder/utils.py", line 193, in execute
    cmd=' '.join(cmd))
ProcessExecutionError: Unexpected error while running command.
Command: dd if=/tmp/fake_mount/volumes/volume_name of=/tmp/fake_mount/volumes/snapshot_name bs=1M conv=fsync,nocreat,notrunc
Exit code: 1
Stdout: ''
Stderr: 'dd: bs: illegal numeric value\n'

Haomai Wang (haomai)
Changed in cinder:
assignee: nobody → Haomai Wang (haomai)
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/32538

Changed in cinder:
status: New → In Progress
Revision history for this message
John Griffith (john-griffith) wrote :

dd shouldn't actually be called in the unit tests to begin with. I think the correct fix is to stub these calls out, I'm bummed that there's a couple of these that slipped through.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/32538
Committed: http://github.com/openstack/cinder/commit/2ee2a19eb542c08ccd99766e1a6ccee87f427592
Submitter: Jenkins
Branch: master

commit 2ee2a19eb542c08ccd99766e1a6ccee87f427592
Author: Haomai Wang <email address hidden>
Date: Tue Jun 11 16:36:42 2013 +0800

    Fix some unittest cases failed on osx

    dd shouldn't actually be called in the unit tests to begin with. Stub these
    improper calls out.

    Fixes bug: 1188972

    Change-Id: I2966382a66eebbf49ce74e091e444a91ab274869

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → havana-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: havana-2 → 2013.2
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.