From: Alfredo Deza Date: Mon, 19 Feb 2018 21:31:29 +0000 (-0500) Subject: ceph-volume tests add exclusion checks in prepare X-Git-Tag: v13.0.2~210^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=43be2aafc187892a1ff61039dabea9efe0c9b1b3;p=ceph.git ceph-volume tests add exclusion checks in prepare Signed-off-by: Alfredo Deza --- diff --git a/src/ceph-volume/ceph_volume/tests/devices/lvm/test_prepare.py b/src/ceph-volume/ceph_volume/tests/devices/lvm/test_prepare.py index d46d33ac8f65d..bc2486cf6944f 100644 --- a/src/ceph-volume/ceph_volume/tests/devices/lvm/test_prepare.py +++ b/src/ceph-volume/ceph_volume/tests/devices/lvm/test_prepare.py @@ -31,6 +31,7 @@ class TestPrepareDevice(object): assert 'Cannot use device (/dev/var/foo)' in str(error) assert 'A vg/lv path or an existing device is needed' in str(error) + class TestPrepare(object): def test_main_spits_help_with_no_arguments(self, capsys): @@ -46,6 +47,33 @@ class TestPrepare(object): assert 'Use the bluestore objectstore' in stdout assert 'A physical device or logical' in stdout + def test_excludes_filestore_bluestore_flags(self, capsys): + with pytest.raises(SystemExit): + lvm.prepare.Prepare(argv=['--data', '/dev/sdfoo', '--filestore', '--bluestore']).main() + stdout, stderr = capsys.readouterr() + expected = 'Cannot use --filestore (filestore) with --bluestore (bluestore)' + assert expected in stdout + + def test_excludes_other_filestore_bluestore_flags(self, capsys): + with pytest.raises(SystemExit): + lvm.prepare.Prepare(argv=[ + '--bluestore', '--data', '/dev/sdfoo', + '--journal', '/dev/sf14', + ]).main() + stdout, stderr = capsys.readouterr() + expected = 'Cannot use --bluestore (bluestore) with --journal (filestore)' + assert expected in stdout + + def test_excludes_block_and_journal_flags(self, capsys): + with pytest.raises(SystemExit): + lvm.prepare.Prepare(argv=[ + '--bluestore', '--data', '/dev/sdfoo', '--block.db', 'vg/ceph1', + '--journal', '/dev/sf14', + ]).main() + stdout, stderr = capsys.readouterr() + expected = 'Cannot use --block.db (bluestore) with --journal (filestore)' + assert expected in stdout + class TestGetJournalLV(object): @@ -75,4 +103,3 @@ class TestActivate(object): stdout, stderr = capsys.readouterr() assert 'optional arguments' in stdout assert 'positional arguments' in stdout -