From 79ed468612e32862500242cc7d34d6c9158a9b75 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Wed, 3 Jun 2026 16:11:58 -0400 Subject: [PATCH] qa/suites/cephadm/smb: add new test case for remote control grpc 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 --- .../tasks/deploy_smb_mgr_res_remotectl.yaml | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 qa/suites/orch/cephadm/smb/tasks/deploy_smb_mgr_res_remotectl.yaml 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 index 00000000000..38b77722168 --- /dev/null +++ b/qa/suites/orch/cephadm/smb/tasks/deploy_smb_mgr_res_remotectl.yaml @@ -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