From 33a51aa9d81801a25f167beb1bddc5f49e97ad98 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Sat, 24 Feb 2024 10:52:53 -0500 Subject: [PATCH] qa/suites/orch: add a new smb service cephadm sub-suite and test Start a new subdir under cephadm suite for the new smb service that cephadm can deploy. Add one new test that checks that a smb service with domain membership can be deployed and connect to it with smbclient from the samba client container image. Signed-off-by: John Mulligan (cherry picked from commit 1f3001eef670a6bd1ff47cc11e459058a523b388) --- qa/suites/orch/cephadm/smb/% | 0 qa/suites/orch/cephadm/smb/.qa | 1 + qa/suites/orch/cephadm/smb/0-distro | 1 + qa/suites/orch/cephadm/smb/tasks/.qa | 1 + .../cephadm/smb/tasks/deploy_smb_domain.yaml | 92 +++++++++++++++++++ 5 files changed, 95 insertions(+) create mode 100644 qa/suites/orch/cephadm/smb/% create mode 120000 qa/suites/orch/cephadm/smb/.qa create mode 120000 qa/suites/orch/cephadm/smb/0-distro create mode 120000 qa/suites/orch/cephadm/smb/tasks/.qa create mode 100644 qa/suites/orch/cephadm/smb/tasks/deploy_smb_domain.yaml diff --git a/qa/suites/orch/cephadm/smb/% b/qa/suites/orch/cephadm/smb/% new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/qa/suites/orch/cephadm/smb/.qa b/qa/suites/orch/cephadm/smb/.qa new file mode 120000 index 0000000000000..fea2489fdf6d9 --- /dev/null +++ b/qa/suites/orch/cephadm/smb/.qa @@ -0,0 +1 @@ +../.qa \ No newline at end of file diff --git a/qa/suites/orch/cephadm/smb/0-distro b/qa/suites/orch/cephadm/smb/0-distro new file mode 120000 index 0000000000000..66187855738ef --- /dev/null +++ b/qa/suites/orch/cephadm/smb/0-distro @@ -0,0 +1 @@ +.qa/distros/supported-container-hosts \ No newline at end of file diff --git a/qa/suites/orch/cephadm/smb/tasks/.qa b/qa/suites/orch/cephadm/smb/tasks/.qa new file mode 120000 index 0000000000000..fea2489fdf6d9 --- /dev/null +++ b/qa/suites/orch/cephadm/smb/tasks/.qa @@ -0,0 +1 @@ +../.qa \ No newline at end of file diff --git a/qa/suites/orch/cephadm/smb/tasks/deploy_smb_domain.yaml b/qa/suites/orch/cephadm/smb/tasks/deploy_smb_domain.yaml new file mode 100644 index 0000000000000..541d5ac1fa7dd --- /dev/null +++ b/qa/suites/orch/cephadm/smb/tasks/deploy_smb_domain.yaml @@ -0,0 +1,92 @@ +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: +- cephadm.deploy_samba_ad_dc: + role: host.b +- cephadm: + +- cephadm.shell: + host.a: + - ceph fs volume create cephfs +- cephadm.wait_for_service: + service: mds.cephfs + +- cephadm.shell: + host.a: + # create a subvolume so we can verify that we're sharing something + - cmd: ceph fs subvolumegroup create cephfs g1 + - cmd: ceph fs subvolume create cephfs sub1 --group-name=g1 --mode=0777 + # Create a user access the file system from samba + - cmd: ceph fs authorize cephfs client.smbdata / rw + # Create a rados pool and store the config in it + - cmd: ceph osd pool create .smb --yes-i-really-mean-it + - cmd: ceph osd pool application enable .smb smb + - cmd: rados --pool=.smb --namespace=admem1 put conf.toml /dev/stdin + stdin: | + samba-container-config = "v0" + [configs.admem1] + shares = ["share1"] + globals = ["default", "domain"] + instance_name = "SAMBA" + [shares.share1.options] + "vfs objects" = "ceph" + path = "/" + "ceph:config_file" = "/etc/ceph/ceph.conf" + "ceph:user_id" = "smbdata" + "kernel share modes" = "no" + "read only" = "no" + "browseable" = "yes" + [globals.default.options] + "server min protocol" = "SMB2" + "load printers" = "no" + "printing" = "bsd" + "printcap name" = "/dev/null" + "disable spoolss" = "yes" + "guest ok" = "no" + [globals.domain.options] + security = "ads" + workgroup = "DOMAIN1" + realm = "domain1.sink.test" + "idmap config * : backend" = "autorid" + "idmap config * : range" = "2000-9999999" + # Store the join auth user/pass in the config-key store + - cmd: ceph config-key set smb/config/admem1/join1.json -i - + stdin: | + {"username": "Administrator", "password": "Passw0rd"} + +- cephadm.apply: + specs: + - service_type: smb + service_id: admem1 + placement: + count: 1 + cluster_id: admem1 + features: + - domain + config_uri: "rados://.smb/admem1/conf.toml" + custom_dns: + - "{{ctx.samba_ad_dc_ip}}" + join_sources: + - "rados:mon-config-key:smb/config/admem1/join1.json" + include_ceph_users: + - "client.smbdata" +- cephadm.wait_for_service: + service: smb.admem1 + +- cephadm.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" -- 2.39.5