]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: assert that ceph specific env vars get set
authorJohn Mulligan <jmulligan@redhat.com>
Sat, 21 Oct 2023 19:53:34 +0000 (15:53 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Sun, 22 Oct 2023 12:15:15 +0000 (08:15 -0400)
Assert that ceph based services set a tcmalloc related env var.
Also assert that a few assorted services do not set the env var.

Part of a series of commits to increase coverage of deployment
path features with regards to container engine options, env vars
and mounts. This will serve future refactoring efforts.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/tests/test_deploy.py

index 1f4eddf3a70d6d6e42d4e1ed50594153a9e18654..5a8950f3171a45cd6da9414717779024972704fd 100644 (file)
@@ -62,6 +62,7 @@ def test_deploy_nfs_container(cephadm_fs, monkeypatch):
         runfile_lines = f.read().splitlines()
     assert 'podman' in runfile_lines[-1]
     assert runfile_lines[-1].endswith('quay.io/ceph/ceph:latest -F -L STDERR')
+    assert '-e TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES' not in runfile_lines[-1]
     _firewalld().open_ports.assert_called_with([2049])
     with open(f'/var/lib/ceph/{fsid}/nfs.fun/config') as f:
         assert f.read() == 'BALONEY'
@@ -211,6 +212,7 @@ def test_deploy_iscsi_container(cephadm_fs, monkeypatch):
         runfile_lines = f.read().splitlines()
     assert 'podman' in runfile_lines[-1]
     assert runfile_lines[-1].endswith('quay.io/ayeaye/iscsi:latest')
+    assert '-e TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES' not in runfile_lines[-1]
     _firewalld().open_ports.assert_not_called()
     with open(basedir / 'config') as f:
         assert f.read() == 'XXXXXXX'
@@ -250,6 +252,7 @@ def test_deploy_nvmeof_container(cephadm_fs, monkeypatch):
         runfile_lines = f.read().splitlines()
     assert 'podman' in runfile_lines[-1]
     assert runfile_lines[-1].endswith('quay.io/ownf/nmve:latest')
+    assert '-e TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES' not in runfile_lines[-1]
     _firewalld().open_ports.assert_not_called()
     with open(basedir / 'config') as f:
         assert f.read() == 'XXXXXXX'
@@ -360,6 +363,7 @@ def test_deploy_ceph_mgr_container(cephadm_fs, monkeypatch):
     assert runfile_lines[-1].endswith(
         'quay.io/ceph/ceph:latest -n mgr.foo -f --setuser ceph --setgroup ceph --default-log-to-file=false --default-log-to-journald=true --default-log-to-stderr=false'
     )
+    assert '-e TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES' in runfile_lines[-1]
     _firewalld().open_ports.assert_not_called()
     with open(basedir / 'config') as f:
         assert f.read() == 'XXXXXXX'
@@ -408,6 +412,7 @@ def test_deploy_ceph_exporter_container(cephadm_fs, monkeypatch):
         'quay.io/ceph/ceph:latest -n client.ceph-exporter.zaq -f --sock-dir=/var/run/ceph/ --addrs=0.0.0.0 --port=9926 --prio-limit=12 --stats-period=5'
     )
     assert '--entrypoint /usr/bin/ceph-exporter' in runfile_lines[-1]
+    assert '-e TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES' in runfile_lines[-1]
     _firewalld().open_ports.assert_not_called()
     with open(basedir / 'config') as f:
         assert f.read() == 'XXXXXXX'