From 0ab50c3ce2666eaded7f8f97fbc0a78ebc811cdf Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Wed, 24 Apr 2024 11:32:47 -0400 Subject: [PATCH] qa/suites/orch: add test for smb mgr module basic deploy with cli Signed-off-by: John Mulligan --- .../smb/tasks/deploy_smb_mgr_basic.yaml | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 qa/suites/orch/cephadm/smb/tasks/deploy_smb_mgr_basic.yaml diff --git a/qa/suites/orch/cephadm/smb/tasks/deploy_smb_mgr_basic.yaml b/qa/suites/orch/cephadm/smb/tasks/deploy_smb_mgr_basic.yaml new file mode 100644 index 00000000000..bafb71b2aec --- /dev/null +++ b/qa/suites/orch/cephadm/smb/tasks/deploy_smb_mgr_basic.yaml @@ -0,0 +1,60 @@ +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.configure_samba_client_container: + role: host.b +- cephadm: + +- 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 cluster create modusr1 user + --define-user-pass=user1%t3stP4ss1 + --define-user-pass=user2%t3stP4ss2 + - cmd: ceph smb share create modusr1 share1 cephfs / --subvolume=smb/sv1 + - cmd: ceph smb share create modusr1 share2 cephfs / --subvolume=smb/sv2 +# Wait for the smb service to start +- cephadm.wait_for_service: + service: smb.modusr1 +# Check if shares exist +- cephadm.exec: + host.b: + - sleep 30 + - "{{ctx.samba_client_container_cmd|join(' ')}} smbclient -U user1%t3stP4ss1 //{{'host.a'|role_to_remote|attr('ip_address')}}/share1 -c ls" + - "{{ctx.samba_client_container_cmd|join(' ')}} smbclient -U user2%t3stP4ss2 //{{'host.a'|role_to_remote|attr('ip_address')}}/share2 -c ls" + +- cephadm.shell: + host.a: + - cmd: ceph smb share rm modusr1 share2 + - cmd: ceph smb share rm modusr1 share1 + - cmd: ceph smb cluster rm modusr1 +# Wait for the smb service to be removed +- cephadm.wait_for_service_not_present: + service: smb.modusr1 -- 2.39.5