From e2ebf70fada73a54dffdadb1da78c265e24dccc4 Mon Sep 17 00:00:00 2001 From: Michael Fritch Date: Thu, 27 May 2021 07:49:01 -0600 Subject: [PATCH] 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) --- src/cephadm/tests/test_cephadm.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/cephadm/tests/test_cephadm.py b/src/cephadm/tests/test_cephadm.py index cc69e9eae45d..52f19544b618 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: -- 2.47.3