]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: add `--config` test
authorMichael Fritch <mfritch@suse.com>
Thu, 27 May 2021 13:49:01 +0000 (07:49 -0600)
committerSebastian Wagner <sewagner@redhat.com>
Fri, 11 Jun 2021 09:51:08 +0000 (11:51 +0200)
follow-up test for:
https://github.com/ceph/ceph/pull/41351

Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit 9bfdf31166ceadb3f9452a5f84116162eb252c55)

src/cephadm/tests/test_cephadm.py

index cc69e9eae45d6a96b52ff13ecd9079c0ea58a18f..52f19544b6185afcc691cc52999d3242823c077c 100644 (file)
@@ -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: