]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/suites/orch: add test for smb mgr module basic deploy with resources 56350/head
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 24 Apr 2024 15:32:54 +0000 (11:32 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 25 Apr 2024 23:10:57 +0000 (19:10 -0400)
Signed-off-by: John Mulligan <jmulligan@redhat.com>
qa/suites/orch/cephadm/smb/tasks/deploy_smb_mgr_res_basic.yaml [new file with mode: 0644]

diff --git a/qa/suites/orch/cephadm/smb/tasks/deploy_smb_mgr_res_basic.yaml b/qa/suites/orch/cephadm/smb/tasks/deploy_smb_mgr_res_basic.yaml
new file mode 100644 (file)
index 0000000..b515307
--- /dev/null
@@ -0,0 +1,103 @@
+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 apply -i -
+        stdin: |
+          # --- Begin Embedded YAML
+          - resource_type: ceph.smb.cluster
+            cluster_id: modusr1
+            auth_mode: user
+            user_group_settings:
+              - {source_type: resource, ref: ug1}
+            placement:
+              count: 1
+          - resource_type: ceph.smb.usersgroups
+            users_groups_id: ug1
+            values:
+              users:
+                - {name: user1, password: t3stP4ss1}
+                - {name: user2, password: t3stP4ss2}
+              groups: []
+          - resource_type: ceph.smb.share
+            cluster_id: modusr1
+            share_id: share1
+            cephfs:
+              volume: cephfs
+              subvolumegroup: smb
+              subvolume: sv1
+              path: /
+          - resource_type: ceph.smb.share
+            cluster_id: modusr1
+            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.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 apply -i -
+        stdin: |
+          # --- Begin Embedded YAML
+          - resource_type: ceph.smb.cluster
+            cluster_id: modusr1
+            intent: removed
+          - resource_type: ceph.smb.usersgroups
+            users_groups_id: ug1
+            intent: removed
+          - resource_type: ceph.smb.share
+            cluster_id: modusr1
+            share_id: share1
+            intent: removed
+          - resource_type: ceph.smb.share
+            cluster_id: modusr1
+            share_id: share2
+            intent: removed
+          # --- End Embedded YAML
+# Wait for the smb service to be removed
+- cephadm.wait_for_service_not_present:
+    service: smb.modusr1