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