]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume test logging ignored ceph.conf file
authorAlfredo Deza <adeza@redhat.com>
Tue, 5 Dec 2017 18:59:22 +0000 (13:59 -0500)
committerAlfredo Deza <adeza@redhat.com>
Thu, 7 Dec 2017 20:03:52 +0000 (15:03 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
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'