summaryrefslogtreecommitdiff
path: root/usr/src/test/smbsrv-tests/doc/README
blob: 2a6b667c5f3caed8726c6b3a49d052eb036ef3eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#

#
# Copyright 2021 Tintri by DDN, Inc. All rights reserved.
#

SMB Server Test Suite README

1. Building and installing the SMB Server Test Suite
2. Running the SMB Server Test Suite
3. Test Results

--------------------------------------------------------------------------------

1. Building and installing the SMB Server Test Suite

The SMB Server test suite uses external programs including:
	smbtorture (and more to come)
which is installed via a package dependency on:
	service/network/samba
Those are run by python and ksh wrappers found here.

To build, just do:
	cd $SRC/test/smbsrv-tests
	make install

To install the full suite, run:
	pkg install pkg:/system/test/smbsrvtest

--------------------------------------------------------------------------------

2. Preparing the SMB Server Share

When workgroup mode is used, make sure the pam_smb_passwd module is
configured in /etc/pam.conf or in /etc/pam.d:

other   password required       pam_smb_passwd.so.1 nowarn

Add test user:
# useradd test
# smbadm enable-user test
# passwd test

If needed, add admin user as shown above, and add it to smb group:
# smbadm add-member -m admin@<hostname> administrators

Set smb default settings:

# sharectl set -p signing_required=false smb
# sharectl set -p signing_enabled=true smb
# svcadm restart network/smb/server

Create dataset(s):

Some smbtorture tests do rely on recordsize 4k.

# zfs create -o recordsize=4k -o casesensitivity=mixed -o nbmand=on \
  <pool>/test

Set permissions:

# chmod A=everyone@:full_set:fd:allow /<path to mounpoint>/test

Create required snapshots (WPTS needs exactly 3 snapshots):

# zfs snapshot <pool>/test@a
# zfs snapshot <pool>/test@b
# zfs snapshot <pool>/test@c

Activate smb share:

# zfs set sharesmb=name=test <pool>/test

--------------------------------------------------------------------------------

3. Running the SMB Server Test Suite

The default configuration:
	/opt/smbsrv-tests/include/default.cfg
runs tests against a server instance on "localhost",
using a share named "test" and user=test, pw=test

It's common to copy that default.cfg to something new
and modify the SMBT_... variables to specify different
host, share, user, etc.

To run all tests using the default configuration run:
	/opt/smbsrv-tests/bin/smbsrvtests

To run all tests using a different configuration:
	/opt/smbsrv-tests/bin/smbsrvtests -c config_file

You can also run individual tests found under:
	/opt/smbsrv-tests/tests/*
For example:
	/opt/smbsrv-tests/tests/smbtorture/runst-smb2

These take similar options (eg. -c config_file).

To run only a subset of the tests, you can pass match patterns
as additional arguments to the individual test, eg
	/opt/smbsrv-tests/tests/smbtorture/runst-smb2 smb2.lease

--------------------------------------------------------------------------------

4. Test Results

While the SMB Server Test Suite is running, one informational line is
printed for each test, ending with one of:
	PASS, FAIL, SKIP, KILLED, UNKNOWN

The test outputs can be found in:
	/var/tmp/test_results/smbsrv-tests/
For example:
	smbtor-smb2-20210317T162827.summary
	smbtor-smb2-20210317T162827.log

The *.summary file is the same as what's shown while the test runs.
The *.log file is the detailed output from the test program(s).