xref: /illumos-gate/usr/src/test/smbsrv-tests/doc/README (revision dd72704bd9e794056c558153663c739e2012d721)
1#
2# This file and its contents are supplied under the terms of the
3# Common Development and Distribution License ("CDDL"), version 1.0.
4# You may only use this file in accordance with the terms of version
5# 1.0 of the CDDL.
6#
7# A full copy of the text of the CDDL should have accompanied this
8# source.  A copy of the CDDL is also available via the Internet at
9# http://www.illumos.org/license/CDDL.
10#
11
12#
13# Copyright 2021 Tintri by DDN, Inc. All rights reserved.
14#
15
16SMB Server Test Suite README
17
181. Building and installing the SMB Server Test Suite
192. Running the SMB Server Test Suite
203. Test Results
21
22--------------------------------------------------------------------------------
23
241. Building and installing the SMB Server Test Suite
25
26The SMB Server test suite uses external programs including:
27	smbtorture (and more to come)
28which is installed via a package dependency on:
29	service/network/samba
30Those are run by python and ksh wrappers found here.
31
32To build, just do:
33	cd $SRC/test/smbsrv-tests
34	make install
35
36To install the full suite, run:
37	pkg install pkg:/system/test/smbsrvtest
38
39--------------------------------------------------------------------------------
40
412. Preparing the SMB Server Share
42
43When workgroup mode is used, make sure the pam_smb_passwd module is
44configured in /etc/pam.conf or in /etc/pam.d:
45
46other   password required       pam_smb_passwd.so.1 nowarn
47
48Add test user:
49# useradd test
50# smbadm enable-user test
51# passwd test
52
53If needed, add admin user as shown above, and add it to smb group:
54# smbadm add-member -m admin@<hostname> administrators
55
56Set smb default settings:
57
58# sharectl set -p signing_required=false smb
59# sharectl set -p signing_enabled=true smb
60# svcadm restart network/smb/server
61
62Create dataset(s):
63
64Some smbtorture tests do rely on recordsize 4k.
65
66# zfs create -o recordsize=4k -o casesensitivity=mixed -o nbmand=on \
67  <pool>/test
68
69Set permissions:
70
71# chmod A=everyone@:full_set:fd:allow /<path to mounpoint>/test
72
73Create required snapshots (WPTS needs exactly 3 snapshots):
74
75# zfs snapshot <pool>/test@a
76# zfs snapshot <pool>/test@b
77# zfs snapshot <pool>/test@c
78
79Activate smb share:
80
81# zfs set sharesmb=name=test <pool>/test
82
83--------------------------------------------------------------------------------
84
853. Running the SMB Server Test Suite
86
87The default configuration:
88	/opt/smbsrv-tests/include/default.cfg
89runs tests against a server instance on "localhost",
90using a share named "test" and user=test, pw=test
91
92It's common to copy that default.cfg to something new
93and modify the SMBT_... variables to specify different
94host, share, user, etc.
95
96To run all tests using the default configuration run:
97	/opt/smbsrv-tests/bin/smbsrvtests
98
99To run all tests using a different configuration:
100	/opt/smbsrv-tests/bin/smbsrvtests -c config_file
101
102You can also run individual tests found under:
103	/opt/smbsrv-tests/tests/*
104For example:
105	/opt/smbsrv-tests/tests/smbtorture/runst-smb2
106
107These take similar options (eg. -c config_file).
108
109To run only a subset of the tests, you can pass match patterns
110as additional arguments to the individual test, eg
111	/opt/smbsrv-tests/tests/smbtorture/runst-smb2 smb2.lease
112
113--------------------------------------------------------------------------------
114
1154. Test Results
116
117While the SMB Server Test Suite is running, one informational line is
118printed for each test, ending with one of:
119	PASS, FAIL, SKIP, KILLED, UNKNOWN
120
121The test outputs can be found in:
122	/var/tmp/test_results/smbsrv-tests/
123For example:
124	smbtor-smb2-20210317T162827.summary
125	smbtor-smb2-20210317T162827.log
126
127The *.summary file is the same as what's shown while the test runs.
128The *.log file is the detailed output from the test program(s).
129