Skip to content

Commit

Permalink
ceph-volume tests check success message when zapping
Browse files Browse the repository at this point in the history
Signed-off-by: Alfredo Deza <adeza@redhat.com>
  • Loading branch information
Alfredo Deza committed Aug 20, 2019
1 parent aca9cf2 commit 88c7429
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/ceph-volume/ceph_volume/tests/devices/lvm/test_zap.py
Expand Up @@ -91,6 +91,22 @@ def test_block_is_found(self, volumes):
result = zap.ensure_associated_lvs(volumes)
assert result == ['/dev/VolGroup/block']

def test_success_message_for_fsid(self, factory, is_root, capsys):
cli_zap = zap.Zap([])
args = factory(devices=[], osd_id=None, osd_fsid='asdf-lkjh')
cli_zap.args = args
cli_zap.zap()
out, err = capsys.readouterr()
assert "Zapping successful for OSD: asdf-lkjh" in err

def test_success_message_for_id(self, factory, is_root, capsys):
cli_zap = zap.Zap([])
args = factory(devices=[], osd_id='1', osd_fsid=None)
cli_zap.args = args
cli_zap.zap()
out, err = capsys.readouterr()
assert "Zapping successful for OSD: 1" in err

def test_block_and_partition_are_found(self, volumes, monkeypatch):
monkeypatch.setattr(zap.disk, 'get_device_from_partuuid', lambda x: '/dev/sdb1')
tags = 'ceph.osd_id=0,ceph.osd_fsid=asdf-lkjh,ceph.journal_uuid=x,ceph.type=block'
Expand Down

0 comments on commit 88c7429

Please sign in to comment.