]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: add unit test coverage for deploying tracing
authorJohn Mulligan <jmulligan@redhat.com>
Tue, 3 Oct 2023 18:17:02 +0000 (14:17 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 5 Oct 2023 21:05:33 +0000 (17:05 -0400)
Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/tests/test_deploy.py

index fad142ebbabbe7c34846c8b28863c88063a29ac1..e6b4da8127fcf57769cd49219eea65805d9f225a 100644 (file)
@@ -300,3 +300,33 @@ def test_deploy_a_monitoring_container(cephadm_fs, monkeypatch):
         assert f.read() == 'bettercallherc'
         si = os.fstat(f.fileno())
         assert (si.st_uid, si.st_gid) == (8765, 8765)
+
+
+def test_deploy_a_tracing_container(cephadm_fs, monkeypatch):
+    mocks = _common_mp(monkeypatch)
+    _firewalld = mocks['Firewalld']
+    fsid = 'b01dbeef-701d-9abe-0000-e1e5a47004a7'
+    with with_cephadm_ctx([]) as ctx:
+        ctx.container_engine = mock_podman()
+        ctx.fsid = fsid
+        ctx.name = 'elasticsearch.band'
+        ctx.image = 'quay.io/rubber/elasticsearch:latest'
+        ctx.reconfig = False
+        ctx.config_blobs = {
+            'config': 'XXXXXXX',
+            'keyring': 'YYYYYY',
+            'files': {
+                'prometheus.yml': 'bettercallherc',
+            },
+        }
+        _cephadm._common_deploy(ctx)
+
+    basedir = pathlib.Path(f'/var/lib/ceph/{fsid}/elasticsearch.band')
+    assert basedir.is_dir()
+    with open(basedir / 'unit.run') as f:
+        runfile_lines = f.read().splitlines()
+    assert 'podman' in runfile_lines[-1]
+    assert runfile_lines[-1].endswith('quay.io/rubber/elasticsearch:latest')
+    _firewalld().open_ports.assert_not_called()
+    assert not (basedir / 'config').exists()
+    assert not (basedir / 'keyring').exists()