Skip to content

Commit

Permalink
ceph-volume: fix and clean up unit tests
Browse files Browse the repository at this point in the history
- update unit test devices/raw/test_list.py:
  e5e4296 missed the corresponding unit test update.
  This commit updates it.

- fix unit tests when run as non-root user:
  When unit tests are run as non-root user, it fails for many reasons
  such as 'permission denied' etc...
  This commit addresses that by adding missing fixture `is_root`
  and using pyfakefs when it's needed.

- drop test_writer_uses_log_on_unicodeerror test:
  This test is broken for a while. Since we don't make test against py2,
  let's drop it.

- test_arg_validators cleanup:
  This makes use of `self.validator` defined in `setup_method()`
  rather than redefining a new object in each tests.
  Also, this migrates test_files_are_missing to pyfakefs

- test_migrate cleanup:
  This makes use of `is_root` fixture insead of using mock.patch
  on `os.getuid`

- test_activate cleanup:
    - removes the fixture monkeypatch from test_no_data_uuid() given
      that it's not used in this test.
    - remove the fixture is_root from test_activate_all()

- simple.TestActivate.test_no_data_uuid fix:
  This fixes the following issue:

  ```
  ________________________ TestActivate.test_no_data_uuid ________________________

  self = <test_activate.TestActivate object at 0x7f6b1885f1c0>
  factory = <class 'ceph_volume.tests.conftest.Factory'>, is_root = None
  capture = <ceph_volume.tests.conftest.Capture object at 0x7f6b17f59340>
  fake_filesystem = <pyfakefs.fake_filesystem.FakeFilesystem object at 0x7f6b17125190>

      def test_no_data_uuid(self, factory, is_root, capture, fake_filesystem):
          fake_filesystem.create_file('/tmp/json-config', contents='{}')
          args = factory(osd_id='0', osd_fsid='1234', json_config='/tmp/json-config')
          with pytest.raises(RuntimeError):
  >           activate.Activate([]).activate(args)

  /home/jenkins-build/build/workspace/ceph-volume-pr/src/ceph-volume/ceph_volume/tests/devices/simple/test_activate.py:12:
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

  a = (<ceph_volume.devices.simple.activate.Activate object at 0x7f6b16fcd8b0>, <ceph_volume.tests.conftest.Factory object at 0x7f6b16fcd160>)
  kw = {}

      @wraps(func)
      def is_root(*a, **kw):
          if not os.getuid() == 0 and not os.environ.get('CEPH_VOLUME_SKIP_NEEDS_ROOT', False):
  >           raise exceptions.SuperUserError()
  E           ceph_volume.exceptions.SuperUserError: This command needs to be executed with sudo or as root

  /home/jenkins-build/build/workspace/ceph-volume-pr/src/ceph-volume/ceph_volume/decorators.py:15: SuperUserError
  ```

  Even though we use the fixture `is_root`, it doesn't seem to work.
  Using @patch() instead fixes this issue.

- address 'PytestRemovedIn8Warning' messages:
  pretty self-explanatory:
  ```
  PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  ```

  ```
  To remove this warning, rename it to `setup_method(self)`
  ```

  so this commit renames some `def setup(self)` to `def setup_method(self)` as suggested.

- add missing unit tests:
  This adds some unit test updates missed by commits
  0985e20 and bd5e1a8

Signed-off-by: Guillaume Abrioux <[email protected]>
  • Loading branch information
guits committed Mar 28, 2024
1 parent f06dad9 commit d401ef2
Show file tree
Hide file tree
Showing 16 changed files with 150 additions and 113 deletions.
9 changes: 9 additions & 0 deletions src/ceph-volume/ceph_volume/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,13 @@ def is_root(monkeypatch):
"""
monkeypatch.setattr('os.getuid', lambda: 0)

@pytest.fixture
def is_non_root(monkeypatch):
"""
Patch ``os.getuid()`` so that ceph-volume's decorators that ensure a user
is not root.
"""
monkeypatch.setattr('os.getuid', lambda: 100)

@pytest.fixture
def tmpfile(tmpdir):
Expand Down Expand Up @@ -380,6 +387,8 @@ def fake_filesystem(fs):
fs.create_dir('/sys/block/sda/slaves')
fs.create_dir('/sys/block/sda/queue')
fs.create_dir('/sys/block/rbd0')
fs.create_dir('/var/log/ceph')
fs.create_dir('/tmp/osdpath')
yield fs

@pytest.fixture
Expand Down
10 changes: 5 additions & 5 deletions src/ceph-volume/ceph_volume/tests/devices/lvm/test_activate.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_no_osd_id_no_osd_fsid(self, m_create_key, is_root):
a.objectstore.activate()
assert result.value.args[0] == 'Please provide both osd_id and osd_fsid'

def test_bluestore_no_systemd(self, is_root, monkeypatch, capture):
def test_bluestore_no_systemd(self, m_create_key, is_root, monkeypatch, capture):
monkeypatch.setattr('ceph_volume.configuration.load', lambda: None)
fake_enable = Capture()
fake_start_osd = Capture()
Expand All @@ -88,7 +88,7 @@ def test_bluestore_no_systemd(self, is_root, monkeypatch, capture):
assert fake_enable.calls == []
assert fake_start_osd.calls == []

def test_bluestore_systemd(self, is_root, monkeypatch, capture):
def test_bluestore_systemd(self, m_create_key, is_root, monkeypatch, capture):
monkeypatch.setattr('ceph_volume.configuration.load', lambda: None)
fake_enable = Capture()
fake_start_osd = Capture()
Expand All @@ -114,7 +114,7 @@ def test_bluestore_systemd(self, is_root, monkeypatch, capture):
assert fake_enable.calls != []
assert fake_start_osd.calls != []

def test_bluestore_no_systemd_autodetect(self, is_root, monkeypatch, capture):
def test_bluestore_no_systemd_autodetect(self, m_create_key, is_root, monkeypatch, capture):
monkeypatch.setattr('ceph_volume.configuration.load', lambda: None)
fake_enable = Capture()
fake_start_osd = Capture()
Expand All @@ -140,7 +140,7 @@ def test_bluestore_no_systemd_autodetect(self, is_root, monkeypatch, capture):
assert fake_enable.calls == []
assert fake_start_osd.calls == []

def test_bluestore_systemd_autodetect(self, is_root, monkeypatch, capture):
def test_bluestore_systemd_autodetect(self, m_create_key, is_root, monkeypatch, capture):
monkeypatch.setattr('ceph_volume.configuration.load', lambda: None)
fake_enable = Capture()
fake_start_osd = Capture()
Expand Down Expand Up @@ -242,7 +242,7 @@ def test_detects_osds_to_activate_systemd(self, m_activate, m_create_key, is_roo
m_activate.assert_has_calls(calls)

@patch('ceph_volume.objectstore.lvmbluestore.LvmBlueStore.activate')
def test_detects_osds_to_activate_no_systemd(self, m_activate, is_root, monkeypatch):
def test_detects_osds_to_activate_no_systemd(self, m_activate, m_create_key, is_root, monkeypatch):
monkeypatch.setattr('ceph_volume.objectstore.lvmbluestore.direct_report', lambda: direct_report)
args = ['--all', '--no-systemd', '--bluestore']
a = activate.Activate(args)
Expand Down
52 changes: 11 additions & 41 deletions src/ceph-volume/ceph_volume/tests/devices/lvm/test_migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,7 @@ def mock_get_lvs(self, *args, **kwargs):
def mock_prepare_dmcrypt(self, *args, **kwargs):
return '/dev/mapper/' + kwargs['mapping']

@patch('os.getuid', return_value=1)
def test_newdb_non_root(self, m_getuid):
def test_newdb_non_root(self, is_non_root):
with pytest.raises(Exception) as error:
migrate.NewDB(argv=[
'--osd-id', '1',
Expand All @@ -534,9 +533,7 @@ def test_newdb_non_root(self, m_getuid):
expected = 'This command needs to be executed with sudo or as root'
assert expected in str(error.value)

@patch('os.getuid')
def test_newdb_not_target_lvm(self, m_getuid, capsys):
m_getuid.return_value = 0
def test_newdb_not_target_lvm(self, is_root, capsys):
with pytest.raises(SystemExit) as error:
migrate.NewDB(argv=[
'--osd-id', '1',
Expand All @@ -549,10 +546,7 @@ def test_newdb_not_target_lvm(self, m_getuid, capsys):
assert expected in stderr


@patch('os.getuid')
def test_newdb_already_in_use(self, m_getuid, monkeypatch, capsys):
m_getuid.return_value = 0

def test_newdb_already_in_use(self, is_root, monkeypatch, capsys):
self.mock_volume = api.Volume(lv_name='volume1',
lv_uuid='y',
vg_name='vg',
Expand All @@ -571,10 +565,7 @@ def test_newdb_already_in_use(self, m_getuid, monkeypatch, capsys):
expected = 'Target Logical Volume is already used by ceph: vgname/new_db'
assert expected in stderr

@patch('os.getuid')
def test_newdb(self, m_getuid, monkeypatch, capsys):
m_getuid.return_value = 0

def test_newdb(self, is_root, monkeypatch, capsys):
source_tags = \
'ceph.osd_id=0,ceph.type=data,ceph.osd_fsid=1234,'\
'ceph.wal_uuid=wal_uuid,ceph.db_device=/dbdevice'
Expand Down Expand Up @@ -819,10 +810,7 @@ def test_newdb_no_systemd(self, is_root, monkeypatch):
'--dev-target', '/dev/VolGroup/target_volume',
'--command', 'bluefs-bdev-new-db']

@patch('os.getuid')
def test_newwal(self, m_getuid, monkeypatch, capsys):
m_getuid.return_value = 0

def test_newwal(self, is_root, monkeypatch, capsys):
source_tags = \
'ceph.osd_id=0,ceph.type=data,ceph.osd_fsid=1234'

Expand Down Expand Up @@ -1226,9 +1214,7 @@ def test_migrate_without_args(self, capsys):
assert not stderr


@patch('os.getuid')
def test_migrate_data_db_to_new_db(self, m_getuid, monkeypatch):
m_getuid.return_value = 0
def test_migrate_data_db_to_new_db(self, is_root, monkeypatch):

source_tags = 'ceph.osd_id=2,ceph.type=data,ceph.osd_fsid=1234,' \
'ceph.cluster_name=ceph,ceph.db_uuid=dbuuid,ceph.db_device=db_dev'
Expand Down Expand Up @@ -1600,10 +1586,7 @@ def test_migrate_data_db_to_new_db_no_systemd(self, is_root, monkeypatch):
'--devs-source', '/var/lib/ceph/osd/ceph-2/block',
'--devs-source', '/var/lib/ceph/osd/ceph-2/block.db']

@patch('os.getuid')
def test_migrate_data_db_to_new_db_skip_wal(self, m_getuid, monkeypatch):
m_getuid.return_value = 0

def test_migrate_data_db_to_new_db_skip_wal(self, is_root, monkeypatch):
source_tags = 'ceph.osd_id=2,ceph.type=data,ceph.osd_fsid=1234,' \
'ceph.cluster_name=ceph,ceph.db_uuid=dbuuid,ceph.db_device=db_dev'
source_db_tags = 'ceph.osd_id=2,ceph.type=db,ceph.osd_fsid=1234,' \
Expand Down Expand Up @@ -1722,10 +1705,7 @@ def test_migrate_data_db_to_new_db_skip_wal(self, m_getuid, monkeypatch):
'--devs-source', '/var/lib/ceph/osd/ceph-2/block',
'--devs-source', '/var/lib/ceph/osd/ceph-2/block.db']

@patch('os.getuid')
def test_migrate_data_db_wal_to_new_db(self, m_getuid, monkeypatch):
m_getuid.return_value = 0

def test_migrate_data_db_wal_to_new_db(self, is_root, monkeypatch):
source_tags = 'ceph.osd_id=2,ceph.type=data,ceph.osd_fsid=1234,' \
'ceph.cluster_name=ceph,ceph.db_uuid=dbuuid,ceph.db_device=db_dev,' \
'ceph.wal_uuid=waluuid,ceph.wal_device=wal_dev'
Expand Down Expand Up @@ -1996,7 +1976,6 @@ def test_dont_migrate_data_db_wal_to_new_data(self,
monkeypatch,
capsys):
m_getuid.return_value = 0

source_tags = 'ceph.osd_id=2,ceph.type=data,ceph.osd_fsid=1234,' \
'ceph.cluster_name=ceph,ceph.db_uuid=dbuuid,ceph.db_device=db_dev'
source_db_tags = 'ceph.osd_id=2,ceph.type=db,ceph.osd_fsid=1234,' \
Expand Down Expand Up @@ -2058,13 +2037,10 @@ def test_dont_migrate_data_db_wal_to_new_data(self,
' please use new-db or new-wal command before.'
assert expected in stderr

@patch('os.getuid')
def test_dont_migrate_db_to_wal(self,
m_getuid,
is_root,
monkeypatch,
capsys):
m_getuid.return_value = 0

source_tags = 'ceph.osd_id=2,ceph.type=data,ceph.osd_fsid=1234,' \
'ceph.cluster_name=ceph,ceph.db_uuid=dbuuid,ceph.db_device=db_dev,' \
'ceph.wal_uuid=waluuid,ceph.wal_device=wal_dev'
Expand Down Expand Up @@ -2134,13 +2110,10 @@ def test_dont_migrate_db_to_wal(self,
expected = 'Migrate to WAL is not supported'
assert expected in stderr

@patch('os.getuid')
def test_migrate_data_db_to_db(self,
m_getuid,
is_root,
monkeypatch,
capsys):
m_getuid.return_value = 0

source_tags = 'ceph.osd_id=2,ceph.type=data,ceph.osd_fsid=1234,' \
'ceph.cluster_name=ceph,ceph.db_uuid=dbuuid,ceph.db_device=db_dev,' \
'ceph.wal_uuid=waluuid,ceph.wal_device=wal_dev'
Expand Down Expand Up @@ -2361,13 +2334,10 @@ def test_migrate_data_db_to_db_no_systemd(self, is_root, monkeypatch):
'--command', 'bluefs-bdev-migrate',
'--devs-source', '/var/lib/ceph/osd/ceph-2/block']

@patch('os.getuid')
def test_migrate_data_wal_to_db(self,
m_getuid,
is_root,
monkeypatch,
capsys):
m_getuid.return_value = 0

source_tags = 'ceph.osd_id=2,ceph.type=data,ceph.osd_fsid=1234,' \
'ceph.cluster_name=ceph,ceph.db_uuid=dbuuid,ceph.db_device=db_dev,' \
'ceph.wal_uuid=waluuid,ceph.wal_device=wal_dev'
Expand Down
4 changes: 2 additions & 2 deletions src/ceph-volume/ceph_volume/tests/devices/lvm/test_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_cannot_use_device(self, m_create_key, factory):

@patch('ceph_volume.util.prepare.create_key', return_value='fake-secret')
class TestGetClusterFsid(object):
def setup(self):
def setup_method(self):
self.p = lvm.prepare.Prepare([])

def test_fsid_is_passed_in(self, m_create_key, factory):
Expand All @@ -57,7 +57,7 @@ def test_fsid_is_read_from_ceph_conf(self, m_create_key, factory, conf_ceph_stub
@patch('ceph_volume.util.prepare.create_key', return_value='fake-secret')
class TestPrepare(object):

def setup(self):
def setup_method(self):
self.p = lvm.prepare.Prepare([])

def test_main_spits_help_with_no_arguments(self, m_create_key, capsys):
Expand Down
66 changes: 53 additions & 13 deletions src/ceph-volume/ceph_volume/tests/devices/raw/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,27 @@ def _devices_side_effect():
"/dev/sdb3": {},
"/dev/sdc": {},
"/dev/sdd": {},
"/dev/sde": {},
"/dev/sde1": {},
"/dev/mapper/ceph--osd--block--1": {},
"/dev/mapper/ceph--osd--block--2": {},
}

def _lsblk_all_devices(abspath=True):
return [
{"NAME": "/dev/sda", "KNAME": "/dev/sda", "PKNAME": ""},
{"NAME": "/dev/sda1", "KNAME": "/dev/sda1", "PKNAME": "/dev/sda"},
{"NAME": "/dev/sda2", "KNAME": "/dev/sda2", "PKNAME": "/dev/sda"},
{"NAME": "/dev/sda3", "KNAME": "/dev/sda3", "PKNAME": "/dev/sda"},
{"NAME": "/dev/sdb", "KNAME": "/dev/sdb", "PKNAME": ""},
{"NAME": "/dev/sdb2", "KNAME": "/dev/sdb2", "PKNAME": "/dev/sdb"},
{"NAME": "/dev/sdb3", "KNAME": "/dev/sdb3", "PKNAME": "/dev/sdb"},
{"NAME": "/dev/sdc", "KNAME": "/dev/sdc", "PKNAME": ""},
{"NAME": "/dev/sdd", "KNAME": "/dev/sdd", "PKNAME": ""},
{"NAME": "/dev/mapper/ceph--osd--block--1", "KNAME": "/dev/mapper/ceph--osd--block--1", "PKNAME": "/dev/sdd"},
{"NAME": "/dev/mapper/ceph--osd--block--2", "KNAME": "/dev/mapper/ceph--osd--block--2", "PKNAME": "/dev/sdd"},
{"NAME": "/dev/sda", "KNAME": "/dev/sda", "PKNAME": "", "TYPE": "disk"},
{"NAME": "/dev/sda1", "KNAME": "/dev/sda1", "PKNAME": "/dev/sda", "TYPE": "part"},
{"NAME": "/dev/sda2", "KNAME": "/dev/sda2", "PKNAME": "/dev/sda", "TYPE": "part"},
{"NAME": "/dev/sda3", "KNAME": "/dev/sda3", "PKNAME": "/dev/sda", "TYPE": "part"},
{"NAME": "/dev/sdb", "KNAME": "/dev/sdb", "PKNAME": "", "TYPE": "disk"},
{"NAME": "/dev/sdb2", "KNAME": "/dev/sdb2", "PKNAME": "/dev/sdb", "TYPE": "part"},
{"NAME": "/dev/sdb3", "KNAME": "/dev/sdb3", "PKNAME": "/dev/sdb", "TYPE": "part"},
{"NAME": "/dev/sdc", "KNAME": "/dev/sdc", "PKNAME": "", "TYPE": "disk"},
{"NAME": "/dev/sdd", "KNAME": "/dev/sdd", "PKNAME": "", "TYPE": "disk"},
{"NAME": "/dev/sde", "KNAME": "/dev/sde", "PKNAME": "", "TYPE": "disk"},
{"NAME": "/dev/sde1", "KNAME": "/dev/sde1", "PKNAME": "/dev/sde", "TYPE": "part"},
{"NAME": "/dev/mapper/ceph--osd--block--1", "KNAME": "/dev/mapper/ceph--osd--block--1", "PKNAME": "/dev/sdd", "TYPE": "lvm"},
{"NAME": "/dev/mapper/ceph--osd--block--2", "KNAME": "/dev/mapper/ceph--osd--block--2", "PKNAME": "/dev/sdd", "TYPE": "lvm"},
]

# dummy lsblk output for device with optional parent output
Expand Down Expand Up @@ -116,6 +120,29 @@ def _bluestore_tool_label_output_sdb2():
}
}'''

def _bluestore_tool_label_output_sde1():
return '''{
"/dev/sde1": {
"osd_uuid": "sde1-uuid",
"size": 214747316224,
"btime": "2023-07-26T13:20:19.509457+0000",
"description": "main",
"bfm_blocks": "268435456",
"bfm_blocks_per_key": "128",
"bfm_bytes_per_block": "4096",
"bfm_size": "214747316224",
"bluefs": "1",
"ceph_fsid": "sde1-fsid",
"kv_backend": "rocksdb",
"magic": "ceph osd volume v026",
"mkfs_done": "yes",
"osd_key": "AQCSHcFkUeLIMBAAjKqANkXafjvVISkXt6FGCA==",
"ready": "ready",
"require_osd_release": "16",
"whoami": "1"
}
}'''

def _bluestore_tool_label_output_dm_okay():
return '''{
"/dev/mapper/ceph--osd--block--1": {
Expand Down Expand Up @@ -149,6 +176,8 @@ def _process_call_side_effect(command, **kw):
return _lsblk_output(dev, parent="/dev/sdb"), '', 0
if dev == "/dev/sda" or dev == "/dev/sdb" or dev == "/dev/sdc" or dev == "/dev/sdd":
return _lsblk_output(dev), '', 0
if dev == "/dev/sde1":
return _lsblk_output(dev, parent="/dev/sde"), '', 0
if "mapper" in dev:
return _lsblk_output(dev, parent="/dev/sdd"), '', 0
pytest.fail('dev {} needs behavior specified for it'.format(dev))
Expand All @@ -163,6 +192,8 @@ def _process_call_side_effect(command, **kw):
if "/dev/sdb2" in command:
# sdb2 is a phantom atari partition that appears to have some valid bluestore info
return _bluestore_tool_label_output_sdb2(), '', 0
if "/dev/sde1" in command:
return _bluestore_tool_label_output_sde1(), '', 0
if "/dev/mapper/ceph--osd--block--1" in command:
# dm device 1 is a valid bluestore OSD (the other is corrupted/invalid)
return _bluestore_tool_label_output_dm_okay(), '', 0
Expand All @@ -181,6 +212,10 @@ def _has_bluestore_label_side_effect(disk_path):
return False # empty disk
if disk_path == "/dev/sdd":
return False # has LVM subdevices
if disk_path == "/dev/sde":
return False # has partitions, it means it shouldn't be an OSD
if disk_path == "/dev/sde1":
return True # is a valid OSD
if disk_path == "/dev/mapper/ceph--osd--block--1":
return True # good OSD
if disk_path == "/dev/mapper/ceph--osd--block--2":
Expand Down Expand Up @@ -209,13 +244,18 @@ def test_raw_list(self, patched_disk_lsblk, patched_call, patched_bluestore_labe
assert sdb['device'] == '/dev/sdb'
assert sdb['ceph_fsid'] == 'sdb-fsid'
assert sdb['type'] == 'bluestore'

lvm1 = result['lvm-1-uuid']
assert lvm1['osd_uuid'] == 'lvm-1-uuid'
assert lvm1['osd_id'] == 2
assert lvm1['device'] == '/dev/mapper/ceph--osd--block--1'
assert lvm1['ceph_fsid'] == 'lvm-1-fsid'
assert lvm1['type'] == 'bluestore'
sde1 = result['sde1-uuid']
assert sde1['osd_uuid'] == 'sde1-uuid'
assert sde1['osd_id'] == 1
assert sde1['device'] == '/dev/sde1'
assert sde1['ceph_fsid'] == 'sde1-fsid'
assert sde1['type'] == 'bluestore'

@patch('ceph_volume.util.device.disk.get_devices')
@patch('ceph_volume.util.disk.has_bluestore_label')
Expand All @@ -234,5 +274,5 @@ def _has_bluestore_label_side_effect_with_OSError(device_path):
patched_get_devices.side_effect = _devices_side_effect

result = raw.list.List([]).generate()
assert len(result) == 3
assert len(result) == 2
assert 'sdb-uuid' in result
9 changes: 7 additions & 2 deletions src/ceph-volume/ceph_volume/tests/devices/raw/test_prepare.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest
from ceph_volume.devices import raw
from mock.mock import patch
from mock.mock import patch, MagicMock
from ceph_volume import objectstore

class TestRaw(object):
Expand Down Expand Up @@ -47,8 +47,13 @@ def test_main_shows_full_help(self, m_create_key, capsys):
assert 'Path to bluestore block.wal block device' in stdout
assert 'Enable device encryption via dm-crypt' in stdout

@patch('ceph_volume.util.arg_validators.set_dmcrypt_no_workqueue', return_value=MagicMock())
@patch('ceph_volume.util.arg_validators.ValidRawDevice.__call__')
def test_prepare_dmcrypt_no_secret_passed(self, m_valid_device, m_create_key, capsys):
def test_prepare_dmcrypt_no_secret_passed(self,
m_valid_device,
m_set_dmcrypt_no_workqueue,
m_create_key,
capsys):
m_valid_device.return_value = '/dev/foo'
with pytest.raises(SystemExit):
raw.prepare.Prepare(argv=['--bluestore', '--data', '/dev/foo', '--dmcrypt']).main()
Expand Down
Loading

0 comments on commit d401ef2

Please sign in to comment.