ceph_volume: fix unit tests

Fix the container_binary to use by mocking the CEPH_CONTAINER_BINARY env
variable.

Signed-off-by: Sébastien Han <seb@redhat.com>
pull/3375/head
Sébastien Han 2018-11-27 18:38:37 +01:00 committed by Guillaume Abrioux
parent 3d0670b41c
commit a42ba03d71
2 changed files with 4 additions and 1 deletions

View File

@ -273,7 +273,7 @@ def batch(module, container_image):
journal_size = module.params.get('journal_size', None)
block_db_size = module.params.get('block_db_size', None)
dmcrypt = module.params.get('dmcrypt', None)
osds_per_device = module.params.get('osds_per_device', None)
osds_per_device = module.params.get('osds_per_device', 1)
if not osds_per_device:
fatal('osds_per_device must be provided if action is "batch"', module)

View File

@ -1,7 +1,10 @@
from . import ceph_volume
from ansible.compat.tests.mock import MagicMock
import mock
import os
@mock.patch.dict(os.environ, {'CEPH_CONTAINER_BINARY': 'docker'})
class TestCephVolumeModule(object):
def test_data_no_vg(self):