Skip to content

Commit dc09d17

Browse files
qa/suites/orch: add test for smb with ctdb and cluster public ips
Signed-off-by: John Mulligan <[email protected]>
1 parent 9997a64 commit dc09d17

File tree

1 file changed

+145
-0
lines changed

1 file changed

+145
-0
lines changed
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
roles:
2+
# Test is for basic smb deployment & functionality. one node cluster is OK
3+
- - host.a
4+
- mon.a
5+
- mgr.x
6+
- osd.0
7+
- osd.1
8+
- client.0
9+
- - host.b
10+
- mon.b
11+
- osd.2
12+
- osd.3
13+
- - host.c
14+
- mon.c
15+
- osd.4
16+
- osd.5
17+
# Reserve a host for acting as a domain controller and smb client
18+
- - host.d
19+
- cephadm.exclude
20+
overrides:
21+
ceph:
22+
log-only-match:
23+
- CEPHADM_
24+
tasks:
25+
- cephadm.deploy_samba_ad_dc:
26+
role: host.d
27+
- vip:
28+
count: 2
29+
- cephadm:
30+
31+
- cephadm.shell:
32+
host.a:
33+
- ceph fs volume create cephfs
34+
- cephadm.wait_for_service:
35+
service: mds.cephfs
36+
37+
- cephadm.shell:
38+
host.a:
39+
# add subvolgroup & subvolumes for test
40+
- cmd: ceph fs subvolumegroup create cephfs smb
41+
- cmd: ceph fs subvolume create cephfs sv1 --group-name=smb --mode=0777
42+
- cmd: ceph fs subvolume create cephfs sv2 --group-name=smb --mode=0777
43+
# set up smb cluster and shares
44+
- cmd: ceph mgr module enable smb
45+
# TODO: replace sleep with poll of mgr state?
46+
- cmd: sleep 30
47+
- cmd: ceph smb apply -i -
48+
stdin: |
49+
# --- Begin Embedded YAML
50+
- resource_type: ceph.smb.cluster
51+
cluster_id: adipctdb
52+
auth_mode: active-directory
53+
domain_settings:
54+
realm: DOMAIN1.SINK.TEST
55+
join_sources:
56+
- source_type: resource
57+
ref: join1-admin
58+
custom_dns:
59+
- "{{ctx.samba_ad_dc_ip}}"
60+
public_addrs:
61+
- address: {{VIP0}}/{{VIPPREFIXLEN}}
62+
- address: {{VIP1}}/{{VIPPREFIXLEN}}
63+
placement:
64+
count: 3
65+
- resource_type: ceph.smb.join.auth
66+
auth_id: join1-admin
67+
auth:
68+
username: Administrator
69+
password: Passw0rd
70+
- resource_type: ceph.smb.share
71+
cluster_id: adipctdb
72+
share_id: share1
73+
cephfs:
74+
volume: cephfs
75+
subvolumegroup: smb
76+
subvolume: sv1
77+
path: /
78+
- resource_type: ceph.smb.share
79+
cluster_id: adipctdb
80+
share_id: share2
81+
cephfs:
82+
volume: cephfs
83+
subvolumegroup: smb
84+
subvolume: sv2
85+
path: /
86+
# --- End Embedded YAML
87+
# Wait for the smb service to start
88+
- cephadm.wait_for_service:
89+
service: smb.adipctdb
90+
# Since this is a true cluster there should be a clustermeta in rados
91+
- cephadm.shell:
92+
host.a:
93+
- cmd: rados --pool=.smb -N adipctdb get cluster.meta.json /dev/stdout
94+
95+
# Check if shares exist
96+
- cephadm.exec:
97+
host.d:
98+
- sleep 30
99+
- "{{ctx.samba_client_container_cmd|join(' ')}} smbclient -U DOMAIN1\\\\ckent%1115Rose. //{{'host.a'|role_to_remote|attr('ip_address')}}/share1 -c ls"
100+
- "{{ctx.samba_client_container_cmd|join(' ')}} smbclient -U DOMAIN1\\\\ckent%1115Rose. //{{'host.a'|role_to_remote|attr('ip_address')}}/share2 -c ls"
101+
102+
# verify CTDB is healthy, cluster well formed
103+
- cephadm.exec:
104+
host.a:
105+
- "{{ctx.cephadm}} ls --no-detail | {{ctx.cephadm}} shell jq -r 'map(select(.name | startswith(\"smb.adipctdb\")))[-1].name' > /tmp/svcname"
106+
- "{{ctx.cephadm}} enter -n $(cat /tmp/svcname) ctdb status > /tmp/ctdb_status"
107+
- cat /tmp/ctdb_status
108+
- grep 'pnn:0 .*OK' /tmp/ctdb_status
109+
- grep 'pnn:1 .*OK' /tmp/ctdb_status
110+
- grep 'pnn:2 .*OK' /tmp/ctdb_status
111+
- grep 'Number of nodes:3' /tmp/ctdb_status
112+
- rm -rf /tmp/svcname /tmp/ctdb_status
113+
114+
# Test the two assigned VIPs
115+
- cephadm.exec:
116+
host.d:
117+
- sleep 30
118+
- "{{ctx.samba_client_container_cmd|join(' ')}} smbclient -U DOMAIN1\\\\ckent%1115Rose. //{{VIP0}}/share1 -c ls"
119+
- "{{ctx.samba_client_container_cmd|join(' ')}} smbclient -U DOMAIN1\\\\ckent%1115Rose. //{{VIP1}}/share1 -c ls"
120+
- "{{ctx.samba_client_container_cmd|join(' ')}} smbclient -U DOMAIN1\\\\ckent%1115Rose. //{{VIP0}}/share2 -c ls"
121+
- "{{ctx.samba_client_container_cmd|join(' ')}} smbclient -U DOMAIN1\\\\ckent%1115Rose. //{{VIP1}}/share2 -c ls"
122+
123+
- cephadm.shell:
124+
host.a:
125+
- cmd: ceph smb apply -i -
126+
stdin: |
127+
# --- Begin Embedded YAML
128+
- resource_type: ceph.smb.cluster
129+
cluster_id: adipctdb
130+
intent: removed
131+
- resource_type: ceph.smb.join.auth
132+
auth_id: join1-admin
133+
intent: removed
134+
- resource_type: ceph.smb.share
135+
cluster_id: adipctdb
136+
share_id: share1
137+
intent: removed
138+
- resource_type: ceph.smb.share
139+
cluster_id: adipctdb
140+
share_id: share2
141+
intent: removed
142+
# --- End Embedded YAML
143+
# Wait for the smb service to be removed
144+
- cephadm.wait_for_service_not_present:
145+
service: smb.adipctdb

0 commit comments

Comments
 (0)