]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/suites/cephadm/smb: add new test case for remote control grpc
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 3 Jun 2026 20:11:58 +0000 (16:11 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Sat, 11 Jul 2026 14:38:31 +0000 (10:38 -0400)
We recently added testing for the remote control service via the
local unix socket but had no coverage for the gRPC based
mode of operation. This adds a test case that configures and deploys
the needed TLS certs and sets up and tests remote control with gRPC.

Fixes: https://tracker.ceph.com/issues/76676
Signed-off-by: John Mulligan <jmulligan@redhat.com>
qa/suites/orch/cephadm/smb/tasks/deploy_smb_mgr_res_remotectl.yaml [new file with mode: 0644]

diff --git a/qa/suites/orch/cephadm/smb/tasks/deploy_smb_mgr_res_remotectl.yaml b/qa/suites/orch/cephadm/smb/tasks/deploy_smb_mgr_res_remotectl.yaml
new file mode 100644 (file)
index 0000000..38b7772
--- /dev/null
@@ -0,0 +1,152 @@
+roles:
+# Test is for basic smb deployment & functionality. one node cluster is OK
+- - host.a
+  - mon.a
+  - mgr.x
+  - osd.0
+  - osd.1
+  - client.0
+# Reserve a host for acting as a domain controller
+- - host.b
+  - cephadm.exclude
+overrides:
+  ceph:
+    log-only-match:
+      - CEPHADM_
+tasks:
+- openssl_keys:
+    rcroot:
+      client: client.0
+      cn: rcroot
+      key-type: rsa:4096
+    remote-control:
+      client: client.0
+      ca: rcroot
+      cn: remote-control
+      add-san: true
+    remote-control-client:
+      client: client.0
+      ca: rcroot
+      cn: remote-control-client
+      add-san: true
+- smb.deploy_samba_ad_dc:
+    role: host.b
+- cephadm:
+    single_host_defaults: true
+
+- cephadm.shell:
+    host.a:
+      - ceph fs volume create cephfs
+- cephadm.wait_for_service:
+    service: mds.cephfs
+
+- cephadm.shell:
+    host.a:
+      # add subvolgroup & subvolumes for test
+      - cmd: ceph fs subvolumegroup create cephfs smb
+      - cmd: ceph fs subvolume create cephfs sv1 --group-name=smb --mode=0777
+      - cmd: ceph fs subvolume create cephfs sv2 --group-name=smb --mode=0777
+      # set up smb cluster and shares
+      - cmd: ceph mgr module enable smb
+      # TODO: replace sleep with poll of mgr state?
+      - cmd: sleep 30
+      - cmd: ceph smb apply -i -
+        stdin: |
+          # --- Begin Embedded YAML
+          - resource_type: ceph.smb.tls.credential
+            tls_credential_id: rc-cert-1
+            credential_type: cert
+            value: |
+              {{'cert@remote-control'|openssl_content|indent(4)}}
+          - resource_type: ceph.smb.tls.credential
+            tls_credential_id: rc-key-1
+            credential_type: key
+            value: |
+              {{'key@remote-control'|openssl_content|indent(4)}}
+          - resource_type: ceph.smb.tls.credential
+            tls_credential_id: rc-ca-cert-1
+            credential_type: cert
+            value: |
+              {{'cert@rcroot'|openssl_content|indent(4)}}
+          - resource_type: ceph.smb.cluster
+            cluster_id: modtest1
+            auth_mode: active-directory
+            domain_settings:
+              realm: DOMAIN1.SINK.TEST
+              join_sources:
+                - source_type: resource
+                  ref: join1-admin
+            custom_dns:
+              - "{{ctx.samba_ad_dc_ip}}"
+            remote_control:
+              cert: {ref: rc-cert-1}
+              key: {ref: rc-key-1}
+              ca_cert: {ref: rc-ca-cert-1}
+            placement:
+              count: 1
+          - resource_type: ceph.smb.join.auth
+            auth_id: join1-admin
+            auth:
+              username: Administrator
+              password: Passw0rd
+          - resource_type: ceph.smb.share
+            cluster_id: modtest1
+            share_id: share1
+            cephfs:
+              volume: cephfs
+              subvolumegroup: smb
+              subvolume: sv1
+              path: /
+          - resource_type: ceph.smb.share
+            cluster_id: modtest1
+            share_id: share2
+            cephfs:
+              volume: cephfs
+              subvolumegroup: smb
+              subvolume: sv2
+              path: /
+          # --- End Embedded YAML
+# Wait for the smb service to start
+- cephadm.wait_for_service:
+    service: smb.modtest1
+# Check if shares exist
+- template.exec:
+    host.b:
+      - sleep 30
+      - "{{ctx.samba_client_container_cmd|join(' ')}} smbclient -U DOMAIN1\\\\ckent%1115Rose. //{{'host.a'|role_to_remote|attr('ip_address')}}/share1 -c ls"
+      - "{{ctx.samba_client_container_cmd|join(' ')}} smbclient -U DOMAIN1\\\\ckent%1115Rose. //{{'host.a'|role_to_remote|attr('ip_address')}}/share2 -c ls"
+
+- smb.workunit:
+    admin_node: host.a
+    smb_nodes: [host.a]
+    smb_shares:
+      - share1
+      - share2
+    timeout: 1h
+    clients:
+      client.0:
+        - [default, ceph_smb_ctl_remote]
+
+- cephadm.shell:
+    host.a:
+      - cmd: ceph smb apply -i -
+        stdin: |
+          # --- Begin Embedded YAML
+          - resource_type: ceph.smb.cluster
+            cluster_id: modtest1
+            intent: removed
+          - resource_type: ceph.smb.join.auth
+            auth_id: join1-admin
+            intent: removed
+          - resource_type: ceph.smb.share
+            cluster_id: modtest1
+            share_id: share1
+            intent: removed
+          - resource_type: ceph.smb.share
+            cluster_id: modtest1
+            share_id: share2
+            intent: removed
+          # --- End Embedded YAML
+# Wait for the smb service to be removed
+- cephadm.wait_for_service_not_present:
+    service: smb.modtest1