]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: add additional test cases for unit file contents
authorJohn Mulligan <jmulligan@redhat.com>
Tue, 11 Jul 2023 19:51:19 +0000 (15:51 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Fri, 3 Nov 2023 22:50:01 +0000 (18:50 -0400)
Asserts more about the unit files.

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

index cf094c97bc2f92d67a8f7db53894c0abf9a4fd20..193baff35a78917eba4fd731e093cc376a2fd54d 100644 (file)
@@ -16,6 +16,8 @@ from tests.fixtures import (
     with_cephadm_ctx,
 )
 
+from cephadmlib.constants import CGROUPS_SPLIT_PODMAN_VERSION
+
 _cephadm = import_cephadm()
 
 
@@ -31,3 +33,24 @@ def test_podman_engine_does_not_req_docker():
     ctx.container_engine = mock_podman()
     r = _cephadm.get_unit_file(ctx, '9b9d7609-f4d5-4aba-94c8-effa764d96c9')
     assert 'Requires=docker.service' not in r
+
+
+def test_podman_engine_forking_service():
+    # verity that the podman service uses the forking service type
+    # and related parameters
+    ctx = _cephadm.CephadmContext()
+    ctx.container_engine = mock_podman()
+    r = _cephadm.get_unit_file(ctx, '9b9d7609-f4d5-4aba-94c8-effa764d96c9')
+    assert 'Type=forking' in r
+    assert 'PIDFile=' in r
+    assert 'ExecStartPre' in r
+    assert 'ExecStopPost' in r
+
+
+def test_podman_with_split_cgroups_sets_delegate():
+    ctx = _cephadm.CephadmContext()
+    ctx.container_engine = mock_podman()
+    ctx.container_engine.version = CGROUPS_SPLIT_PODMAN_VERSION
+    r = _cephadm.get_unit_file(ctx, '9b9d7609-f4d5-4aba-94c8-effa764d96c9')
+    assert 'Type=forking' in r
+    assert 'Delegate=yes' in r