Skip to content

Commit f07ae5e

Browse files
qa/cephadm/smb: add a test that uses custom ports
Signed-off-by: John Mulligan <[email protected]>
1 parent ac213f4 commit f07ae5e

File tree

1 file changed

+110
-0
lines changed

1 file changed

+110
-0
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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+
# Reserve a host for acting as a domain controller
10+
- - host.b
11+
- cephadm.exclude
12+
overrides:
13+
ceph:
14+
log-only-match:
15+
- CEPHADM_
16+
tasks:
17+
- cephadm.deploy_samba_ad_dc:
18+
role: host.b
19+
- cephadm:
20+
single_host_defaults: true
21+
22+
- cephadm.shell:
23+
host.a:
24+
- ceph fs volume create cephfs
25+
- cephadm.wait_for_service:
26+
service: mds.cephfs
27+
28+
- cephadm.shell:
29+
host.a:
30+
# add subvolgroup & subvolumes for test
31+
- cmd: ceph fs subvolumegroup create cephfs smb
32+
- cmd: ceph fs subvolume create cephfs sv1 --group-name=smb --mode=0777
33+
- cmd: ceph fs subvolume create cephfs sv2 --group-name=smb --mode=0777
34+
# set up smb cluster and shares
35+
- cmd: ceph mgr module enable smb
36+
# TODO: replace sleep with poll of mgr state?
37+
- cmd: sleep 30
38+
- cmd: ceph smb apply -i -
39+
stdin: |
40+
# --- Begin Embedded YAML
41+
- resource_type: ceph.smb.cluster
42+
cluster_id: altports
43+
auth_mode: active-directory
44+
domain_settings:
45+
realm: DOMAIN1.SINK.TEST
46+
join_sources:
47+
- source_type: resource
48+
ref: join1-admin
49+
custom_dns:
50+
- "{{ctx.samba_ad_dc_ip}}"
51+
custom_ports:
52+
smb: 4455
53+
smbmetrics: 9909
54+
placement:
55+
count: 1
56+
- resource_type: ceph.smb.join.auth
57+
auth_id: join1-admin
58+
auth:
59+
username: Administrator
60+
password: Passw0rd
61+
- resource_type: ceph.smb.share
62+
cluster_id: altports
63+
share_id: share1
64+
cephfs:
65+
volume: cephfs
66+
subvolumegroup: smb
67+
subvolume: sv1
68+
path: /
69+
- resource_type: ceph.smb.share
70+
cluster_id: altports
71+
share_id: share2
72+
cephfs:
73+
volume: cephfs
74+
subvolumegroup: smb
75+
subvolume: sv2
76+
path: /
77+
# --- End Embedded YAML
78+
# Wait for the smb service to start
79+
- cephadm.wait_for_service:
80+
service: smb.altports
81+
# Check if shares exist
82+
- cephadm.exec:
83+
host.b:
84+
- sleep 30
85+
- "{{ctx.samba_client_container_cmd|join(' ')}} smbclient -p4455 -U DOMAIN1\\\\ckent%1115Rose. //{{'host.a'|role_to_remote|attr('ip_address')}}/share1 -c ls"
86+
- "{{ctx.samba_client_container_cmd|join(' ')}} smbclient -p4455 -U DOMAIN1\\\\ckent%1115Rose. //{{'host.a'|role_to_remote|attr('ip_address')}}/share2 -c ls"
87+
88+
- cephadm.shell:
89+
host.a:
90+
- cmd: ceph smb apply -i -
91+
stdin: |
92+
# --- Begin Embedded YAML
93+
- resource_type: ceph.smb.cluster
94+
cluster_id: altports
95+
intent: removed
96+
- resource_type: ceph.smb.join.auth
97+
auth_id: join1-admin
98+
intent: removed
99+
- resource_type: ceph.smb.share
100+
cluster_id: altports
101+
share_id: share1
102+
intent: removed
103+
- resource_type: ceph.smb.share
104+
cluster_id: altports
105+
share_id: share2
106+
intent: removed
107+
# --- End Embedded YAML
108+
# Wait for the smb service to be removed
109+
- cephadm.wait_for_service_not_present:
110+
service: smb.altports

0 commit comments

Comments
 (0)