]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/ceph-volume/ceph_volume/tests/test_main.py
update sources to v12.2.3
[ceph.git] / ceph / src / ceph-volume / ceph_volume / tests / test_main.py
index c61729464a11351c1cf0c3bea5f128fad0bf3032..db1a49909326a06d191fa2e11ada6e39b1f37526 100644 (file)
@@ -28,3 +28,12 @@ class TestVolume(object):
         stdout, stderr = capsys.readouterr()
         assert '--cluster' in stdout
         assert '--log-path' in stdout
+
+    def test_log_ignoring_missing_ceph_conf(self, caplog):
+        with pytest.raises(SystemExit) as error:
+            main.Volume(argv=['ceph-volume', '--cluster', 'barnacle', 'lvm', '--help'])
+        # make sure we aren't causing an actual error
+        assert error.value.code == 0
+        log = caplog.records[0]
+        assert log.message == 'ignoring inability to load ceph.conf'
+        assert log.levelname == 'ERROR'