From e4db99a699aa040a5c102322a75aa399cd9de19f Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Sat, 21 Oct 2023 15:53:34 -0400 Subject: [PATCH] cephadm: assert that ceph specific env vars get set 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 --- src/cephadm/tests/test_deploy.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cephadm/tests/test_deploy.py b/src/cephadm/tests/test_deploy.py index 1f4eddf3a70d6..5a8950f3171a4 100644 --- a/src/cephadm/tests/test_deploy.py +++ b/src/cephadm/tests/test_deploy.py @@ -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' -- 2.39.5