From 4c7051de098abec04afdcdc27b735ab868776fa1 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Sat, 21 Oct 2023 16:04:48 -0400 Subject: [PATCH] cephadm: add test assertions for unlimited pids option Ensure that future changes continue to set/not set option as appropriate. 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cephadm/tests/test_deploy.py b/src/cephadm/tests/test_deploy.py index 5a8950f3171..bdadcf9906b 100644 --- a/src/cephadm/tests/test_deploy.py +++ b/src/cephadm/tests/test_deploy.py @@ -63,6 +63,7 @@ def test_deploy_nfs_container(cephadm_fs, monkeypatch): 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] + assert '--pids-limit' 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' @@ -95,6 +96,7 @@ def test_deploy_snmp_container(cephadm_fs, monkeypatch): assert runfile_lines[-1].endswith( 'quay.io/aaabbb/snmp:latest --web.listen-address=:9464 --snmp.destination=192.168.100.10:8899 --snmp.version=V2c --log.level=info --snmp.trap-description-template=/etc/snmp_notifier/description-template.tpl' ) + assert '--pids-limit' not in runfile_lines[-1] _firewalld().open_ports.assert_not_called() basedir = pathlib.Path(f'/var/lib/ceph/{fsid}/snmp-gateway.sunmop') assert basedir.is_dir() @@ -173,6 +175,7 @@ def test_deploy_haproxy_container(cephadm_fs, monkeypatch): assert runfile_lines[-1].endswith( 'quay.io/lfeuwbo/haproxy:latest haproxy -f /var/lib/haproxy/haproxy.cfg' ) + assert '--pids-limit' not in runfile_lines[-1] _firewalld().open_ports.assert_not_called() assert not (basedir / 'config').exists() assert not (basedir / 'keyring').exists() @@ -213,6 +216,7 @@ def test_deploy_iscsi_container(cephadm_fs, monkeypatch): 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] + assert '--pids-limit' in runfile_lines[-1] _firewalld().open_ports.assert_not_called() with open(basedir / 'config') as f: assert f.read() == 'XXXXXXX' @@ -253,6 +257,7 @@ def test_deploy_nvmeof_container(cephadm_fs, monkeypatch): 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] + assert '--pids-limit' in runfile_lines[-1] _firewalld().open_ports.assert_not_called() with open(basedir / 'config') as f: assert f.read() == 'XXXXXXX' @@ -364,6 +369,7 @@ def test_deploy_ceph_mgr_container(cephadm_fs, monkeypatch): '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] + assert '--pids-limit' in runfile_lines[-1] _firewalld().open_ports.assert_not_called() with open(basedir / 'config') as f: assert f.read() == 'XXXXXXX' @@ -413,6 +419,7 @@ def test_deploy_ceph_exporter_container(cephadm_fs, monkeypatch): ) assert '--entrypoint /usr/bin/ceph-exporter' in runfile_lines[-1] assert '-e TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES' in runfile_lines[-1] + assert '--pids-limit' in runfile_lines[-1] _firewalld().open_ports.assert_not_called() with open(basedir / 'config') as f: assert f.read() == 'XXXXXXX' -- 2.39.5