From: Alfredo Deza Date: Tue, 5 Dec 2017 18:59:22 +0000 (-0500) Subject: ceph-volume test logging ignored ceph.conf file X-Git-Tag: v13.0.1~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c0dd4a8314a24cb0e8d751e5962359573c7b1252;p=ceph.git ceph-volume test logging ignored ceph.conf file Signed-off-by: Alfredo Deza --- diff --git a/src/ceph-volume/ceph_volume/tests/test_main.py b/src/ceph-volume/ceph_volume/tests/test_main.py index c61729464a11..db1a49909326 100644 --- a/src/ceph-volume/ceph_volume/tests/test_main.py +++ b/src/ceph-volume/ceph_volume/tests/test_main.py @@ -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'