From: Michael Fritch Date: Thu, 27 May 2021 13:49:01 +0000 (-0600) Subject: cephadm: add `--config` test X-Git-Tag: v16.2.5~72^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e2ebf70fada73a54dffdadb1da78c265e24dccc4;p=ceph.git cephadm: add `--config` test follow-up test for: https://github.com/ceph/ceph/pull/41351 Signed-off-by: Michael Fritch (cherry picked from commit 9bfdf31166ceadb3f9452a5f84116162eb252c55) --- diff --git a/src/cephadm/tests/test_cephadm.py b/src/cephadm/tests/test_cephadm.py index cc69e9eae45..52f19544b61 100644 --- a/src/cephadm/tests/test_cephadm.py +++ b/src/cephadm/tests/test_cephadm.py @@ -1016,6 +1016,24 @@ class TestBootstrap(TestCephAdm): *args, ] + def test_config(self, cephadm_fs): + conf_file = 'foo' + cmd = self._get_cmd( + '--mon-ip', '192.168.1.1', + '--skip-mon-network', + '--config', conf_file, + ) + + with with_cephadm_ctx(cmd) as ctx: + msg = r'No such file or directory' + with pytest.raises(cd.Error, match=msg): + cd.command_bootstrap(ctx) + + cephadm_fs.create_file(conf_file) + with with_cephadm_ctx(cmd) as ctx: + retval = cd.command_bootstrap(ctx) + assert retval == 0 + def test_no_mon_addr(self, cephadm_fs): cmd = self._get_cmd() with with_cephadm_ctx(cmd) as ctx: