]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: add test assertions for unlimited pids option
authorJohn Mulligan <jmulligan@redhat.com>
Sat, 21 Oct 2023 20:04:48 +0000 (16:04 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Sun, 22 Oct 2023 12:15:15 +0000 (08:15 -0400)
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 <jmulligan@redhat.com>
src/cephadm/tests/test_deploy.py

index 5a8950f3171a45cd6da9414717779024972704fd..bdadcf9906bcecc652ff429f282141ba3138e2c4 100644 (file)
@@ -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'