]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/cephadm: test for extra daemon features 55958/head
authorAdam King <adking@redhat.com>
Mon, 19 Jun 2023 18:24:23 +0000 (14:24 -0400)
committerAdam King <adking@redhat.com>
Tue, 5 Mar 2024 14:30:38 +0000 (09:30 -0500)
Specifically, extra_container_args, extra_entrypoint_args,
and custom_configs.

This also provides testing for the CustomContainer
class which previously had no usage in any
of the teuthology tests

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 031bbbc17fda3c7b28b12d11b976629d8c1297ed)

qa/suites/orch/cephadm/workunits/task/test_extra_daemon_features.yaml [new file with mode: 0644]

diff --git a/qa/suites/orch/cephadm/workunits/task/test_extra_daemon_features.yaml b/qa/suites/orch/cephadm/workunits/task/test_extra_daemon_features.yaml
new file mode 100644 (file)
index 0000000..b5e0ec9
--- /dev/null
@@ -0,0 +1,74 @@
+roles:
+- - host.a
+  - mon.a
+  - mgr.a
+  - osd.0
+- - host.b
+  - mon.b
+  - mgr.b
+  - osd.1
+tasks:
+- install:
+- cephadm:
+- exec:
+    all-hosts:
+      - mkdir /etc/cephadm_testing
+- cephadm.apply:
+    specs:
+      - service_type: mon
+        placement:
+          host_pattern: '*'
+        extra_container_args:
+          - "--cpus=2"
+        extra_entrypoint_args:
+          - "--debug_ms 10"
+      - service_type: container
+        service_id: foo
+        placement:
+          host_pattern: '*'
+        spec:
+          image: "quay.io/fedora/fedora:latest"
+          entrypoint: "bash"
+        extra_container_args:
+          - "-v"
+          - "/etc/cephadm_testing:/root/cephadm_testing"
+        extra_entrypoint_args:
+          - "/root/write_thing_to_file.sh"
+          - "-c"
+          - "testing_custom_containers"
+          - "-o"
+          - "/root/cephadm_testing/testing.txt"
+        custom_configs:
+          - mount_path: "/root/write_thing_to_file.sh"
+            content: |
+              while getopts "o:c:" opt; do
+                case ${opt} in
+                o )
+                  OUT_FILE=${OPTARG}
+                  ;;
+                c )
+                  CONTENT=${OPTARG}
+                esac
+              done
+              echo $CONTENT > $OUT_FILE
+              sleep infinity
+- cephadm.wait_for_service:
+    service: mon
+- cephadm.wait_for_service:
+    service: container.foo
+- exec:
+    host.a:
+      - |
+        set -ex
+        FSID=$(/home/ubuntu/cephtest/cephadm shell -- ceph fsid)
+        sleep 60
+        # check extra container and entrypoint args written to mon unit run file
+        grep "\-\-cpus=2" /var/lib/ceph/$FSID/mon.*/unit.run
+        grep "\-\-debug_ms 10" /var/lib/ceph/$FSID/mon.*/unit.run
+        # check that custom container properly wrote content to file.
+        # This requires the custom config, extra container args, and
+        # entrypoint args to all be working in order for this to have
+        # been written. The container entrypoint was set up with custom_configs,
+        # the content and where to write to with the entrypoint args, and the mounting
+        # of the /etc/cephadm_testing dir with extra container args
+        grep "testing_custom_containers" /etc/cephadm_testing/testing.txt