]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/ceph-volume/ceph_volume/tests/devices/lvm/test_prepare.py
update sources to v12.2.4
[ceph.git] / ceph / src / ceph-volume / ceph_volume / tests / devices / lvm / test_prepare.py
index d46d33ac8f65d0eadf20121f7ad013077ea87590..bc2486cf6944fbd795383b3ecd18b1b100da5358 100644 (file)
@@ -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
-