7519 Add smbclient tests
Portions contributed by: Gordon Ross <gwr@nexenta.com>
Portions contributed by: Jilin Xpd <jilinxpd@gmail.com>
Reviewed by: Jean McCormack <jean.mccormack@nexenta.com>
Approved by: Garrett D'Amore <garrett@damore.org>
diff --git a/usr/src/pkg/manifests/system-test-smbclient.mf b/usr/src/pkg/manifests/system-test-smbclient.mf
new file mode 100644
index 0000000..e669cda
--- /dev/null
+++ b/usr/src/pkg/manifests/system-test-smbclient.mf
@@ -0,0 +1,198 @@
+#
+# 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 2015 Nexenta Systems Inc.  All rights reserved.
+#
+
+set name=pkg.fmri value=pkg:/system/test/smbclient@$(PKGVERS)
+set name=pkg.description value="SMB Client Test Suite"
+set name=pkg.summary \
+    value="Functional test suite for the smbutil and smbmount commands"
+set name=info.classification \
+    value=org.opensolaris.category.2008:Development/System
+set name=variant.arch value=$(ARCH)
+dir path=opt/smbclient-tests
+dir path=opt/smbclient-tests/bin
+dir path=opt/smbclient-tests/config
+dir path=opt/smbclient-tests/include
+dir path=opt/smbclient-tests/runfiles
+dir path=opt/smbclient-tests/tests
+dir path=opt/smbclient-tests/tests/nsmbrc
+dir path=opt/smbclient-tests/tests/performance
+dir path=opt/smbclient-tests/tests/performance/filebench
+dir path=opt/smbclient-tests/tests/sharectl
+dir path=opt/smbclient-tests/tests/smbfs
+dir path=opt/smbclient-tests/tests/smbfs/acl
+dir path=opt/smbclient-tests/tests/smbfs/cptest
+dir path=opt/smbclient-tests/tests/smbfs/create
+dir path=opt/smbclient-tests/tests/smbfs/error
+dir path=opt/smbclient-tests/tests/smbfs/misc
+dir path=opt/smbclient-tests/tests/smbfs/mkdir
+dir path=opt/smbclient-tests/tests/smbfs/mmap
+dir path=opt/smbclient-tests/tests/smbfs/mvtest
+dir path=opt/smbclient-tests/tests/smbfs/xattr
+dir path=opt/smbclient-tests/tests/smbmount
+dir path=opt/smbclient-tests/tests/smbutil
+file path=opt/smbclient-tests/README mode=0444
+file path=opt/smbclient-tests/bin/abort_conn mode=0555
+file path=opt/smbclient-tests/bin/close_wr mode=0555
+file path=opt/smbclient-tests/bin/cp_mmap mode=0555
+file path=opt/smbclient-tests/bin/file_trunc mode=0555
+file path=opt/smbclient-tests/bin/mkfile_mmap mode=0555
+file path=opt/smbclient-tests/bin/no_close mode=0555
+file path=opt/smbclient-tests/bin/passwd.exp mode=0555
+file path=opt/smbclient-tests/bin/prot_mmap mode=0555
+file path=opt/smbclient-tests/bin/runone mode=0555
+file path=opt/smbclient-tests/bin/rw_mmap mode=0555
+file path=opt/smbclient-tests/bin/smbclienttest mode=0555
+file path=opt/smbclient-tests/bin/smbutil.exp mode=0555
+file path=opt/smbclient-tests/config/fileio.prof mode=0444
+file path=opt/smbclient-tests/config/filemacro.prof mode=0444
+file path=opt/smbclient-tests/config/filemicro.prof mode=0444
+file path=opt/smbclient-tests/config/generic.func mode=0444
+file path=opt/smbclient-tests/config/randomread.prof mode=0444
+file path=opt/smbclient-tests/config/seqread.prof mode=0444
+file path=opt/smbclient-tests/include/default_cfg.ksh mode=0444
+file path=opt/smbclient-tests/include/libtest.ksh mode=0444
+file path=opt/smbclient-tests/include/services_common.ksh mode=0444
+file path=opt/smbclient-tests/include/smbmount_common.ksh mode=0444
+file path=opt/smbclient-tests/include/smbutil_common.ksh mode=0444
+file path=opt/smbclient-tests/include/utils_common.ksh mode=0444
+file path=opt/smbclient-tests/include/xattr_common.ksh mode=0444
+file path=opt/smbclient-tests/runfiles/default.run mode=0444
+file path=opt/smbclient-tests/runfiles/just-nsmbrc.run mode=0444
+file path=opt/smbclient-tests/runfiles/just-sharectl.run mode=0444
+file path=opt/smbclient-tests/runfiles/just-smbfs.run mode=0444
+file path=opt/smbclient-tests/runfiles/just-smbmount.run mode=0444
+file path=opt/smbclient-tests/runfiles/just-smbutil.run mode=0444
+file path=opt/smbclient-tests/runfiles/perf-regression.run mode=0444
+file path=opt/smbclient-tests/tests/nsmbrc/tp_nsmbrc_001 mode=0555
+file path=opt/smbclient-tests/tests/nsmbrc/tp_nsmbrc_002 mode=0555
+file path=opt/smbclient-tests/tests/nsmbrc/tp_nsmbrc_003 mode=0555
+file path=opt/smbclient-tests/tests/nsmbrc/tp_nsmbrc_004 mode=0555
+file path=opt/smbclient-tests/tests/nsmbrc/tp_nsmbrc_005 mode=0555
+file path=opt/smbclient-tests/tests/nsmbrc/tp_nsmbrc_006 mode=0555
+file path=opt/smbclient-tests/tests/performance/filebench/tp_filebench_001 \
+    mode=0555
+file path=opt/smbclient-tests/tests/performance/filebench/tp_filebench_002 \
+    mode=0555
+file path=opt/smbclient-tests/tests/performance/filebench/tp_filebench_003 \
+    mode=0555
+file path=opt/smbclient-tests/tests/performance/filebench/tp_filebench_004 \
+    mode=0555
+file path=opt/smbclient-tests/tests/performance/filebench/tp_filebench_005 \
+    mode=0555
+file path=opt/smbclient-tests/tests/sharectl/tp_sharectl_001 mode=0555
+file path=opt/smbclient-tests/tests/sharectl/tp_sharectl_002 mode=0555
+file path=opt/smbclient-tests/tests/sharectl/tp_sharectl_003 mode=0555
+file path=opt/smbclient-tests/tests/sharectl/tp_sharectl_004 mode=0555
+file path=opt/smbclient-tests/tests/sharectl/tp_sharectl_005 mode=0555
+file path=opt/smbclient-tests/tests/sharectl/tp_sharectl_006 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/acl/tp_acl_001 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/acl/tp_acl_002 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/acl/tp_acl_003 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/acl/tp_acl_004 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/acl/tp_acl_005 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/cptest/tp_cptest_001 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/cptest/tp_cptest_002 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/cptest/tp_cptest_003 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/cptest/tp_cptest_004 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/cptest/tp_cptest_005 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/cptest/tp_cptest_006 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/cptest/tp_cptest_007 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/cptest/tp_cptest_008 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/cptest/tp_cptest_009 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/create/tp_create_001 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/create/tp_create_002 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/create/tp_create_003 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/create/tp_create_004 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/create/tp_create_005 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/create/tp_create_006 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/create/tp_create_007 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/create/tp_create_008 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/create/tp_create_009 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/create/tp_create_010 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/create/tp_create_011 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/create/tp_create_012 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/error/tp_error_001 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/error/tp_error_002 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/misc/tp_misc_001 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/misc/tp_misc_002 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/misc/tp_misc_003 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_001 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_002 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_003 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_004 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_005 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_006 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mmap/tp_mmap_001 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mmap/tp_mmap_002 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mmap/tp_mmap_003 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mmap/tp_mmap_004 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mmap/tp_mmap_005 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mmap/tp_mmap_006 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mmap/tp_mmap_007 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mmap/tp_mmap_008 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mmap/tp_mmap_009 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mmap/tp_mmap_010 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_001 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_002 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_003 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_004 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_005 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_006 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_007 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/xattr/tp_xattr_001 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/xattr/tp_xattr_002 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/xattr/tp_xattr_003 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/xattr/tp_xattr_004 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/xattr/tp_xattr_005 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/xattr/tp_xattr_006 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/xattr/tp_xattr_007 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/xattr/tp_xattr_008 mode=0555
+file path=opt/smbclient-tests/tests/smbfs/xattr/tp_xattr_009 mode=0555
+file path=opt/smbclient-tests/tests/smbmount/tp_smbmount_001 mode=0555
+file path=opt/smbclient-tests/tests/smbmount/tp_smbmount_002 mode=0555
+file path=opt/smbclient-tests/tests/smbmount/tp_smbmount_003 mode=0555
+file path=opt/smbclient-tests/tests/smbmount/tp_smbmount_004 mode=0555
+file path=opt/smbclient-tests/tests/smbmount/tp_smbmount_005 mode=0555
+file path=opt/smbclient-tests/tests/smbmount/tp_smbmount_006 mode=0555
+file path=opt/smbclient-tests/tests/smbmount/tp_smbmount_007 mode=0555
+file path=opt/smbclient-tests/tests/smbmount/tp_smbmount_008 mode=0555
+file path=opt/smbclient-tests/tests/smbmount/tp_smbmount_009 mode=0555
+file path=opt/smbclient-tests/tests/smbmount/tp_smbmount_010 mode=0555
+file path=opt/smbclient-tests/tests/smbmount/tp_smbmount_011 mode=0555
+file path=opt/smbclient-tests/tests/smbmount/tp_smbmount_012 mode=0555
+file path=opt/smbclient-tests/tests/smbmount/tp_smbmount_013 mode=0555
+file path=opt/smbclient-tests/tests/smbmount/tp_smbmount_014 mode=0555
+file path=opt/smbclient-tests/tests/smbmount/tp_smbmount_015 mode=0555
+file path=opt/smbclient-tests/tests/smbmount/tp_smbmount_016 mode=0555
+file path=opt/smbclient-tests/tests/smbutil/tp_smbutil_001 mode=0555
+file path=opt/smbclient-tests/tests/smbutil/tp_smbutil_002 mode=0555
+file path=opt/smbclient-tests/tests/smbutil/tp_smbutil_003 mode=0555
+file path=opt/smbclient-tests/tests/smbutil/tp_smbutil_004 mode=0555
+file path=opt/smbclient-tests/tests/smbutil/tp_smbutil_005 mode=0555
+file path=opt/smbclient-tests/tests/smbutil/tp_smbutil_006 mode=0555
+file path=opt/smbclient-tests/tests/smbutil/tp_smbutil_007 mode=0555
+file path=opt/smbclient-tests/tests/smbutil/tp_smbutil_008 mode=0555
+file path=opt/smbclient-tests/tests/smbutil/tp_smbutil_009 mode=0555
+file path=opt/smbclient-tests/tests/smbutil/tp_smbutil_010 mode=0555
+file path=opt/smbclient-tests/tests/smbutil/tp_smbutil_011 mode=0555
+file path=opt/smbclient-tests/tests/smbutil/tp_smbutil_012 mode=0555
+file path=opt/smbclient-tests/tests/smbutil/tp_smbutil_013 mode=0555
+file path=opt/smbclient-tests/tests/smbutil/tp_smbutil_014 mode=0555
+file path=opt/smbclient-tests/tests/smbutil/tp_smbutil_015 mode=0555
+file path=opt/smbclient-tests/tests/smbutil/tp_smbutil_016 mode=0555
+license cr_Sun license=cr_Sun
+license lic_CDDL license=lic_CDDL
+depend fmri=shell/expect type=require
+depend fmri=system/test/testrunner type=require
diff --git a/usr/src/pkg/manifests/system-test-testrunner.mf b/usr/src/pkg/manifests/system-test-testrunner.mf
index b6fbfb6..2043b84 100644
--- a/usr/src/pkg/manifests/system-test-testrunner.mf
+++ b/usr/src/pkg/manifests/system-test-testrunner.mf
@@ -29,8 +29,11 @@
 dir path=opt/test-runner/stf/include
 file path=opt/test-runner/bin/run mode=0555
 file path=opt/test-runner/man/man1/run.1 mode=0444
+file path=opt/test-runner/stf/contrib/include/ctiutils.shlib mode=0555
 file path=opt/test-runner/stf/contrib/include/logapi.shlib mode=0555
 file path=opt/test-runner/stf/include/stf.shlib mode=0555
 license cr_Sun license=cr_Sun
 license lic_CDDL license=lic_CDDL
+license usr/src/test/test-runner/stf/contrib/LICENSE.Artistic \
+    license=usr/src/test/test-runner/stf/contrib/LICENSE.Artistic
 depend fmri=security/sudo type=require
diff --git a/usr/src/test/Makefile b/usr/src/test/Makefile
index fdc5abc..9ca989c 100644
--- a/usr/src/test/Makefile
+++ b/usr/src/test/Makefile
@@ -16,6 +16,7 @@
 
 .PARALLEL: $(SUBDIRS)
 
-SUBDIRS = libc-tests crypto-tests os-tests test-runner util-tests zfs-tests
+SUBDIRS = libc-tests crypto-tests os-tests test-runner util-tests zfs-tests \
+	smbclient-tests
 
 include Makefile.com
diff --git a/usr/src/test/smbclient-tests/Makefile b/usr/src/test/smbclient-tests/Makefile
new file mode 100644
index 0000000..e677b96
--- /dev/null
+++ b/usr/src/test/smbclient-tests/Makefile
@@ -0,0 +1,25 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+.PARALLEL:	$(SUBDIRS)
+
+SUBDIRS=	cmd	\
+		config	\
+		doc	\
+		include	\
+		runfiles \
+		tests
+
+include		$(SRC)/test/Makefile.com
diff --git a/usr/src/test/smbclient-tests/Makefile.com b/usr/src/test/smbclient-tests/Makefile.com
new file mode 100644
index 0000000..c1c21d7
--- /dev/null
+++ b/usr/src/test/smbclient-tests/Makefile.com
@@ -0,0 +1,19 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+ROOTOPTPKG=	$(ROOT)/opt/smbclient-tests
+ROOTBINDIR=	$(ROOTOPTPKG)/bin
+ROOTCONFDIR=	$(ROOTOPTPKG)/config
+ROOTINCDIR=	$(ROOTOPTPKG)/include
diff --git a/usr/src/test/smbclient-tests/cmd/Makefile b/usr/src/test/smbclient-tests/cmd/Makefile
new file mode 100644
index 0000000..2363214
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/Makefile
@@ -0,0 +1,28 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+.PARALLEL:	$(SUBDIRS)
+
+SUBDIRS=	abort_conn	\
+		close_wr	\
+		cp_mmap		\
+		file_trunc	\
+		mkfile_mmap	\
+		no_close	\
+		prot_mmap	\
+		rw_mmap		\
+		scripts
+
+include		$(SRC)/test/Makefile.com
diff --git a/usr/src/test/smbclient-tests/cmd/Makefile.cmd b/usr/src/test/smbclient-tests/cmd/Makefile.cmd
new file mode 100644
index 0000000..13fd47c
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/Makefile.cmd
@@ -0,0 +1,56 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/test/Makefile.com
+
+OBJS=		$(PROG:%=%.o)
+SRCS=		$(OBJS:%.o=%.c)
+
+ROOTPROG=	$(PROG:%=$(ROOTBINDIR)/%)
+$(ROOTPROG) :=	FILEMODE = 0555
+
+CPPFLAGS +=	-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+
+LINTFLAGS +=	-erroff=E_BAD_FORMAT_STR2
+LINTFLAGS +=	-erroff=E_NAME_DECL_NOT_USED_DEF2
+LINTFLAGS +=	-erroff=E_FUNC_RET_ALWAYS_IGNOR2
+
+all:		$(PROG)
+
+$(PROG):	$(OBJS)
+		$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
+		$(POST_PROCESS)
+
+%.o:		%.c
+		$(COMPILE.c) $<
+		$(POST_PROCESS_O)
+
+install:	all $(ROOTPROG)
+
+lint:		lint_SRCS
+
+clobber:	clean
+		-$(RM) $(PROG)
+
+clean:
+		-$(RM) $(OBJS)
+
+$(ROOTPROG):	$(ROOTBINDIR) $(PROG)
+
+$(ROOTBINDIR):
+		$(INS.dir)
+
+$(ROOTBINDIR)/%: %
+		$(INS.file)
diff --git a/usr/src/test/smbclient-tests/cmd/abort_conn/Makefile b/usr/src/test/smbclient-tests/cmd/abort_conn/Makefile
new file mode 100644
index 0000000..da3342f
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/abort_conn/Makefile
@@ -0,0 +1,22 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/cmd/Makefile.cmd
+include		../../Makefile.com
+
+PROG=		abort_conn
+LDLIBS +=	-lsocket
+
+include		../Makefile.cmd
diff --git a/usr/src/test/smbclient-tests/cmd/abort_conn/abort_conn.c b/usr/src/test/smbclient-tests/cmd/abort_conn/abort_conn.c
new file mode 100644
index 0000000..0213e32
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/abort_conn/abort_conn.c
@@ -0,0 +1,146 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+ */
+
+/*
+ * Test helper to abort TCP connections to some server;
+ * either all of the, or those to a specified port.
+ */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/stropts.h>
+
+#include <inet/tcp.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <netdb.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <zone.h>
+
+/*
+ * Abort all connections to the passed address.
+ */
+static void
+tcp_abort_connections(struct sockaddr *rsa)
+{
+	tcp_ioc_abort_conn_t conn;
+	struct strioctl ioc;
+	struct sockaddr *lsa;
+	int fd;
+
+	(void) memset(&conn, 0, sizeof (conn));
+	lsa = (void *)&conn.ac_local;
+	lsa->sa_family = rsa->sa_family;
+	(void) memcpy(&conn.ac_remote, rsa, sizeof (*rsa));
+	conn.ac_start = TCPS_SYN_SENT;
+	conn.ac_end = TCPS_CLOSE_WAIT;
+	conn.ac_zoneid = ALL_ZONES;
+
+	ioc.ic_cmd = TCP_IOC_ABORT_CONN;
+	ioc.ic_timout = -1; /* infinite timeout */
+	ioc.ic_len = sizeof (conn);
+	ioc.ic_dp = (char *)&conn;
+
+	if ((fd = open("/dev/tcp", O_RDONLY)) < 0) {
+		(void) fprintf(stderr, "unable to open %s", "/dev/tcp");
+		return;
+	}
+
+	if (ioctl(fd, I_STR, &ioc) < 0)
+		if (errno != ENOENT)	/* ENOENT is not an error */
+			perror("ioctl");
+
+	(void) close(fd);
+}
+
+static void
+usage(char *arg0)
+{
+	(void) fprintf(stderr, "usage: %s [-p <PORT>] <ADDR>\n", arg0);
+	exit(1);
+}
+
+int
+main(int argc, char **argv)
+{
+	extern char *optarg;
+	extern int optind, optopt;
+	struct addrinfo hints, *res, *ai;
+	char *addr_str = NULL;
+	char *port_str = NULL;
+	int errflag = 0;
+	int c, gaierr;
+
+	while ((c = getopt(argc, argv, "p:")) != -1) {
+		switch (c) {
+		case 'p':
+			port_str = optarg;
+			break;
+		case ':':
+			(void) fprintf(stderr,
+			    "Option -%c requires an operand\n", optopt);
+			errflag++;
+			break;
+		case '?':
+			(void) fprintf(stderr,
+			    "Unrecognized option: -%c\n", optopt);
+			errflag++;
+			break;
+		}
+	}
+	if (errflag)
+		usage(argv[0]);
+	if (argc <= optind) {
+		(void) fprintf(stderr, "No address specified\n");
+		usage(argv[0]);
+	}
+	addr_str = argv[optind];
+
+	/*
+	 * Lookup the IP address
+	 */
+	(void) memset(&hints, 0, sizeof (hints));
+	hints.ai_family = PF_UNSPEC;
+	hints.ai_socktype = SOCK_STREAM;
+	gaierr = getaddrinfo(addr_str, port_str, &hints, &res);
+	if (gaierr != 0) {
+		(void) fprintf(stderr, "%s: %s\n", addr_str,
+		    gai_strerror(gaierr));
+		return (1);
+	}
+
+	for (ai = res; ai != NULL; ai = ai->ai_next) {
+		tcp_abort_connections(ai->ai_addr);
+	}
+
+	return (0);
+}
diff --git a/usr/src/test/smbclient-tests/cmd/close_wr/Makefile b/usr/src/test/smbclient-tests/cmd/close_wr/Makefile
new file mode 100644
index 0000000..7c18063
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/close_wr/Makefile
@@ -0,0 +1,21 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/cmd/Makefile.cmd
+include		../../Makefile.com
+
+PROG=		close_wr
+
+include		../Makefile.cmd
diff --git a/usr/src/test/smbclient-tests/cmd/close_wr/close_wr.c b/usr/src/test/smbclient-tests/cmd/close_wr/close_wr.c
new file mode 100644
index 0000000..dbe00f6
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/close_wr/close_wr.c
@@ -0,0 +1,107 @@
+/*
+ * 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 2012 Jilin Xpd <jilinxpd@gmail.com>
+ * Copyright 2018 Nexenta Systems, Inc.
+ */
+
+/*
+ * After close file but before munmap it, test if we can still write into
+ * mapped pages and the dirty pages are eventually synced to file,
+ * the result should be that we can do it as long as we dont munmap it.
+ * When userland attempts to close mapped file, smbfs will keep SMB FID
+ * alive if there are mapped pages(not unmapped yet), so the otW will stay
+ * open until last ref. to vnode goes away.
+ * This program tests if smbfs works as we said.
+ */
+
+#include <sys/mman.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+
+int
+main(int argc, char **argv)
+{
+	char *file_addr;
+	char *p;
+	size_t filesize;
+	size_t blksize;
+	int fid;
+	int i;
+	char *c = "?#*%&";
+
+	if (argc != 2) {
+		fprintf(stderr, "\tusage:\n\tclose_wr <filename>\n");
+		return (1);
+	}
+
+	/* open test file */
+	fid = open(argv[1], O_RDWR | O_CREAT | O_TRUNC,
+	    S_IRUSR | S_IWUSR | S_IROTH | S_IWOTH);
+	if (fid == -1) {
+		fprintf(stderr, "open %s error=%d\n", argv[1], errno);
+		return (1);
+	}
+
+	/* extend file */
+	filesize = 64 * 1024;
+	if (ftruncate(fid, filesize) == -1) {
+		fprintf(stderr, "ftrunc %s error=%d\n", argv[1], errno);
+		return (1);
+	}
+
+	/* map file */
+	file_addr = mmap(NULL, filesize,
+	    PROT_READ | PROT_WRITE, MAP_SHARED, fid, 0);
+	if (file_addr == MAP_FAILED) {
+		fprintf(stderr, "mmap %s error=%d\n", argv[1], errno);
+		return (1);
+	}
+
+	/* erase file */
+	memset(file_addr, 0, filesize);
+
+	/* close file here! */
+	if (close(fid) == -1) {
+		fprintf(stderr, "close %s error=%d\n", argv[1], errno);
+		return (1);
+	}
+
+	/*
+	 * write somthing into mapped addr after close file,
+	 * it should be ok before munmap
+	 */
+	blksize = filesize / 4;
+	for (i = 0, p = file_addr; i < 4; i++, p += blksize) {
+		memset(p, c[i], blksize);
+	}
+
+	/* sync pages to file */
+	if (msync(file_addr, filesize, MS_SYNC) == -1) {
+		fprintf(stderr, "msync %s error=%d\n", argv[1], errno);
+		return (1);
+	}
+
+	/* unmap file */
+	if (munmap(file_addr, filesize) == -1) {
+		fprintf(stderr, "munmap %s error=%d\n", argv[1], errno);
+		return (1);
+	}
+
+	return (0);
+}
diff --git a/usr/src/test/smbclient-tests/cmd/cp_mmap/Makefile b/usr/src/test/smbclient-tests/cmd/cp_mmap/Makefile
new file mode 100644
index 0000000..18369e7
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/cp_mmap/Makefile
@@ -0,0 +1,21 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/cmd/Makefile.cmd
+include		../../Makefile.com
+
+PROG=		cp_mmap
+
+include		../Makefile.cmd
diff --git a/usr/src/test/smbclient-tests/cmd/cp_mmap/cp_mmap.c b/usr/src/test/smbclient-tests/cmd/cp_mmap/cp_mmap.c
new file mode 100644
index 0000000..9ac1ff6
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/cp_mmap/cp_mmap.c
@@ -0,0 +1,194 @@
+/*
+ * 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 2012 Jilin Xpd <jilinxpd@gmail.com>
+ * Copyright 2018 Nexenta Systems, Inc.
+ */
+
+/*
+ * Copy a file from src to dest, using mmap to copy the data,
+ * with either contiguous or discontiguous mappings.
+ * (Jilin calls discontiguous "discrete" below.)
+ */
+
+#include <sys/mman.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <limits.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+
+void
+usage(void)
+{
+	fprintf(stderr,
+	    "usage: cp_mmap -t {d|c} -f <srcfile> <desfile>\n");
+	exit(1);
+}
+
+int
+main(int argc, char **argv)
+{
+	struct stat sb;
+	char *src_addr, *des_addr;
+	char *src_file = NULL, *des_file = NULL;
+	off_t offset;
+	size_t filesize;
+	size_t blksize;
+	size_t pagesize;
+	size_t len;
+	size_t numblks;
+	int src_fid, des_fid;
+	int mret = 0;
+	size_t i;
+	size_t stride;
+	boolean_t discrete = B_FALSE; /* discontiguous mappings */
+
+	/*
+	 * parse arguments
+	 * Not getopt because -f has two optargs
+	 */
+	if (argc != 6)
+		usage();
+
+	for (i = 1; i < argc; ) {
+		switch (argv[i][1]) {
+		case 't': /* copy type */
+			i++;
+			discrete = (argv[i][0] == 'd');
+			i++;
+			break;
+		case 'f': /* src file and des file */
+			i++;
+			src_file = argv[i];
+			i++;
+			des_file = argv[i];
+			i++;
+			break;
+		default:
+			usage();
+			break;
+		}
+	}
+
+	pagesize = sysconf(_SC_PAGESIZE); /* mmap one page each time */
+	if (pagesize < 4096) {
+		fprintf(stderr, "sysconf error=%d\n", errno);
+		return (1);
+	}
+	if (discrete) {
+		/*
+		 * Use discontiguous mappings, and only mmap
+		 * one page each time
+		 */
+		blksize = pagesize;
+		stride = 3;
+	} else {
+		/* will do contiguous mmap */
+		blksize = 64 * 1024 * 1024; /* mmap a block each time */
+		stride = 1;
+	}
+
+	/* source file */
+	src_fid = open(src_file, O_RDONLY);
+	if (src_fid == -1) {
+		fprintf(stderr, "open %s error=%d\n", src_file, errno);
+		return (1);
+	}
+	/* destination file */
+	des_fid = open(des_file, O_RDWR | O_CREAT | O_TRUNC,
+	    S_IRUSR | S_IWUSR | S_IROTH | S_IWOTH);
+	if (des_fid == -1) {
+		fprintf(stderr, "open %s error=%d\n", des_file, errno);
+		mret = 1;
+		goto exit3;
+	}
+
+	/* get src file size */
+	if (fstat(src_fid, &sb) == -1) {
+		fprintf(stderr, "fstat %s error=%d\n", src_file, errno);
+		mret = 1;
+		goto exit2;
+	}
+	filesize = sb.st_size;
+	if (filesize < pagesize) {
+		fprintf(stderr, "src file size < %d\n", (int)pagesize);
+		mret = 1;
+		goto exit2;
+	}
+
+	/* extend des file */
+	if (ftruncate(des_fid, filesize) == -1) {
+		fprintf(stderr, "ftrunc %s error=%d\n", des_file, errno);
+		mret = 1;
+		goto exit2;
+	}
+
+	/* copy data */
+	numblks = (filesize + blksize - 1) / blksize;
+	for (i = 0; i < stride * numblks && mret == 0; i += stride) {
+
+		offset = (i % numblks) * blksize;
+		if (offset + blksize > filesize)
+			len = filesize - offset;
+		else
+			len = blksize;
+
+		/* map file */
+		src_addr = mmap(NULL, len, PROT_READ, MAP_SHARED,
+		    src_fid, offset);
+		if (src_addr == MAP_FAILED) {
+			fprintf(stderr, "mmap %s error=%d\n", src_file, errno);
+			mret = 1;
+			break;
+		}
+		des_addr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED,
+		    des_fid, offset);
+		if (des_addr == MAP_FAILED) {
+			fprintf(stderr, "mmap %s error=%d\n", des_file, errno);
+			mret = 1;
+			goto exit1;
+		}
+
+		/* cp data from src addr to des addr */
+		memcpy(des_addr, src_addr, len);
+		/* sync mapped pages to file */
+		if (msync(des_addr, len, MS_SYNC) == -1) {
+			fprintf(stderr, "msync %s error=%d\n", des_file, errno);
+			mret = 1;
+		}
+
+		/* unmap file */
+		if (munmap(des_addr, len) == -1) {
+			fprintf(stderr, "munmap %s error=%d\n",
+			    des_file, errno);
+			mret = 1;
+		}
+	exit1:
+		if (munmap(src_addr, len) == -1) {
+			fprintf(stderr, "munmap %s error=%d\n",
+			    src_file, errno);
+			mret = 1;
+		}
+	}
+
+exit2:
+	close(des_fid);
+exit3:
+	close(src_fid);
+
+	return (mret);
+}
diff --git a/usr/src/test/smbclient-tests/cmd/file_trunc/Makefile b/usr/src/test/smbclient-tests/cmd/file_trunc/Makefile
new file mode 100644
index 0000000..4f82770
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/file_trunc/Makefile
@@ -0,0 +1,21 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/cmd/Makefile.cmd
+include		../../Makefile.com
+
+PROG=		file_trunc
+
+include		../Makefile.cmd
diff --git a/usr/src/test/smbclient-tests/cmd/file_trunc/file_trunc.c b/usr/src/test/smbclient-tests/cmd/file_trunc/file_trunc.c
new file mode 100644
index 0000000..3e6bd8a
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/file_trunc/file_trunc.c
@@ -0,0 +1,238 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <limits.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/fcntl.h>
+#include <sys/stat.h>
+#include <sys/statvfs.h>
+#include <sys/errno.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <sys/wait.h>
+#include <sys/param.h>
+#include <string.h>
+
+#define	FSIZE	256*1024*1024
+#define	BSIZE	512
+
+/* Initialize Globals */
+static long	fsize = FSIZE;
+static size_t	bsize = BSIZE;
+static int	count = 0;
+static int	rflag = 0;
+static int	seed = 0;
+static int	vflag = 0;
+static int	errflag = 0;
+static off_t	offset = 0;
+static char	*filename = NULL;
+
+static void usage(char *execname);
+static void parse_options(int argc, char *argv[]);
+static void do_write(int fd);
+static void do_trunc(int fd);
+
+static void
+usage(char *execname)
+{
+	(void) fprintf(stderr,
+	    "usage: %s [-b blocksize] [-c count] [-f filesize]"
+	    " [-o offset] [-s seed] [-r] [-v] filename\n", execname);
+	(void) exit(1);
+}
+
+int
+main(int argc, char *argv[])
+{
+	int i = 0;
+	int fd = -1;
+
+	parse_options(argc, argv);
+
+	fd = open(filename, O_RDWR|O_CREAT|O_TRUNC, 0666);
+	if (fd < 0) {
+		perror("open");
+		exit(3);
+	}
+
+	while (i < count) {
+		(void) do_write(fd);
+		(void) do_trunc(fd);
+
+		i++;
+	}
+
+	(void) close(fd);
+	return (0);
+}
+
+static void
+parse_options(int argc, char *argv[])
+{
+	int c;
+
+	extern char *optarg;
+	extern int optind, optopt;
+
+	count = fsize / bsize;
+	seed = time(NULL);
+	while ((c = getopt(argc, argv, "b:c:f:o:rs:v")) != -1) {
+		switch (c) {
+			case 'b':
+				bsize = atoi(optarg);
+				break;
+
+			case 'c':
+				count = atoi(optarg);
+				break;
+
+			case 'f':
+				fsize = atoi(optarg);
+				break;
+
+			case 'o':
+				offset = atoi(optarg);
+				break;
+
+			case 'r':
+				rflag++;
+				break;
+
+			case 's':
+				seed = atoi(optarg);
+				break;
+
+			case 'v':
+				vflag++;
+				break;
+
+			case ':':
+				(void) fprintf(stderr,
+				    "Option -%c requires an operand\n", optopt);
+				errflag++;
+				break;
+
+			case '?':
+				(void) fprintf(stderr,
+				    "Unrecognized option: -%c\n", optopt);
+				errflag++;
+				break;
+		}
+
+		if (errflag) {
+			(void) usage(argv[0]);
+		}
+	}
+	if (argc <= optind) {
+		(void) fprintf(stderr,
+		    "No filename specified\n");
+		usage(argv[0]);
+	}
+	filename = argv[optind];
+
+	if (vflag) {
+		(void) fprintf(stderr, "Seed = %d\n", seed);
+	}
+	srandom(seed);
+}
+
+static void
+do_write(int fd)
+{
+	off_t	roffset = 0;
+	char	*buf = NULL;
+	char	*rbuf = NULL;
+
+	buf = (char *)calloc(1, bsize);
+	rbuf = (char *)calloc(1, bsize);
+	if (buf == NULL || rbuf == NULL) {
+		perror("malloc");
+		exit(4);
+	}
+
+	roffset = random() % fsize;
+	if (lseek64(fd, (offset + roffset), SEEK_SET) < 0) {
+		perror("lseek");
+		exit(5);
+	}
+
+	buf = "SMBFS Test Suite Truncation Test";
+	if (write(fd, buf, bsize) < bsize) {
+		perror("write");
+		exit(6);
+	}
+
+	if (rflag) {
+		if (lseek64(fd, (offset + roffset), SEEK_SET) < 0) {
+			perror("lseek");
+			exit(7);
+		}
+
+		if (read(fd, rbuf, bsize) < bsize) {
+			perror("read");
+			exit(8);
+		}
+
+		if (memcmp(buf, rbuf, bsize) != 0) {
+			perror("memcmp");
+			exit(9);
+		}
+	}
+	if (vflag) {
+		(void) fprintf(stderr,
+		    "Wrote to offset %jd\n", (intmax_t)(offset + roffset));
+		if (rflag) {
+			(void) fprintf(stderr,
+			    "Read back from offset %jd\n",
+			    (intmax_t)(offset + roffset));
+		}
+	}
+
+	(void) free(buf);
+	(void) free(rbuf);
+}
+
+static void
+do_trunc(int fd)
+{
+	off_t   roffset = 0;
+
+	roffset = random() % fsize;
+	if (ftruncate64(fd, (offset + roffset))  < 0) {
+		perror("truncate");
+		exit(7);
+	}
+
+	if (vflag) {
+		(void) fprintf(stderr,
+		    "Truncated at offset %jd\n",
+		    (intmax_t)(offset + roffset));
+	}
+}
diff --git a/usr/src/test/smbclient-tests/cmd/mkfile_mmap/Makefile b/usr/src/test/smbclient-tests/cmd/mkfile_mmap/Makefile
new file mode 100644
index 0000000..928f625
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/mkfile_mmap/Makefile
@@ -0,0 +1,21 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/cmd/Makefile.cmd
+include		../../Makefile.com
+
+PROG=		mkfile_mmap
+
+include		../Makefile.cmd
diff --git a/usr/src/test/smbclient-tests/cmd/mkfile_mmap/mkfile_mmap.c b/usr/src/test/smbclient-tests/cmd/mkfile_mmap/mkfile_mmap.c
new file mode 100644
index 0000000..b11a55c
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/mkfile_mmap/mkfile_mmap.c
@@ -0,0 +1,175 @@
+/*
+ * 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 2012 Jilin Xpd <jilinxpd@gmail.com>
+ * Copyright 2018 Nexenta Systems, Inc.
+ */
+
+/*
+ * Using mmap, make a file and padding it with random chars.
+ */
+
+#include <sys/mman.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <time.h>
+
+void
+usage(void)
+{
+	fprintf(stderr,
+	    "usage: mkfile_mmap -n <size>[b|k|m|g] -f <filename>\n");
+	exit(1);
+}
+
+int
+main(int argc, char **argv)
+{
+	char *suffix;
+	char *filename = NULL;
+	char *file_addr;
+	char *p, *q;
+	off_t offset;
+	size_t filesize;
+	size_t blksize;
+	size_t numblks;
+	size_t cnt = 1;
+	size_t mul = 1;
+	size_t i;
+	int mret = 0;
+	int c, fid;
+
+	/*
+	 * parse arguments
+	 */
+	while ((c = getopt(argc, argv, "n:f:")) != -1) {
+		switch (c) {
+		case 'n':
+			cnt = (size_t)strtoul(optarg, &suffix, 0);
+			if (cnt == 0)
+				goto bad_n_arg;
+			switch (*suffix) {
+			case '\0':
+			case 'b':
+				mul = 1;
+				break;
+			case 'k':
+				mul = 1024;
+				break;
+			case 'm':
+				mul = (1024 * 1024);
+				break;
+			case 'g':
+				mul = (1024 * 1024 * 1024);
+				break;
+			default:
+			bad_n_arg:
+				fprintf(stderr, "-n %s: invalid size\n",
+				    optarg);
+				return (1);
+			}
+			cnt = cnt * mul;
+			break;
+
+		case 'f': /* target file */
+			filename = optarg;
+			break;
+
+		case ':':   /* missing optarg */
+			fprintf(stderr,
+			    "Option -%c requires an arg\n", optopt);
+			usage();
+			break;
+		case '?':
+			fprintf(stderr,
+			    "Unrecognized option: -%c\n", optopt);
+			usage();
+			break;
+		}
+	}
+
+	/* open test file */
+	fid = open(filename, O_RDWR | O_CREAT | O_TRUNC,
+	    S_IRUSR | S_IWUSR | S_IROTH | S_IWOTH);
+	if (fid == -1) {
+		fprintf(stderr, "open %s error=%d\n", filename, errno);
+		mret = 1;
+		goto exit3;
+	}
+
+	/* extend file */
+	filesize = cnt;
+	if (ftruncate(fid, filesize) == -1) {
+		fprintf(stderr, "ftrunc %s error=%d\n", filename, errno);
+		mret = 1;
+		goto exit2;
+	}
+
+#define	K 1024
+
+	blksize = 64 * K * K;
+	numblks = (filesize + blksize - 1) / blksize;
+	for (i = 0; i < numblks && mret == 0; i++) {
+
+		offset = i*blksize;
+		if (offset + blksize > filesize)
+			blksize = filesize - offset;
+
+		/* map file */
+		file_addr = mmap(NULL, blksize,
+		    PROT_READ | PROT_WRITE, MAP_SHARED, fid, offset);
+		if (file_addr == MAP_FAILED) {
+			fprintf(stderr, "mmap %s error=%d\n", filename, errno);
+			mret = 1;
+			break;
+		}
+
+	/* tag each block (to aid debug) */
+	p = file_addr;
+	q = file_addr + blksize - K;
+	memset(p, ' ', K);
+	snprintf(p, K, "\nblk=%d\n\n", i);
+	p += K;
+
+		/* fill something into mapped addr */
+	while (p < q) {
+		memset(p, ' ', K);
+		snprintf(p, K, "\noff=0x%x\n\n",
+		    (i * blksize) + (p - file_addr));
+		p += K;
+	}
+
+		/* sync mapped pages to file */
+		if (msync(file_addr, blksize, MS_SYNC) == -1) {
+			fprintf(stderr, "msync %s error=%d\n", filename, errno);
+			mret = 1;
+		}
+
+		/* unmap file */
+		if (munmap(file_addr, blksize) == -1) {
+			fprintf(stderr, "unmap %s error=%d\n", filename, errno);
+			mret = 1;
+		}
+	}
+
+	/* close file */
+exit2:
+	close(fid);
+exit3:
+	return (mret);
+}
diff --git a/usr/src/test/smbclient-tests/cmd/no_close/Makefile b/usr/src/test/smbclient-tests/cmd/no_close/Makefile
new file mode 100644
index 0000000..907b2fe
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/no_close/Makefile
@@ -0,0 +1,21 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/cmd/Makefile.cmd
+include		../../Makefile.com
+
+PROG=		no_close
+
+include		../Makefile.cmd
diff --git a/usr/src/test/smbclient-tests/cmd/no_close/no_close.c b/usr/src/test/smbclient-tests/cmd/no_close/no_close.c
new file mode 100644
index 0000000..8a780c3
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/no_close/no_close.c
@@ -0,0 +1,84 @@
+/*
+ * 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 2012 Jilin Xpd <jilinxpd@gmail.com>
+ * Copyright 2018 Nexenta Systems, Inc.
+ */
+
+/*
+ * It doesn't matter if the userland forgets to close the file or
+ * munmap it, because smbfs will help close it(including otW close)
+ * and sync the dirty pages to the file.
+ * This program tests if smbfs works as we said.
+ */
+
+#include <sys/mman.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+
+int
+main(int argc, char **argv)
+{
+	char *file_addr;
+	off_t offset;
+	size_t filesize;
+	size_t blksize;
+	int fid;
+	int i;
+	char *c = "?#*%&";
+
+	if (argc != 2) {
+		fprintf(stderr, "\tusage:\n\tno_close <filename>\n");
+		return (1);
+	}
+
+	/* open test file */
+	fid = open(argv[1], O_RDWR | O_CREAT | O_TRUNC,
+	    S_IRUSR | S_IWUSR | S_IROTH | S_IWOTH);
+	if (fid == -1) {
+		fprintf(stderr, "open %s error=%d\n", argv[1], errno);
+		return (1);
+	}
+
+	/* extend file */
+	filesize = 64 * 1024;
+	if (ftruncate(fid, filesize) == -1) {
+		fprintf(stderr, "ftrunc %s error=%d\n", argv[1], errno);
+		return (1);
+	}
+
+	/* map file */
+	file_addr = mmap(NULL, filesize,
+	    PROT_READ | PROT_WRITE, MAP_SHARED, fid, 0);
+	if (file_addr == MAP_FAILED) {
+		fprintf(stderr, "mmap %s error=%d\n", argv[1], errno);
+		return (1);
+	}
+
+	/* write something into mapped addr */
+	blksize = filesize / 4;
+	for (i = 0, offset = 0; i < 4; i++, offset += blksize) {
+		memset(file_addr + offset, c[i], blksize);
+	}
+	memset(file_addr + offset, c[i], filesize - offset);
+
+	/* no msync, munmap, close */
+
+	_exit(0);
+	/* NOTREACHED */
+}
diff --git a/usr/src/test/smbclient-tests/cmd/prot_mmap/Makefile b/usr/src/test/smbclient-tests/cmd/prot_mmap/Makefile
new file mode 100644
index 0000000..437a037
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/prot_mmap/Makefile
@@ -0,0 +1,21 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/cmd/Makefile.cmd
+include		../../Makefile.com
+
+PROG=		prot_mmap
+
+include		../Makefile.cmd
diff --git a/usr/src/test/smbclient-tests/cmd/prot_mmap/prot_mmap.c b/usr/src/test/smbclient-tests/cmd/prot_mmap/prot_mmap.c
new file mode 100644
index 0000000..20ff1f2
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/prot_mmap/prot_mmap.c
@@ -0,0 +1,216 @@
+/*
+ * 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 2012 Jilin Xpd <jilinxpd@gmail.com>
+ * Copyright 2018 Nexenta Systems, Inc.
+ */
+
+/*
+ * use mmap to copy data from src file to des file,
+ * with given flags and modes.
+ * the src & des file should exist and have the same size.
+ */
+
+#include <sys/mman.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+
+void
+usage(void)
+{
+	fprintf(stderr,
+	    "usage: "
+	    "prot_mmap -o <r|w> <r|w>"
+	    " -m <r|w|s|p> <r|w|s|p>"
+	    " -f <srcfile> <desfile>\n");
+	exit(1);
+}
+
+int
+main(int argc, char **argv)
+{
+	struct stat sb;
+	char *src_addr, *des_addr;
+	char *src_file = NULL, *des_file = NULL;
+	off_t offset;
+	size_t filesize;
+	size_t blksize;
+	size_t numblks;
+	size_t i, j;
+	int src_fid, des_fid;
+	int mret = 0;
+	int flags0 = 0, mflags0 = 0, prot0 = 0; /* flags for src file */
+	int flags1 = 0, mflags1 = 0, prot1 = 0; /* flags for des file */
+
+	/*
+	 * parse arguments
+	 * Not getopt because -o -m -f all have 2 optargs each.
+	 */
+	if (argc != 10) {
+		usage();
+	}
+	for (i = 1; i < argc; ) {
+		switch (argv[i][1]) {
+			case 'o': /* options for open() */
+				i++;
+				for (j = 0; argv[i][j]; j++) {
+					if (argv[i][j] == 'r')
+						flags0 |= O_RDONLY;
+					else if (argv[i][j] == 'w')
+						flags0 |= O_WRONLY;
+				}
+				if ((flags0 & (O_RDONLY | O_WRONLY)) ==
+				    (O_RDONLY | O_WRONLY))
+					flags0 = O_RDWR;
+				i++;
+				for (j = 0; argv[i][j]; j++) {
+					if (argv[i][j] == 'r')
+						flags1 |= O_RDONLY;
+					else if (argv[i][j] == 'w')
+						flags1 |= O_WRONLY;
+				}
+				if ((flags1 & (O_RDONLY | O_WRONLY)) ==
+				    (O_RDONLY | O_WRONLY))
+					flags1 = O_RDWR;
+				i++;
+				break;
+			case 'm': /* options for mmap() */
+				i++;
+				for (j = 0; argv[i][j]; j++) {
+					if (argv[i][j] == 'r')
+						prot0 |= PROT_READ;
+					else if (argv[i][j] == 'w')
+						prot0 |= PROT_WRITE;
+					else if (argv[i][j] == 's')
+						mflags0 |= MAP_SHARED;
+					else if (argv[i][j] == 'p')
+						mflags0 |= MAP_PRIVATE;
+				}
+				i++;
+				for (j = 0; argv[i][j]; j++) {
+					if (argv[i][j] == 'r')
+						prot1 |= PROT_READ;
+					else if (argv[i][j] == 'w')
+						prot1 |= PROT_WRITE;
+					else if (argv[i][j] == 's')
+						mflags1 |= MAP_SHARED;
+					else if (argv[i][j] == 'p')
+						mflags1 |= MAP_PRIVATE;
+				}
+				i++;
+				break;
+			case 'f': /* src file and des file */
+				i++;
+				src_file = argv[i];
+				i++;
+				des_file = argv[i];
+				i++;
+		}
+	}
+
+	/* source file */
+	src_fid = open(src_file, flags0);
+	if (src_fid == -1) {
+		fprintf(stderr, "open %s error=%d\n", src_file, errno);
+		return (1);
+	}
+	/* destination file */
+	des_fid = open(des_file, flags1);
+	if (des_fid == -1) {
+		fprintf(stderr, "open %s error=%d\n", des_file, errno);
+		mret = 1;
+		goto exit3;
+	}
+
+	/* get file size */
+	if (fstat(src_fid, &sb) == -1) {
+		fprintf(stderr, "fstat %s error=%d\n", src_file, errno);
+		mret = 1;
+		goto exit2;
+	}
+	filesize = sb.st_size;
+	if (filesize < 4096) {
+		fprintf(stderr, "file too small\n");
+		mret = 1;
+		goto exit2;
+	}
+
+	if (fstat(des_fid, &sb) == -1) {
+		fprintf(stderr, "fstat %s error=%d\n", des_file, errno);
+		mret = 1;
+		goto exit2;
+	}
+	if (filesize != sb.st_size) {
+		fprintf(stderr, "file sizes differ\n");
+		mret = 1;
+		goto exit2;
+	}
+
+	/* copy data */
+	blksize = 64 * 1024 * 1024;
+	numblks = (filesize + blksize - 1) / blksize;
+	for (i = 0; i < numblks && mret == 0; i++) {
+
+		offset = (i % numblks) * blksize;
+		if (offset + blksize > filesize)
+			blksize = filesize - offset;
+
+		/* map file */
+		src_addr = mmap(NULL, blksize, prot0, mflags0, src_fid, offset);
+		if (src_addr == MAP_FAILED) {
+			fprintf(stderr, "mmap %s error=%d\n", src_file, errno);
+			mret = 1;
+			break;
+		}
+		des_addr = mmap(NULL, blksize, prot1, mflags1, des_fid, offset);
+		if (des_addr == MAP_FAILED) {
+			fprintf(stderr, "mmap %s error=%d\n", des_file, errno);
+			mret = 1;
+			goto exit1;
+		}
+
+		/* cp data from src addr to des addr */
+		memcpy(des_addr, src_addr, blksize);
+		/* sync mapped pages to file */
+		if (msync(des_addr, blksize, MS_SYNC) == -1) {
+			fprintf(stderr, "msync %s error=%d\n", des_file, errno);
+			mret = 1;
+		}
+
+		/* unmap file */
+		if (munmap(des_addr, blksize) == -1) {
+			fprintf(stderr, "munmap %s error=%d\n",
+			    des_file, errno);
+			mret = 1;
+		}
+exit1:
+		if (munmap(src_addr, blksize) == -1) {
+			fprintf(stderr, "munmap %s error=%d\n",
+			    src_file, errno);
+			mret = 1;
+		}
+	}
+
+	/* close file */
+exit2:
+	close(des_fid);
+exit3:
+	close(src_fid);
+
+	return (mret);
+}
diff --git a/usr/src/test/smbclient-tests/cmd/rw_mmap/Makefile b/usr/src/test/smbclient-tests/cmd/rw_mmap/Makefile
new file mode 100644
index 0000000..4a4c198
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/rw_mmap/Makefile
@@ -0,0 +1,21 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/cmd/Makefile.cmd
+include		../../Makefile.com
+
+PROG=		rw_mmap
+
+include		../Makefile.cmd
diff --git a/usr/src/test/smbclient-tests/cmd/rw_mmap/rw_mmap.c b/usr/src/test/smbclient-tests/cmd/rw_mmap/rw_mmap.c
new file mode 100644
index 0000000..b83b0cf
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/rw_mmap/rw_mmap.c
@@ -0,0 +1,217 @@
+/*
+ * 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 2012 Jilin Xpd <jilinxpd@gmail.com>
+ * Copyright 2018 Nexenta Systems, Inc.
+ */
+
+/*
+ * Test if file read/write is coherent with mmap, perform 2 tests:
+ * modify file through mmap, and check the result through file read.
+ * modify file through file write, and check the result through mmap.
+ */
+
+#include <sys/mman.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+
+void
+usage(void)
+{
+	fprintf(stderr,
+	    "usage: rw_mmap -n <size>[b|k|m|g] -f <filename>\n");
+	exit(1);
+}
+
+int
+main(int argc, char **argv)
+{
+	char *suffix;
+	char *filename = NULL;
+	char *file_addr;
+	char *p;
+	size_t filesize;
+	ssize_t blksize;
+	size_t cnt = 1;
+	size_t mul = 1;
+	int c, fid;
+	char *buf;
+
+	/*
+	 * parse arguments
+	 */
+	while ((c = getopt(argc, argv, "n:f:")) != -1) {
+		switch (c) {
+		case 'n':
+			cnt = (size_t)strtoul(optarg, &suffix, 0);
+			if (cnt == 0)
+				goto bad_n_arg;
+			switch (*suffix) {
+			case '\0':
+			case 'b':
+				mul = 1;
+				break;
+			case 'k':
+				mul = 1024;
+				break;
+			case 'm':
+				mul = (1024 * 1024);
+				break;
+			case 'g':
+				mul = (1024 * 1024 * 1024);
+				break;
+			default:
+			bad_n_arg:
+				fprintf(stderr, "-n %s: invalid size\n",
+				    optarg);
+				return (1);
+			}
+			cnt = cnt * mul;
+			break;
+
+		case 'f': /* target file */
+			filename = optarg;
+			break;
+
+		case ':':   /* missing optarg */
+			fprintf(stderr,
+			    "Option -%c requires an arg\n", optopt);
+			usage();
+			break;
+		case '?':
+			fprintf(stderr,
+			    "Unrecognized option: -%c\n", optopt);
+			usage();
+			break;
+		}
+	}
+
+	/* open test file */
+	fid = open(filename, O_RDWR | O_CREAT | O_TRUNC,
+	    S_IRUSR | S_IWUSR | S_IROTH | S_IWOTH);
+	if (fid == -1) {
+		fprintf(stderr, "open %s error=%d\n", filename, errno);
+		return (1);
+	}
+
+	/* extend file */
+	filesize = cnt;
+	if (ftruncate(fid, filesize) == -1) {
+		fprintf(stderr, "ftrunc %s error=%d\n", filename, errno);
+		return (1);
+	}
+
+	/* map file */
+	file_addr = mmap(NULL, filesize,
+	    PROT_READ | PROT_WRITE, MAP_SHARED, fid, 0);
+	if (file_addr == MAP_FAILED) {
+		fprintf(stderr, "mmap %s error=%d\n", filename, errno);
+		return (1);
+	}
+
+	blksize = 4096;
+	buf = malloc(blksize);
+	if (buf == NULL) {
+		fprintf(stderr, "malloc failed\n");
+		return (1);
+	}
+
+	/* verify fread and mmap see the same data */
+	p = file_addr + 2013; /* not aligned to 4KB, on purpose */
+	lseek(fid, 2013, SEEK_SET);
+	while (p < file_addr + filesize) {
+		blksize = read(fid, buf, blksize);
+		if (blksize < 0) {
+			perror(filename);
+			return (1);
+		}
+		if (blksize == 0)
+			break;
+		if (memcmp(buf, p, blksize) != 0) {
+			fprintf(stderr, "memcmp failed 1\n");
+			return (1);
+		}
+		p += blksize;
+	}
+
+	/* modify file through mmap, verify fread can see the change */
+	blksize = 4096;
+	p = file_addr + 2013; /* not aligned to 4KB */
+	lseek(fid, 2013, SEEK_SET);
+	c = 'a';
+	while (p < file_addr + filesize) {
+		if (p + blksize > file_addr + filesize)
+			blksize = file_addr + filesize - p;
+		memset(p, c++, blksize);
+		blksize = read(fid, buf, blksize);
+		if (blksize < 0) {
+			perror(filename);
+			return (1);
+		}
+		if (blksize == 0)
+			break;
+		if (memcmp(buf, p, blksize) != 0) {
+			fprintf(stderr, "memcmp failed 2\n");
+			return (1);
+		}
+		p += blksize;
+	}
+
+	/* modify file through fwrite, verify mmap can see the change */
+	blksize = 4096;
+	p = file_addr + 2013; /* not aligned to 4KB */
+	lseek(fid, 2013, SEEK_SET);
+	c = 'Z';
+	while (p < file_addr + filesize) {
+		if (p + blksize > file_addr + filesize)
+			blksize = file_addr + filesize - p;
+		memset(buf, c--, blksize);
+		blksize = write(fid, buf, blksize);
+		if (blksize < 0) {
+			perror(filename);
+			return (1);
+		}
+		if (blksize == 0)
+			break;
+		if (memcmp(buf, p, blksize) != 0) {
+			fprintf(stderr, "memcmp failed 3\n");
+			return (1);
+		}
+		p += blksize;
+	}
+
+	/* sync pages to file */
+	if (msync(file_addr, filesize, MS_SYNC) == -1) {
+		fprintf(stderr, "msync %s error=%d\n", filename, errno);
+		return (1);
+	}
+
+	/* unmap file */
+	if (munmap(file_addr, filesize) == -1) {
+		fprintf(stderr, "munmap %s error=%d\n", filename, errno);
+		return (1);
+	}
+
+	/* close file */
+	if (close(fid) == -1) {
+		fprintf(stderr, "close %s error=%d\n", filename, errno);
+		return (1);
+	}
+
+	return (0);
+}
diff --git a/usr/src/test/smbclient-tests/cmd/scripts/Makefile b/usr/src/test/smbclient-tests/cmd/scripts/Makefile
new file mode 100644
index 0000000..cc019bf
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/scripts/Makefile
@@ -0,0 +1,40 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+include		../../Makefile.com
+
+PROGS=		passwd.exp	\
+		runone		\
+		smbclienttest	\
+		smbutil.exp
+
+ROOTPROGS=	$(PROGS:%=$(ROOTBINDIR)/%)
+$(ROOTPROGS) :=	FILEMODE = 0555
+
+all lint clean clobber:
+
+install:	$(ROOTPROGS)
+
+$(ROOTPROGS):	$(ROOTBINDIR)
+
+$(ROOTBINDIR):
+		$(INS.dir)
+
+$(ROOTBINDIR)/%: %
+		$(INS.file)
+
+$(ROOTBINDIR)/%: %.ksh
+		$(INS.rename)
diff --git a/usr/src/test/smbclient-tests/cmd/scripts/passwd.exp b/usr/src/test/smbclient-tests/cmd/scripts/passwd.exp
new file mode 100644
index 0000000..9c86b1a
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/scripts/passwd.exp
@@ -0,0 +1,70 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# NAME
+#       passwd.exp
+#
+# DESCRIPTION
+#       The Expect script will change the passwd of a user
+#
+
+
+set timeout 5
+set name [lindex $argv 0]
+set passwd [lindex $argv 1]
+
+spawn passwd  $name
+expect {
+	timeout {
+		send "\r"
+		send_error "\n passwd is time out\n"
+		exit 1
+	}
+
+	"User unknown:" {
+		send_error "\n User $name doesn't exist\n"
+		exit 1
+	}
+
+	"New Password" {
+		send "$passwd\r"
+		sleep 2
+		expect {
+			timeout {
+				send "\r"
+				send_error "\n passwd is time out\n"
+				exit 1
+			}
+			"Re-enter new Password:" {
+				send "$passwd\r"
+				sleep 2
+			}
+		}
+	}
+}
+
+send_user "\n"
+exit 0
diff --git a/usr/src/test/smbclient-tests/cmd/scripts/runone.ksh b/usr/src/test/smbclient-tests/cmd/scripts/runone.ksh
new file mode 100644
index 0000000..6cbc4a1
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/scripts/runone.ksh
@@ -0,0 +1,34 @@
+#!/usr/bin/ksh
+
+#
+# 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 2018 Nexenta Systems, Inc.  All rights reserved.
+#
+
+#
+# Simple script to run one test, for debug.  Usage:
+#  SRV=myserver runone smbfs/mmap/tp_mmap_005
+#
+# Note: creates/destroys temporary files in the CWD.
+
+export STF_SUITE="/opt/smbclient-tests"
+export STF_TOOLS="/opt/test-runner/stf"
+
+PATH=/usr/bin:/usr/sbin:/sbin:$STF_SUITE/bin:$PATH
+export PATH
+
+[[ -n "$SRV" ]] || { echo "$0 SRV=... required"; exit 1; }
+
+[[ -x $STF_SUITE/tests/$1 ]] && exec ksh -x $STF_SUITE/tests/$1
+exec ksh -x $1
+echo "$1: not found"
diff --git a/usr/src/test/smbclient-tests/cmd/scripts/smbclienttest.ksh b/usr/src/test/smbclient-tests/cmd/scripts/smbclienttest.ksh
new file mode 100644
index 0000000..68f3ce3
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/scripts/smbclienttest.ksh
@@ -0,0 +1,63 @@
+#!/usr/bin/ksh
+
+#
+# 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 (c) 2012 by Delphix. All rights reserved.
+#
+
+#
+# Define necessary environments and config variables here
+# prior to invoking the test runner
+#
+
+export STF_SUITE="/opt/smbclient-tests"
+export STF_TOOLS="/opt/test-runner/stf"
+runner="/opt/test-runner/bin/run"
+
+runfile=$STF_SUITE/runfiles/default.run
+
+PATH=/usr/bin:/usr/sbin:/sbin:$STF_SUITE/bin:$PATH
+export PATH
+
+while getopts 'c:fqs:' c; do
+	case $c in
+	'c')
+		runfile=$OPTARG
+		;;
+	'f')
+		export STC_QUICK=1
+		;;
+	'q')
+		quiet='-q'
+		;;
+	's')
+		export SRV=$OPTARG
+		;;
+	esac
+done
+shift $((OPTIND - 1))
+
+. $STF_SUITE/include/default_cfg.ksh
+
+[[ -n "$SRV" ]] || { echo "$0 -s SERVER required"; exit 1; }
+
+# Allow relative runfiles for convenience.
+if [[ ! -r "$runfile" && -r "$STF_SUITE/runfiles/$runfile" ]]
+then
+    runfile="$STF_SUITE/runfiles/$runfile"
+fi
+[[ -r $runfile ]] || { echo "$0 Cannot read file: $runfile"; exit 1; }
+
+$runner $quiet -c $runfile
+
+exit $?
diff --git a/usr/src/test/smbclient-tests/cmd/scripts/smbutil.exp b/usr/src/test/smbclient-tests/cmd/scripts/smbutil.exp
new file mode 100644
index 0000000..dd339db
--- /dev/null
+++ b/usr/src/test/smbclient-tests/cmd/scripts/smbutil.exp
@@ -0,0 +1,52 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# NAME
+#       smbutil.exp
+#
+# DESCRIPTION
+#       The Expect script will create the key chains by smbutil login
+#
+
+set timeout 5
+set name [lindex $argv 0]
+set passwd [lindex $argv 1]
+
+spawn smbutil login $name
+expect {
+	timeout {
+		send "\r"
+		send_error "\n passwd is time out\n"
+		exit 1
+	}
+	"Password for" {
+		send "$passwd\r"
+		sleep 2
+	}
+}
+
+send_user "\n"
+exit 0
diff --git a/usr/src/test/smbclient-tests/config/Makefile b/usr/src/test/smbclient-tests/config/Makefile
new file mode 100644
index 0000000..0c71f1b
--- /dev/null
+++ b/usr/src/test/smbclient-tests/config/Makefile
@@ -0,0 +1,40 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+include		../Makefile.com
+
+CONFS=	\
+		fileio.prof		\
+		filemacro.prof		\
+		filemicro.prof		\
+		generic.func		\
+		randomread.prof		\
+		seqread.prof
+
+ROOTCONFS=	$(CONFS:%=$(ROOTCONFDIR)/%)
+$(ROOTCONFS) :=	FILEMODE = 0444
+
+all lint clean clobber:
+
+install:	$(ROOTCONFS)
+
+$(ROOTCONFS):	$(ROOTCONFDIR)
+
+$(ROOTCONFDIR):
+		$(INS.dir)
+
+$(ROOTCONFDIR)/%: %
+		$(INS.file)
diff --git a/usr/src/test/smbclient-tests/config/fileio.prof b/usr/src/test/smbclient-tests/config/fileio.prof
new file mode 100644
index 0000000..3002a95
--- /dev/null
+++ b/usr/src/test/smbclient-tests/config/fileio.prof
@@ -0,0 +1,124 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+#
+
+DEFAULTS {
+	runtime = 120;
+	dir = /var/tmp/smbclnt/mnt;
+	stats = /tmp;
+	filesystem = tmpfs;
+	description = "fileio tmpfs";
+	filesize = 5g;
+}
+
+CONFIG randomread2k {
+	function = generic;
+	personality = randomread;
+	nthreads = 16;
+	iosize = 2k;
+}
+
+CONFIG randomread8k {
+	function = generic;
+	personality = randomread;
+	nthreads = 16;
+	iosize = 8k;
+}
+
+CONFIG randomread1m {
+	function = generic;
+	personality = randomread;
+	nthreads = 16;
+	iosize = 1m;
+}
+
+CONFIG randomwrite2k {
+	function = generic;
+	personality = randomwrite;
+	nthreads = 16;
+	iosize = 2k;
+}
+
+CONFIG randomwrite8k {
+	function = generic;
+	personality = randomwrite;
+	nthreads = 16;
+	iosize = 8k;
+}
+
+CONFIG randomwrite1m {
+	function = generic;
+	personality = randomwrite;
+	nthreads = 16;
+	iosize = 1m;
+}
+
+CONFIG singlestreamread1m {
+	function = generic;
+	personality = singlestreamread;
+	iosize = 1m;
+}
+
+CONFIG singlestreamreaddirect1m {
+	function = generic;
+	personality = singlestreamreaddirect;
+	iosize = 1m;
+}
+
+CONFIG singlestreamwrite1m {
+	function = generic;
+	personality = singlestreamwrite;
+	iosize = 1m;
+}
+
+CONFIG singlestreamwritedirect1m {
+	function = generic;
+	personality = singlestreamwritedirect;
+	iosize = 1m;
+}
+
+CONFIG multistreamread1m {
+	function = generic;
+	personality = multistreamread;
+	iosize = 1m;
+}
+
+CONFIG multistreamreaddirect1m {
+	function = generic;
+	personality = multistreamreaddirect;
+	iosize = 1m;
+}
+
+CONFIG multistreamwrite1m {
+	function = generic;
+	personality = multistreamwrite;
+	iosize = 1m;
+}
+
+CONFIG multistreamwritedirect1m {
+	function = generic;
+	personality = multistreamwritedirect;
+	iosize = 1m;
+}
+
diff --git a/usr/src/test/smbclient-tests/config/filemacro.prof b/usr/src/test/smbclient-tests/config/filemacro.prof
new file mode 100644
index 0000000..fcf8431
--- /dev/null
+++ b/usr/src/test/smbclient-tests/config/filemacro.prof
@@ -0,0 +1,128 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+#
+
+DEFAULTS {
+	runtime = 120;
+	dir = /var/tmp/smbclnt/mnt;
+	stats = /tmp;
+	filesystem = tmpfs;
+	description = "filemacro tmpfs";
+}
+
+CONFIG fileserver {
+	function = generic;
+	personality = fileserver;
+	nfiles = 20000;
+	meandirwidth = 20;
+	filesize = 2k;
+	nthreads = 100;
+	meaniosize = 16k;
+}
+
+CONFIG varmail {
+	personality = varmail;
+	function = generic;
+	nfiles = 20000;
+	meandirwidth = 1000000;
+	filesize = 1k;
+	nthreads = 16;
+	meaniosize = 16k;
+}
+
+CONFIG webproxy {
+	personality = webproxy;
+	function = generic;
+	nfiles = 20000;
+	meandirwidth = 1000000;
+	filesize = 1k;
+	nthreads = 100;
+	meaniosize = 16k;
+}
+
+CONFIG webserver {
+	personality = webserver;
+	function = generic;
+	nfiles = 20000;
+	meandirwidth = 20;
+	filesize = 1k;
+	nthreads = 100;
+}
+
+CONFIG large_db_oltp_2k_cached {
+	personality = oltp;
+	function = generic;
+	cached = 1;
+	directio = 0;
+	iosize = 2k;
+	nshadows = 200;
+	ndbwriters = 10;
+	usermode = 20000;
+	filesize = 1g;
+	memperthread = 1m;
+	workingset = 0;
+}
+
+CONFIG large_db_oltp_2k_uncached {
+	personality = oltp;
+	function = generic;
+	cached = 0;
+	directio = 1;
+	iosize = 2k;
+	nshadows = 200;
+	ndbwriters = 10;
+	usermode = 20000;
+	filesize = 1g;
+	memperthread = 1m;
+	workingset = 0;
+}
+
+CONFIG large_db_oltp_8k_cached {
+	personality = oltp;
+	function = generic;
+	cached = 1;
+	directio = 0;
+	iosize = 8k;
+	nshadows = 200;
+	ndbwriters = 10;
+	usermode = 20000;
+	filesize = 1g;
+	memperthread = 1m;
+	workingset = 0;
+}
+
+CONFIG large_db_oltp_8k_uncached {
+	personality = oltp;
+	function = generic;
+	cached = 0;
+	directio = 1;
+	iosize = 8k;
+	nshadows = 200;
+	ndbwriters = 10;
+	usermode = 20000;
+	filesize = 1g;
+	memperthread = 1m;
+	workingset = 0;
+}
+
diff --git a/usr/src/test/smbclient-tests/config/filemicro.prof b/usr/src/test/smbclient-tests/config/filemicro.prof
new file mode 100644
index 0000000..145bed4
--- /dev/null
+++ b/usr/src/test/smbclient-tests/config/filemicro.prof
@@ -0,0 +1,142 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+#
+
+DEFAULTS {
+	runtime = 60;
+	dir = /var/tmp/smbclnt/mnt;
+	stats = /tmp;
+	filesystem = tmpfs;
+	description = "filemicro tmpfs";
+}
+
+CONFIG createandalloc {
+	function = generic;
+	personality = filemicro_create;
+}
+
+CONFIG createandallocsync {
+	function = generic;
+	personality = filemicro_create;
+	sync = true;
+}
+
+CONFIG createallocfsync {
+	function = generic;
+	personality = filemicro_writefsync;
+}
+
+CONFIG createallocappend {
+	function = generic;
+	personality = filemicro_createrand;
+}
+
+CONFIG randread2k {
+	function = generic;
+	personality = filemicro_rread;
+}
+
+CONFIG randread2kcached {
+	function = generic;
+	personality = filemicro_rread;
+	cached = true;
+}
+
+CONFIG randwrite2ksync {
+	function = generic;
+	personality = filemicro_rwrite;
+	sync = true;
+}
+
+CONFIG randwrite2ksync4thread {
+	function = generic;
+	personality = filemicro_rwrite;
+	nthreads = 4;
+	sync = true;
+}
+
+CONFIG randwrite8kfsynccached {
+	function = generic;
+	personality = filemicro_rwritefsync;
+	cached = true;
+}
+
+CONFIG seqread32k {
+	function = generic;
+	personality = filemicro_seqread;
+	iosize = 32k;
+	filesize = 100m;
+}
+
+CONFIG seqread32kcached {
+	function = generic;
+	personality = filemicro_seqread;
+	iosize = 32k;
+	filesize = 100m;
+	cached = true;
+}
+
+CONFIG seqwrite32k {
+	function = generic;
+	personality = filemicro_seqwrite;
+	iosize = 32k;
+}
+
+CONFIG seqwrite32kdsync {
+	function = generic;
+	personality = filemicro_seqwrite;
+	iosize = 32k;
+	sync = true;
+}
+
+CONFIG seqwriterand8k {
+	function = generic;
+	personality = filemicro_seqwriterand;
+}
+
+CONFIG unlink1g {
+	function = generic;
+	personality = filemicro_delete;
+	nthreads = 1;
+}
+
+CONFIG createfiles {
+	function = generic;
+	personality = filemicro_createfiles;
+}
+
+CONFIG rwritedsync {
+	function = generic;
+	personality = filemicro_rwritedsync;
+}
+
+CONFIG filemicro_seqwriterandvargam {
+	function = generic;
+	personality = filemicro_seqwriterandvargam;
+}
+
+CONFIG filemicro_seqwriterandvartab {
+	function = generic;
+	personality = filemicro_seqwriterandvartab;
+}
diff --git a/usr/src/test/smbclient-tests/config/generic.func b/usr/src/test/smbclient-tests/config/generic.func
new file mode 100644
index 0000000..db5bc07
--- /dev/null
+++ b/usr/src/test/smbclient-tests/config/generic.func
@@ -0,0 +1,68 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+#
+
+sub pre_run {
+	# Initialize filebench to appropriate personality, create files
+	# and processes
+	op_init();
+
+	# The op_load command automatically creates files
+	op_load(conf_reqval("personality"));
+
+	# Flush the FS cache
+	op_command("system \"" . get_FILEBENCH() . "/scripts/fs_flush " . conf_reqval("filesystem") . " " . conf_reqval("dir") . "\"");
+
+	# Initialise statistics and argument arrays
+	@ext_stats=();
+	@file_stats=();
+	@arg_stats=();
+}
+
+sub post_run {
+	my $statsbase = get_STATSBASE();
+	# Shutdown processes and quit filebench
+	op_quit();
+	# Create a html summary of the run
+	system ("cd $statsbase; " . get_FILEBENCH() . "/scripts/filebench_compare $statsbase")
+}
+
+sub bm_run {
+	my $runtime = conf_reqval("runtime");
+	my $fs = get_CONFNAME();
+
+	# The following array must not contain empty values ! This causes the
+	# statistics scripts to miss arguments !
+	# Clear, run the benchmark, snap statistics
+	# This command will also run external statistics (supplied in an array)
+	# if desired
+	# Statistics automatically dumped into directory matching stats
+	# profile variable
+	# <stats>/<hostname>-<date-time>/<personality>
+
+	# create processes and start run, then collect statistics
+	op_stats($runtime,"stats.$fs",@ext_stats,@file_stats,@arg_stats);
+}
+
+1;
diff --git a/usr/src/test/smbclient-tests/config/randomread.prof b/usr/src/test/smbclient-tests/config/randomread.prof
new file mode 100644
index 0000000..0f35394
--- /dev/null
+++ b/usr/src/test/smbclient-tests/config/randomread.prof
@@ -0,0 +1,40 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+#
+
+DEFAULTS {
+	runtime = 60;
+	dir = /var/tmp/smbclnt/mnt;
+	stats = /tmp;
+	filesystem = tmpfs;
+	description = "randomread tmpfs";
+}
+
+CONFIG randomread2k {
+	function = generic;
+	personality = randomread;
+	filesize = 160m;
+	iosize = 2k;
+	nthreads = 1;
+}
diff --git a/usr/src/test/smbclient-tests/config/seqread.prof b/usr/src/test/smbclient-tests/config/seqread.prof
new file mode 100644
index 0000000..c91e33e
--- /dev/null
+++ b/usr/src/test/smbclient-tests/config/seqread.prof
@@ -0,0 +1,40 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+#
+
+DEFAULTS {
+	runtime = 120;
+	dir = /var/tmp/smbclnt/mnt;
+	stats = /tmp;
+	filesystem = tmpfs;
+	description = "seqread tmpfs";
+}
+
+CONFIG seqread1m {
+	function = generic;
+	personality = multistreamread;
+	filesize = 40m;
+	iosize = 1m;
+	nthreads = 1;
+}
diff --git a/usr/src/test/smbclient-tests/doc/Makefile b/usr/src/test/smbclient-tests/doc/Makefile
new file mode 100644
index 0000000..f6bf067
--- /dev/null
+++ b/usr/src/test/smbclient-tests/doc/Makefile
@@ -0,0 +1,34 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+include		../Makefile.com
+
+DOCS=		README
+
+ROOTDOCS=	$(DOCS:%=$(ROOTOPTPKG)/%)
+$(ROOTDOCS) :=	FILEMODE = 0444
+
+all:		$(DOCS)
+
+install:	$(ROOTOPTPKG) $(ROOTDOCS)
+
+clean lint clobber:
+
+$(ROOTOPTPKG):
+		$(INS.dir)
+
+$(ROOTOPTPKG)/%: %
+		$(INS.file)
diff --git a/usr/src/test/smbclient-tests/doc/README b/usr/src/test/smbclient-tests/doc/README
new file mode 100644
index 0000000..705dd93
--- /dev/null
+++ b/usr/src/test/smbclient-tests/doc/README
@@ -0,0 +1,144 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+
+Contents:
+
+1. Introduction
+2. How to configure SMB client
+3. How to configure native SMB server
+4. How to configure Windows 2003/2008 server (manual)
+5. How to run the tests
+6. How to get test result and logs
+
+
+1. Introduction
+
+This test suite is designed for SMB client testing. It needs
+two machines (a test client and a SMB server) and the test suite runs
+on the client machine.
+
+Server machine can be one of the following systems:
+
+   1. Native SMB Server
+   2. Windows 2003
+   3. Windows 2008
+
+User must run the test suite as an ordinary user (not root)
+and that user must be able to "sudo" without a password.
+
+This testsuite also uses filebench, a framework of file system
+workloads for measuring and comparing file system performance.
+This testsuite uses the default configuration of filebench.
+
+
+2. How to configure SMB client
+
+   - Install the "expect" package
+
+     # pkg install shell/expect
+
+   - Install the "Test Runner" package
+
+     # pkg install system/test/testrunner
+
+   - Create test directory, owned by whoever will run these tests.
+
+     # mkdir /var/tmp/smbclnt
+     # chown $USER /var/tmp/smbclnt
+
+   - Create additional test users: smbusera, smbuserb, smbuserc
+
+     # useradd -u 20100 -g 1 -d /export/home/smbusera smbusera
+     # useradd -u 20101 -g 1 -d /export/home/smbuserb smbuserb
+     # useradd -u 20102 -g 1 -d /export/home/smbuserc smbuserc
+
+     Set passwords on those accounts, i.e.
+
+     # echo A_nex_123 | passwd smbusera
+     # echo B_nex_123 | passwd smbuserb
+     # echo C_nex_123 | passwd smbuserc
+
+     Make sure those account names and passwords agree with the
+     variable settings in ../include/default_cfg.ksh
+     The accounts, UIDs, and passwords can be whatever you like,
+     but must be consistent with default_cfg.ksh
+
+3. How to configure native SMB server
+
+   - Do as described in step 4 (windows server)
+
+
+4. How to configure Windows 2003/2008 server (manual)
+
+   - Create test users (listed names and passwords are the default
+     ones, check config/config file to see/change them)
+     - Create user smbusera and use "A_nex_123" as its password
+     - Create user smbuserb and use "B_nex_123" as its password
+     - Create user smbuserc and use "C_nex_123" as its password
+
+   - Create test directories
+     - Create three windows share directories in a partition which has
+       more than 4G free space. The directory names are public,
+       a_share and b_share.
+
+   - Set permissions
+     - Assign read/write permission for the "public" share directory
+       to the following users: smbusera, smbuserb, smbuserc
+     - Assign read/write permission for the "a_share" share directory
+       to the following user: smbusera.
+     - Assign read/write permission for the "b_share" share directory
+       to the following user: smbuserb.
+
+   - Disable firewall
+
+
+5. How to run the tests
+
+   - Prerequisites: configure client and server (see above).
+
+   - Install an "exepct" package, i.e. with IPS
+	pkg install shell/expect
+
+   - Export the environment variables:
+
+     # export SRV=servername
+
+   - To run the all test cases, use the following command
+
+     # /opt/smbclient-tests/bin/smbclienttest
+
+   - To run a single test case, create a custom "run file"
+     based on: /opt/smbclient-tests/runfiles/default.run
+     and specify that run file via:
+
+     # /opt/smbclient-tests/bin/smbclienttest -c custom.run
+
+
+6. How to get the test result and logs
+
+Test results are saved in a directory under /var/tmp, e.g.
+/var/tmp/test_results/{date_stamp}
diff --git a/usr/src/test/smbclient-tests/include/Makefile b/usr/src/test/smbclient-tests/include/Makefile
new file mode 100644
index 0000000..120b2ee
--- /dev/null
+++ b/usr/src/test/smbclient-tests/include/Makefile
@@ -0,0 +1,41 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+include		../Makefile.com
+
+INCS=	\
+		default_cfg.ksh		\
+		libtest.ksh		\
+		services_common.ksh	\
+		smbmount_common.ksh	\
+		smbutil_common.ksh	\
+		utils_common.ksh	\
+		xattr_common.ksh
+
+ROOTINCS=	$(INCS:%=$(ROOTINCDIR)/%)
+$(ROOTINCS) :=	FILEMODE = 0444
+
+all lint clean clobber:
+
+install:	$(ROOTINCS)
+
+$(ROOTINCS):	$(ROOTINCDIR)
+
+$(ROOTINCDIR):
+		$(INS.dir)
+
+$(ROOTINCDIR)/%: %
+		$(INS.file)
diff --git a/usr/src/test/smbclient-tests/include/default_cfg.ksh b/usr/src/test/smbclient-tests/include/default_cfg.ksh
new file mode 100644
index 0000000..71961cb
--- /dev/null
+++ b/usr/src/test/smbclient-tests/include/default_cfg.ksh
@@ -0,0 +1,74 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+# testdir base
+export TESTDS=smbclnt
+export TBASEDIR=/var/tmp/$TESTDS
+export TMNT=$TBASEDIR/mnt
+export TMNT2=$TBASEDIR/mnt2
+export TDIR=$TBASEDIR/test
+
+# Users for SMB client authentication testing
+# Share names (public, a_share, b_share) are hard-coded in the tests.
+export AUSER=smbusera
+export AUSERUID=20100
+export APASS=A_nex_123
+export BUSER=smbuserb
+export BUSERUID=20101
+export BPASS=B_nex_123
+export TUSER=smbuserc
+export TUSERUID=20102
+export TPASS=C_nex_123
+
+# Should replace this in the few tests that use $TUSER1
+export TUSER1=$BUSER
+
+# User groups
+export SMBGRP=smbgrp
+export SMBGRPGID=2000
+export SMBGRP1=smbgrp1
+export SMBGRP1GID=2001
+
+# Share group name
+export SHAREGRP=smbclient
+
+# expect tools
+export EXPECT=${EXPECT:-"/usr/bin/expect"}
+
+# utility for set password for cifs user on the server side
+export PASSWDEXP=${PASSWDEXP:-"${STF_SUITE}/bin/passwd.exp"}
+
+# utility for create the keychain for the cifs user
+export SMBUTILEXP=${STF_SUITE}/bin/smbutil.exp
+
+# utility to truncate the file
+export FILETRUNC=${STF_SUITE}/bin/file_trunc
+
+# large data file (read-only) used for copy tests, etc.
+export REFFILE=/usr/lib/libc.so.1
+
+# avoid testruner timeouts (set by smbclienttest -f)
+# export STC_QUICK=1
diff --git a/usr/src/test/smbclient-tests/include/libtest.ksh b/usr/src/test/smbclient-tests/include/libtest.ksh
new file mode 100644
index 0000000..c3fe16b
--- /dev/null
+++ b/usr/src/test/smbclient-tests/include/libtest.ksh
@@ -0,0 +1,39 @@
+#!/usr/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# common includes for smbclint-tests
+#
+
+. ${STF_SUITE}/include/default_cfg.ksh
+
+. ${STF_SUITE}/include/services_common.ksh
+. ${STF_SUITE}/include/smbutil_common.ksh
+. ${STF_SUITE}/include/utils_common.ksh
+. ${STF_SUITE}/include/smbmount_common.ksh
+. ${STF_SUITE}/include/xattr_common.ksh
+
+. ${STF_TOOLS}/contrib/include/ctiutils.shlib
diff --git a/usr/src/test/smbclient-tests/include/services_common.ksh b/usr/src/test/smbclient-tests/include/services_common.ksh
new file mode 100644
index 0000000..9caeed4
--- /dev/null
+++ b/usr/src/test/smbclient-tests/include/services_common.ksh
@@ -0,0 +1,86 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# NAME
+#	service_enable
+#
+# DESCRIPTION
+#	Enable service
+#
+# RETURN
+#	0 - enabled service
+#	1 - failed to enable service
+#
+service_enable () {
+	smf=$1
+
+	status=$(svcprop -p restarter/state $smf)
+	if [[ $status == "online" ]]; then
+		cti_report "service '$smf' is already enabled"
+		return 0
+	fi
+
+	svcadm enable -rs $smf
+}
+
+#
+# NAME
+#	service_disable
+#
+# DESCRIPTION
+#	Disable service
+#
+# RETURN
+#	0 - disabled service
+#	1 - failed to disable service
+#
+service_disable () {
+	smf=$1
+
+	status=$(svcprop -p restarter/state $smf)
+	if [[ $status == "disabled" ]]; then
+		cti_report "PASS: service '$smf' is already disabled"
+		return 0
+	fi
+	svcadm disable -s $smf
+}
+
+#
+# NAME
+#	service_restart
+#
+# DESCRIPTION
+#	Restart service
+#
+# RETURN
+#	0 - restarted service
+#	1 - failed to restart service
+#
+service_restart () {
+	smf=$1
+
+	svcadm restart $smf
+}
diff --git a/usr/src/test/smbclient-tests/include/smbmount_common.ksh b/usr/src/test/smbclient-tests/include/smbmount_common.ksh
new file mode 100644
index 0000000..6e68bfd
--- /dev/null
+++ b/usr/src/test/smbclient-tests/include/smbmount_common.ksh
@@ -0,0 +1,148 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# NAME
+#       smbmount_init
+#
+# DESCRIPTION
+#       Create mount point for smbfs
+#
+# RETURN
+#       0 - create successfully
+#       1 - create failed
+#
+smbmount_init() {
+	rm -rf $1
+	cti_execute_cmd "mkdir $1"
+	if [[ $? != 0 ]]; then
+		cti_unresolved "UNRESOLVED: mkdir $1 failed"
+		exit 1
+	else
+		cti_report "PASS: mkdir $1 successfully"
+	fi
+	return 0
+}
+
+#
+# NAME
+#       testdir_init
+#
+# DESCRIPTION
+#       Create the test directory for smbfs testing
+#
+# RETURN
+#       0 - create successfully
+#       1 - create failed
+#
+testdir_init() {
+	rm -rf $1
+	cti_execute_cmd "mkdir $1"
+	if [[ $? != 0 ]]; then
+		cti_unresolved "UNRESOLVED: mkdir $1 failed"
+		exit 1
+	else
+		cti_report "PASS: mkdir $1 successfully"
+	fi
+	return 0
+}
+
+#
+# NAME
+#       smbmount_getmntopts
+#
+# DESCRIPTION
+#       Get the mount options string for the passed mount point,
+#	(i.e. remote/read/write/setuid/devices/intr/xattr/dev=...)
+#	which is copied to stdout for use by the caller.
+#
+# RETURN
+#       0 - the mount is found, and is an smbfs mount
+#       1 - any problem (no stdout in error cases)
+#
+smbmount_getmntopts() {
+	typeset res on mp tp mtype opts rest
+	/usr/sbin/mount -v |
+	while read res on mp tp mtype opts rest
+	do
+		if [[ "$mp" == "$1" ]] ; then
+			if [[ $mtype != smbfs ]] ; then
+				echo "$1: not an smbfs mount" >&2
+				return 1
+			fi
+			echo "$opts"
+			return 0
+		fi
+	done
+	echo "$1: no such mount point" >&2
+	return 1
+}
+
+#
+# NAME
+#       smbmount_check
+#
+# DESCRIPTION
+#       verify the passed dir is an smbfs mount
+#
+# RETURN
+#       0 - it is an smbfs mount (successful)
+#       1 - it is not... (fail)
+#
+smbmount_check() {
+	cti_execute FAIL smbmount_getmntopts "$1"
+	return $?
+}
+
+#
+# NAME
+#       smbmount_clean
+#
+# DESCRIPTION
+#       umount the smbfs and cleanup the mount point
+#
+# RETURN
+#       0 - umount and cleanup  successfully
+#       1 - umount or cleanup failed
+#
+smbmount_clean() {
+
+	# is it mounted?
+	smbmount_getmntopts "$1" >/dev/null 2>&1
+	if [[ $? == 0 ]]; then
+		cti_execute_cmd sudo -n "umount -f $1"
+		if [[ $? != 0 ]]; then
+			cti_report "umount -f $1 failed"
+			exit 1
+		fi
+	fi
+
+	rm -rf $1
+	if [[ $? != 0 ]]; then
+		cti_report "rm -rf $1 failed"
+		exit 1
+	fi
+	return 0
+}
diff --git a/usr/src/test/smbclient-tests/include/smbutil_common.ksh b/usr/src/test/smbclient-tests/include/smbutil_common.ksh
new file mode 100644
index 0000000..dfcce2d
--- /dev/null
+++ b/usr/src/test/smbclient-tests/include/smbutil_common.ksh
@@ -0,0 +1,90 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# NAME
+#       parse_status_output
+#
+# DESCRIPTION
+#       Parse the output of the smbutil status, and print the
+#	workgroup and the server
+#
+# RETURN
+#       no return
+#
+
+parse_status_output() {
+	typeset w_tag a_tag Workgroup Server
+	w_tag=0
+	s_tag=0
+	while getopts w:s: opt
+	do
+	        case $opt in
+		w)
+			w_tag=1
+	                output="$OPTARG";;
+		s)
+			s_tag=1
+	                output="$OPTARG";;
+	        esac
+	done
+	if [[ w_tag == 1 ]]; then
+		Workgroup=$(cat $output|grep Workgroup \
+			|awk -F: '{print $2}')
+		echo $Workgroup
+	else
+		Server=$(cat $output|grep Server \
+			|awk -F: '{print $2}')
+		echo $Server
+	fi
+}
+
+#
+# NAME
+#       parse_view_output
+#
+# DESCRIPTION
+#       Parse the output of the smbutil view, and print the shares
+#
+# RETURN
+#       0 - success
+#
+parse_view_output() {
+	typeset share str
+	share=$1
+	stdout=$2
+	str=$(cat $stdout |grep -v -- "---"|grep $share)
+	name=$(echo $str |awk '{print $1}')
+	type=$(echo $str |awk '{print $2}')
+	if [[ "$name" != "$share" ]]; then
+		cti_fail "FAIL: share name should be $share"
+		return 1
+	fi
+	if [[ "$type" != "disk" ]]; then
+		cti_fail "FAIL: share type is $type, should be disk"
+		return 1
+	fi
+	return 0
+}
diff --git a/usr/src/test/smbclient-tests/include/utils_common.ksh b/usr/src/test/smbclient-tests/include/utils_common.ksh
new file mode 100644
index 0000000..8fd81e8
--- /dev/null
+++ b/usr/src/test/smbclient-tests/include/utils_common.ksh
@@ -0,0 +1,110 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# NAME
+#	print_test_case
+#
+# DESCRIPTION
+#	Print the test case name to the results formated to fit with
+#	60 characters.
+#
+# RETURN
+#	no return
+#
+print_test_case() {
+	cti_report "======================================================="
+	cti_report "Test case $*"
+	cti_report "======================================================="
+}
+
+
+#
+# NAME
+#	do_nothing
+#
+# DESCRIPTION
+#	Didn't do anything on the system
+#
+# RETURN
+#	no return
+#
+do_nothing() {
+	cti_report "do nothing"
+}
+
+#
+# NAME
+#	no_tested
+#
+# DESCRIPTION
+#	Determine if need to trun the test case
+#
+# RETURN
+#	0 - the test case will run
+#       1 - the test case will not run
+#
+no_tested() {
+	cti_result NOTINUSE
+}
+
+#
+# NAME
+#	server_name
+#
+# DESCRIPTION
+#	Function used to sync with client and server
+#
+# RETURN
+#	0 - sync successfully
+#       1 - sync failed
+#
+server_name() {
+	if [[ -z $SRV ]]; then
+		cti_report "SRV not set"
+		cti_result UNRESOLVED
+		return 1
+	fi
+	server=$SRV
+	echo $server
+	return 0
+}
+
+#
+# NAME
+#	file_size
+#
+# DESCRIPTION
+#	Print the file size
+#
+# RETURN
+#	no return
+#
+file_size() {
+	typeset file=$1
+	typeset -a arr
+	set -A arr x$(ls -l $file 2>/dev/null || echo 0 0 0 0 0);
+	echo "${arr[4]}"
+}
diff --git a/usr/src/test/smbclient-tests/include/xattr_common.ksh b/usr/src/test/smbclient-tests/include/xattr_common.ksh
new file mode 100644
index 0000000..2099bcb
--- /dev/null
+++ b/usr/src/test/smbclient-tests/include/xattr_common.ksh
@@ -0,0 +1,193 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+# a function that takes a file, then creates and verifies
+# an xattr on that file. The xattr_contents is the file
+# that should appear in the xattr namespace.
+
+function create_xattr
+{       # filename xattr_name xattr_contents
+	typeset FILE=$1
+	typeset XATTR_NAME=$2
+	typeset XATTR_CONTENTS=$3
+
+	# read any empty xattr dir on that file
+	cti_execute_cmd "runat $FILE ls"
+
+	# create the xattr
+	cti_execute FAIL "runat $FILE cp $XATTR_CONTENTS $XATTR_NAME"
+	if [[ $? != 0 ]]; then
+	        cti_fail "FAIL:In function create_xattr: "\
+			"create xattr-of-$FILE failed unexpectedly"
+	        return
+	fi
+
+	verify_xattr $FILE $XATTR_NAME $XATTR_CONTENTS
+}
+
+# a function that compares the a single xattr between two files
+# and checks to see if their contents are identical
+
+function compare_xattrs
+{       # filename1 filename2 xattr_name
+	typeset FILE1=$1
+	typeset FILE2=$2
+	typeset XATTR_NAME=$3
+
+	cti_execute_cmd "runat $FILE1 cat $XATTR_NAME > /tmp/file1.$$"
+	cti_execute_cmd "runat $FILE2 cat $XATTR_NAME > /tmp/file2.$$"
+	cti_execute_cmd "diff /tmp/file1.$$ /tmp/file2.$$ \
+		>> /tmp/diffout.$$ 2>&1"
+	if [[ $? != 0 ]]; then
+	        cti_fail "FAIL:In function compare_xattrs: "\
+			"compare xattr-of-$FILE1 with xattr-of-$FILE2 "\
+			"failed unexpectedly"
+	        cti_report "diff xattrs-of-$FILE1 xattrs-of-$FILE2 "\
+			"printed you can see the file /tmp/diffout.$$"
+	        return
+	else
+	        cti_report "PASS:In function compare_xattrs: "\
+			"compare xattr-of-$FILE1 with xattr-of-$FILE2 "\
+			"succeeded as expected"
+	fi
+
+	cti_execute_cmd "rm /tmp/file1.$$ /tmp/file2.$$"
+	if [[ $? != 0 ]]; then
+	        cti_fail "FAIL:In function compare_xattrs: "\
+			"rm temp file: /tmp/file1.$$ /tmp/file2.$$ "\
+			"failed unexpectedly"
+	        return
+	else
+	        cti_report "PASS:In function compare_xattrs: "\
+			"rm temp file: /tmp/file1.$$ /tmp/file2.$$ "\
+			"succeeded as expected"
+	fi
+}
+
+# verify xattr exists and has content matching xattr_contents
+
+function verify_xattr
+{       # filename xattr_name xattr_contents
+	typeset FILE=$1
+	typeset XATTR_NAME=$2
+	typeset XATTR_CONTENTS=$3
+
+	cti_execute_cmd "runat $FILE diff $XATTR_NAME $XATTR_CONTENTS"
+	if [[ $? != 0 ]]; then
+	        cti_fail "FAIL:In function verify_xattr: "\
+			"verify xattr-of-$FILE failed unexpectedly"
+	        return
+	fi
+}
+
+function delete_xattr
+{       # filename xattr_name
+	typeset FILE=$1
+	typeset XATTR_NAME=$2
+
+	# delete the xattr
+	cti_execute_cmd "runat $FILE rm $XATTR_NAME"
+	if [[ $? != 0 ]]; then
+	        cti_fail "FAIL:In function delete_xattr: "\
+			"delete xattr-of-$FILE failed unexpectedly"
+	        return
+	else
+	        cti_report "PASS:In function delete_xattr: "\
+			"delete xattr-of-$FILE succeeded as expected"
+	fi
+
+	# make sure it's gone (ls should fail)
+	cti_execute PASS "runat $FILE ls $XATTR_NAME"
+	if [[ $? == 0 ]]; then
+	        cti_fail "FAIL:In function delete_xattr: "\
+			"$FILE has xattr named $XATTR_NAME unexpectedly"
+	        return
+	else
+	        cti_report "PASS:In function delete_xattr: "\
+			"$FILE does not have xattr named "\
+			"$XATTR_NAME as expected"
+	fi
+
+}
+
+# not sure about this : really this should be testing write/append
+
+function verify_write_xattr
+{       # filename xattr_name
+	typeset FILE=$1
+	typeset XATTR_NAME=$2
+
+	cti_execute_cmd "runat $FILE dd if=/etc/passwd of=$XATTR_NAME"
+	if [[ $? != 0 ]]; then
+	        cti_fail "FAIL:In function verify_write_xattr: "\
+			"create xattr-of-$FILE named $XATTR_NAME "\
+			"failed unexpectedly"
+	        return
+	else
+	cti_report "PASS:In function verify_write_xattr: "\
+		"create xattr-of-$FILE named $XATTR_NAME succeeded"
+	fi
+
+	cti_execute_cmd "runat $FILE cat $XATTR_NAME \
+		> /tmp/$XATTR_NAME.$$ 2>&1"
+	if [[ $? != 0 ]]; then
+	        cti_fail "FAIL:In function verify_write_xattr: "\
+			"cat xattr-of-$FILE named $XATTR_NAME "\
+			"failed unexpectedly"
+	        return
+	else
+	        cti_report "PASS:In function verify_write_xattr: "\
+			"cat xattr-of-$FILE named $XATTR_NAME succeeded"
+	fi
+
+	cti_execute_cmd "dd if=/etc/passwd of=/tmp/passwd_dd.$$"
+	cti_execute_cmd "diff /tmp/passwd_dd.$$ /tmp/$XATTR_NAME.$$"
+	if [[ $? != 0 ]]; then
+	        cti_fail "FAIL:In function verify_write_xattr: "\
+			"diff xattr-of-$FILE named $XATTR_NAME failed"
+	        return
+	else
+	        cti_report "PASS:In function verify_write_xattr: "\
+			"diff xattr-of-$FILE named $XATTR_NAME succeeded"
+	fi
+
+	cti_execute_cmd "rm /tmp/passwd_dd.$$ /tmp/$XATTR_NAME.$$"
+}
+
+# this function is to create the expected output
+
+function create_expected_output
+{       # expected_output_file  contents_of_the_output
+	typeset FILE=$1
+	shift
+	if [[ -e $FILE ]]; then
+	        cti_execute_cmd "rm $FILE"
+	fi
+
+	for line in $@
+	do
+	        cti_execute_cmd "echo $line >> $FILE"
+	done
+ }
diff --git a/usr/src/test/smbclient-tests/runfiles/Makefile b/usr/src/test/smbclient-tests/runfiles/Makefile
new file mode 100644
index 0000000..31ade81
--- /dev/null
+++ b/usr/src/test/smbclient-tests/runfiles/Makefile
@@ -0,0 +1,44 @@
+#
+# 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 (c) 2012 by Delphix. All rights reserved.
+#
+
+include $(SRC)/Makefile.master
+
+SRCS =	default.run \
+	just-nsmbrc.run \
+	just-sharectl.run \
+	just-smbfs.run \
+	just-smbmount.run \
+	just-smbutil.run \
+	perf-regression.run
+
+ROOTOPTPKG = $(ROOT)/opt/smbclient-tests
+RUNFILES = $(ROOTOPTPKG)/runfiles
+
+CMDS = $(SRCS:%=$(RUNFILES)/%)
+$(CMDS) := FILEMODE = 0444
+
+all: $(SRCS)
+
+install: $(CMDS)
+
+clean lint clobber:
+
+$(CMDS): $(RUNFILES) $(SRCS)
+
+$(RUNFILES):
+	$(INS.dir)
+
+$(RUNFILES)/%: %
+	$(INS.file)
diff --git a/usr/src/test/smbclient-tests/runfiles/default.run b/usr/src/test/smbclient-tests/runfiles/default.run
new file mode 100644
index 0000000..7c88af2
--- /dev/null
+++ b/usr/src/test/smbclient-tests/runfiles/default.run
@@ -0,0 +1,85 @@
+#
+# 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 (c) 2012 by Delphix. All rights reserved.
+#
+
+[DEFAULT]
+pre =
+verbose = False
+quiet = False
+timeout = 60
+post =
+outputdir = /var/tmp/test_results
+user =
+
+[/opt/smbclient-tests/tests/nsmbrc]
+tests = ['tp_nsmbrc_001', 'tp_nsmbrc_002', 'tp_nsmbrc_003', 'tp_nsmbrc_004',
+	'tp_nsmbrc_005', 'tp_nsmbrc_006']
+
+[/opt/smbclient-tests/tests/sharectl]
+tests = ['tp_sharectl_001', 'tp_sharectl_002', 'tp_sharectl_003',
+	'tp_sharectl_004', 'tp_sharectl_005', 'tp_sharectl_006']
+user = root
+
+[/opt/smbclient-tests/tests/smbfs/acl]
+tests = ['tp_acl_001', 'tp_acl_002', 'tp_acl_003', 'tp_acl_004', 'tp_acl_005']
+
+[/opt/smbclient-tests/tests/smbfs/cptest]
+tests = ['tp_cptest_001', 'tp_cptest_002', 'tp_cptest_003', 'tp_cptest_004',
+	'tp_cptest_005', 'tp_cptest_006', 'tp_cptest_007', 'tp_cptest_008',
+	'tp_cptest_009']
+timeout = 600
+
+[/opt/smbclient-tests/tests/smbfs/create]
+tests = ['tp_create_001', 'tp_create_002', 'tp_create_003', 'tp_create_004',
+	'tp_create_005', 'tp_create_006', 'tp_create_007', 'tp_create_008',
+	'tp_create_009', 'tp_create_010', 'tp_create_011', 'tp_create_012']
+timeout = 300
+
+[/opt/smbclient-tests/tests/smbfs/error]
+tests = ['tp_error_001', 'tp_error_002']
+
+[/opt/smbclient-tests/tests/smbfs/misc]
+tests = ['tp_misc_001', 'tp_misc_002', 'tp_misc_003']
+
+[/opt/smbclient-tests/tests/smbfs/mkdir]
+tests = ['tp_mkdir_001', 'tp_mkdir_002', 'tp_mkdir_003', 'tp_mkdir_004',
+	'tp_mkdir_005', 'tp_mkdir_006']
+
+[/opt/smbclient-tests/tests/smbfs/mmap]
+tests = ['tp_mmap_001', 'tp_mmap_002', 'tp_mmap_003', 'tp_mmap_004',
+	'tp_mmap_005', 'tp_mmap_006', 'tp_mmap_007', 'tp_mmap_008',
+	'tp_mmap_009', 'tp_mmap_010']
+
+[/opt/smbclient-tests/tests/smbfs/mvtest]
+tests = ['tp_mvtest_001', 'tp_mvtest_002', 'tp_mvtest_003', 'tp_mvtest_004',
+	'tp_mvtest_005', 'tp_mvtest_006', 'tp_mvtest_007']
+
+[/opt/smbclient-tests/tests/smbfs/xattr]
+tests = ['tp_xattr_001', 'tp_xattr_002', 'tp_xattr_003', 'tp_xattr_004',
+	'tp_xattr_005', 'tp_xattr_006', 'tp_xattr_007', 'tp_xattr_008',
+	'tp_xattr_009']
+
+[/opt/smbclient-tests/tests/smbmount]
+tests = ['tp_smbmount_001', 'tp_smbmount_002', 'tp_smbmount_003',
+	'tp_smbmount_004', 'tp_smbmount_005', 'tp_smbmount_006',
+	'tp_smbmount_007', 'tp_smbmount_008', 'tp_smbmount_009',
+	'tp_smbmount_010', 'tp_smbmount_011', 'tp_smbmount_012',
+	'tp_smbmount_013', 'tp_smbmount_014', 'tp_smbmount_015',
+	'tp_smbmount_016']
+
+[/opt/smbclient-tests/tests/smbutil]
+tests = ['tp_smbutil_001', 'tp_smbutil_002', 'tp_smbutil_003', 'tp_smbutil_004',
+	'tp_smbutil_005', 'tp_smbutil_006', 'tp_smbutil_007', 'tp_smbutil_008',
+	'tp_smbutil_009', 'tp_smbutil_010', 'tp_smbutil_011', 'tp_smbutil_012',
+	'tp_smbutil_013', 'tp_smbutil_014', 'tp_smbutil_015', 'tp_smbutil_016']
diff --git a/usr/src/test/smbclient-tests/runfiles/just-nsmbrc.run b/usr/src/test/smbclient-tests/runfiles/just-nsmbrc.run
new file mode 100644
index 0000000..aea325b
--- /dev/null
+++ b/usr/src/test/smbclient-tests/runfiles/just-nsmbrc.run
@@ -0,0 +1,27 @@
+#
+# 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 (c) 2012 by Delphix. All rights reserved.
+#
+
+[DEFAULT]
+pre =
+verbose = False
+quiet = False
+timeout = 60
+post =
+outputdir = /var/tmp/test_results
+user =
+
+[/opt/smbclient-tests/tests/nsmbrc]
+tests = ['tp_nsmbrc_001', 'tp_nsmbrc_002', 'tp_nsmbrc_003', 'tp_nsmbrc_004',
+	'tp_nsmbrc_005', 'tp_nsmbrc_006']
diff --git a/usr/src/test/smbclient-tests/runfiles/just-sharectl.run b/usr/src/test/smbclient-tests/runfiles/just-sharectl.run
new file mode 100644
index 0000000..9a21e63
--- /dev/null
+++ b/usr/src/test/smbclient-tests/runfiles/just-sharectl.run
@@ -0,0 +1,28 @@
+#
+# 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 (c) 2012 by Delphix. All rights reserved.
+#
+
+[DEFAULT]
+pre =
+verbose = False
+quiet = False
+timeout = 60
+post =
+outputdir = /var/tmp/test_results
+user =
+
+[/opt/smbclient-tests/tests/sharectl]
+tests = ['tp_sharectl_001', 'tp_sharectl_002', 'tp_sharectl_003',
+	'tp_sharectl_004', 'tp_sharectl_005', 'tp_sharectl_006']
+user = root
diff --git a/usr/src/test/smbclient-tests/runfiles/just-smbfs.run b/usr/src/test/smbclient-tests/runfiles/just-smbfs.run
new file mode 100644
index 0000000..8c553e4
--- /dev/null
+++ b/usr/src/test/smbclient-tests/runfiles/just-smbfs.run
@@ -0,0 +1,62 @@
+#
+# 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 (c) 2012 by Delphix. All rights reserved.
+#
+
+[DEFAULT]
+pre =
+verbose = False
+quiet = False
+timeout = 60
+post =
+outputdir = /var/tmp/test_results
+user =
+
+[/opt/smbclient-tests/tests/smbfs/acl]
+tests = ['tp_acl_001', 'tp_acl_002', 'tp_acl_003', 'tp_acl_004', 'tp_acl_005']
+
+[/opt/smbclient-tests/tests/smbfs/cptest]
+tests = ['tp_cptest_001', 'tp_cptest_002', 'tp_cptest_003', 'tp_cptest_004',
+	'tp_cptest_005', 'tp_cptest_006', 'tp_cptest_007', 'tp_cptest_008',
+	'tp_cptest_009']
+timeout = 600
+
+[/opt/smbclient-tests/tests/smbfs/create]
+tests = ['tp_create_001', 'tp_create_002', 'tp_create_003', 'tp_create_004',
+	'tp_create_005', 'tp_create_006', 'tp_create_007', 'tp_create_008',
+	'tp_create_009', 'tp_create_010', 'tp_create_011', 'tp_create_012']
+timeout = 300
+
+[/opt/smbclient-tests/tests/smbfs/error]
+tests = ['tp_error_001', 'tp_error_002']
+
+[/opt/smbclient-tests/tests/smbfs/misc]
+tests = ['tp_misc_001', 'tp_misc_002', 'tp_misc_003']
+
+[/opt/smbclient-tests/tests/smbfs/mkdir]
+tests = ['tp_mkdir_001', 'tp_mkdir_002', 'tp_mkdir_003', 'tp_mkdir_004',
+	'tp_mkdir_005', 'tp_mkdir_006']
+
+[/opt/smbclient-tests/tests/smbfs/mmap]
+tests = ['tp_mmap_001', 'tp_mmap_002', 'tp_mmap_003', 'tp_mmap_004',
+	'tp_mmap_005', 'tp_mmap_006', 'tp_mmap_007', 'tp_mmap_008',
+	'tp_mmap_009', 'tp_mmap_010']
+
+[/opt/smbclient-tests/tests/smbfs/mvtest]
+tests = ['tp_mvtest_001', 'tp_mvtest_002', 'tp_mvtest_003', 'tp_mvtest_004',
+	'tp_mvtest_005', 'tp_mvtest_006', 'tp_mvtest_007']
+
+[/opt/smbclient-tests/tests/smbfs/xattr]
+tests = ['tp_xattr_001', 'tp_xattr_002', 'tp_xattr_003', 'tp_xattr_004',
+	'tp_xattr_005', 'tp_xattr_006', 'tp_xattr_007', 'tp_xattr_008',
+	'tp_xattr_009']
diff --git a/usr/src/test/smbclient-tests/runfiles/just-smbmount.run b/usr/src/test/smbclient-tests/runfiles/just-smbmount.run
new file mode 100644
index 0000000..cfccfa8
--- /dev/null
+++ b/usr/src/test/smbclient-tests/runfiles/just-smbmount.run
@@ -0,0 +1,31 @@
+#
+# 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 (c) 2012 by Delphix. All rights reserved.
+#
+
+[DEFAULT]
+pre =
+verbose = False
+quiet = False
+timeout = 60
+post =
+outputdir = /var/tmp/test_results
+user =
+
+[/opt/smbclient-tests/tests/smbmount]
+tests = ['tp_smbmount_001', 'tp_smbmount_002', 'tp_smbmount_003',
+	'tp_smbmount_004', 'tp_smbmount_005', 'tp_smbmount_006',
+	'tp_smbmount_007', 'tp_smbmount_008', 'tp_smbmount_009',
+	'tp_smbmount_010', 'tp_smbmount_011', 'tp_smbmount_012',
+	'tp_smbmount_013', 'tp_smbmount_014', 'tp_smbmount_015',
+	'tp_smbmount_016']
diff --git a/usr/src/test/smbclient-tests/runfiles/just-smbutil.run b/usr/src/test/smbclient-tests/runfiles/just-smbutil.run
new file mode 100644
index 0000000..60ef07f
--- /dev/null
+++ b/usr/src/test/smbclient-tests/runfiles/just-smbutil.run
@@ -0,0 +1,29 @@
+#
+# 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 (c) 2012 by Delphix. All rights reserved.
+#
+
+[DEFAULT]
+pre =
+verbose = False
+quiet = False
+timeout = 60
+post =
+outputdir = /var/tmp/test_results
+user =
+
+[/opt/smbclient-tests/tests/smbutil]
+tests = ['tp_smbutil_001', 'tp_smbutil_002', 'tp_smbutil_003', 'tp_smbutil_004',
+	'tp_smbutil_005', 'tp_smbutil_006', 'tp_smbutil_007', 'tp_smbutil_008',
+	'tp_smbutil_009', 'tp_smbutil_010', 'tp_smbutil_011', 'tp_smbutil_012',
+	'tp_smbutil_013', 'tp_smbutil_014', 'tp_smbutil_015', 'tp_smbutil_016']
diff --git a/usr/src/test/smbclient-tests/runfiles/perf-regression.run b/usr/src/test/smbclient-tests/runfiles/perf-regression.run
new file mode 100644
index 0000000..7ceddfc
--- /dev/null
+++ b/usr/src/test/smbclient-tests/runfiles/perf-regression.run
@@ -0,0 +1,26 @@
+#
+# 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 (c) 2015, 2016 by Delphix. All rights reserved.
+#
+
+[DEFAULT]
+pre = setup
+quiet = False
+pre_user = root
+timeout = 0
+post = cleanup
+outputdir = /var/tmp/test_results
+
+[/opt/smbclient-tests/tests/performance/filebench]
+tests = ['tp_filebench_001', 'tp_filebench_002', 'tp_filebench_003',
+	'tp_filebench_004', 'tp_filebench_005']
diff --git a/usr/src/test/smbclient-tests/tests/Makefile b/usr/src/test/smbclient-tests/tests/Makefile
new file mode 100644
index 0000000..bc4504e
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/Makefile
@@ -0,0 +1,26 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+.PARALLEL:	$(SUBDIRS)
+
+SUBDIRS=	\
+		nsmbrc		\
+		performance	\
+		sharectl	\
+		smbfs		\
+		smbmount	\
+		smbutil
+
+include		$(SRC)/test/Makefile.com
diff --git a/usr/src/test/smbclient-tests/tests/Makefile.tests b/usr/src/test/smbclient-tests/tests/Makefile.tests
new file mode 100644
index 0000000..1958953
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/Makefile.tests
@@ -0,0 +1,27 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+ROOTTESTS=	$(TESTS:%=$(ROOTTESTDIR)/%)
+$(ROOTTESTS) :=	FILEMODE = 0555
+
+all lint clean clobber:
+
+install:	$(ROOTTESTDIR) $(ROOTTESTS)
+
+$(ROOTTESTDIR):
+		$(INS.dir)
+
+$(ROOTTESTDIR)/%: %.ksh
+		$(INS.rename)
diff --git a/usr/src/test/smbclient-tests/tests/nsmbrc/Makefile b/usr/src/test/smbclient-tests/tests/nsmbrc/Makefile
new file mode 100644
index 0000000..0ce698a
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/nsmbrc/Makefile
@@ -0,0 +1,29 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+include		../../Makefile.com
+
+ROOTTESTDIR=	$(ROOTOPTPKG)/tests/nsmbrc
+
+TESTS=	\
+		tp_nsmbrc_001	\
+		tp_nsmbrc_002	\
+		tp_nsmbrc_003	\
+		tp_nsmbrc_004	\
+		tp_nsmbrc_005	\
+		tp_nsmbrc_006
+
+include		../Makefile.tests
diff --git a/usr/src/test/smbclient-tests/tests/nsmbrc/tp_nsmbrc_001.ksh b/usr/src/test/smbclient-tests/tests/nsmbrc/tp_nsmbrc_001.ksh
new file mode 100644
index 0000000..0fe3454
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/nsmbrc/tp_nsmbrc_001.ksh
@@ -0,0 +1,78 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
+#
+
+#
+# ID:nsmbrc001
+#
+# DESCRIPTION:
+#        Verify minauth can work in default
+#
+# STRATEGY:
+#	1. create a .nsmbrc file include default section
+#	   minauth=kerberos
+#	2. run "smbutil view user@server and get the failure"
+#	3. create a .nsmbrc file include server section minauth=kerberos
+#	4. run "smbutil view user@server and get the failure"
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+set -x
+
+tc_id="nsmbrc001"
+tc_desc="Verify minauth can work in default"
+print_test_case $tc_id" - "$tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+cti_execute_cmd "rm -f ~/.nsmbrc"
+echo "[default]
+minauth=kerberos" > ~/.nsmbrc
+
+# kill any existing session first
+cti_execute_cmd "smbutil discon //$TUSER@$server"
+sleep 1
+
+# this should fail
+cmd="smbutil view -N //$TUSER:$TPASS@$server"
+cti_execute -i '' PASS $cmd
+if [[ $? == 0 ]]; then
+	cti_execute_cmd "echo '::nsmb_vc' |sudo -n mdb -k"
+	cti_fail "FAIL: can pass authentication by minauth=kerberos"
+	return
+else
+	cti_report "PASS: can't pass authentication by minauth=kerberos"
+fi
+
+cti_execute_cmd "rm -f ~/.nsmbrc"
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/nsmbrc/tp_nsmbrc_002.ksh b/usr/src/test/smbclient-tests/tests/nsmbrc/tp_nsmbrc_002.ksh
new file mode 100644
index 0000000..a3f7e85
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/nsmbrc/tp_nsmbrc_002.ksh
@@ -0,0 +1,94 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
+#
+
+#
+# ID:nsmbrc002
+#
+# DESCRIPTION:
+#        Verify password can work
+#
+# STRATEGY:
+#       1. create a .nsmbrc file
+#       2. run "smbutil view //$TUSER@server"
+#       3. password works fine
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="nsmbrc002"
+tc_desc="Verify password can work in nsmbrc"
+print_test_case $tc_id" - "$tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+cti_execute_cmd "rm -f ~/.nsmbrc"
+pass=$(smbutil crypt $TPASS)
+echo "[default]" > ~/.nsmbrc
+echo "password=$pass" >> ~/.nsmbrc
+cti_execute_cmd chmod 600 ~/.nsmbrc
+
+# kill any existing session first
+cti_execute_cmd "smbutil discon //$TUSER@$server"
+sleep 1
+
+cmd="smbutil view //$TUSER@$server"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: password property in default section doesn't work"
+	return
+else
+	cti_report "PASS: password property in default section works"
+fi
+
+
+SERVER=$(echo $server | tr "[:lower:]" "[:upper:]")
+echo "[$SERVER]" > ~/.nsmbrc
+echo "addr=$server" >> ~/.nsmbrc
+echo "password=$pass" >> ~/.nsmbrc
+cti_execute_cmd chmod 600 ~/.nsmbrc
+
+# kill any existing session first
+cti_execute_cmd "smbutil discon //$TUSER@$server"
+sleep 1
+
+cmd="smbutil view //$TUSER@$server"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: password property in SERVER section doesn't work"
+	return
+else
+	cti_report "PASS: password property in SERVER section works"
+fi
+
+cti_execute_cmd "rm -f ~/.nsmbrc"
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/nsmbrc/tp_nsmbrc_003.ksh b/usr/src/test/smbclient-tests/tests/nsmbrc/tp_nsmbrc_003.ksh
new file mode 100644
index 0000000..9fe2a3b
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/nsmbrc/tp_nsmbrc_003.ksh
@@ -0,0 +1,110 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
+#
+
+#
+# ID:nsmbrc003
+#
+# DESCRIPTION:
+#        Verify password can work
+#
+# STRATEGY:
+#       1. create a .nsmbrc file
+#       2. run "smbutil logoutall"
+#       3. run "mount -F smbfs //$TUSER@$server/public $TMNT"
+#       4. smbutil and mount can get right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="nsmbrc003"
+tc_desc=" Verify password can work"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+server=$(server_name) || return
+
+cti_execute_cmd "rm -f ~/.nsmbrc"
+pass=$(smbutil crypt $TPASS)
+SERVER=$(echo $server | tr "[:lower:]" "[:upper:]")
+echo "[$SERVER:$TUSER]" > ~/.nsmbrc
+echo "addr=$server" >> ~/.nsmbrc
+echo "password=$pass" >> ~/.nsmbrc
+cti_execute_cmd "chmod 600 ~/.nsmbrc"
+
+smbutil logout -a
+
+# get rid of our connections
+cti_execute_cmd "smbutil discon //$TUSER@$server"
+cti_execute_cmd "smbutil discon //$TUSER1@$server"
+sleep 1
+
+cti_report "expect failure with $TUSER1"
+cmd="smbutil view -N //$TUSER1@$server"
+cti_execute -i '' PASS $cmd
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: $SERVER:$TUSER works for $TUSER1"
+	return
+else
+	cti_report "PASS: $SERVER:$TUSER does't work for $TUSER1"
+fi
+
+cti_report "expect success with $TUSER"
+cmd="truss -f -o smbutil.to smbutil view -N //$TUSER@$server"
+cti_execute -i '' PASS $cmd
+if [[ $? == 0 ]]; then
+	cti_pass "PASS: $SERVER:$TUSER works for $TUSER"
+else
+	cti_fail "FAIL: $SERVER:$TUSER does't work for $TUSER"
+	return
+fi
+
+cmd="mount -F smbfs //$TUSER@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $SERVER:$TUSER does't work for $TUSER"
+	return
+else
+	cti_report "PASS: $SERVER:$TUSER works for $TUSER"
+fi
+
+smbmount_check $TMNT
+if [[ $? != 0 ]]; then
+	smbmount_clean $TMNT
+	return
+fi
+
+cti_execute_cmd "rm -f ~/.nsmbrc"
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/nsmbrc/tp_nsmbrc_004.ksh b/usr/src/test/smbclient-tests/tests/nsmbrc/tp_nsmbrc_004.ksh
new file mode 100644
index 0000000..6536dec
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/nsmbrc/tp_nsmbrc_004.ksh
@@ -0,0 +1,77 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
+#
+
+#
+# ID:nsmbrc004
+#
+# DESCRIPTION:
+#        Verify minauth can work on SERVER section
+#
+# STRATEGY:
+#       1. create a .nsmbrc file
+#       2. run "smbutil view //$TUSER:$TPASS@$server"
+#       3. smbutil can get right messages
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="nsmbrc004"
+tc_desc=" Verify minauth can work on SERVER section"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+cti_execute_cmd "rm -f ~/.nsmbrc"
+
+SERVER=$(echo $server | tr "[:lower:]" "[:upper:]")
+echo "[$SERVER]" > ~/.nsmbrc
+echo "addr=$server" >> ~/.nsmbrc
+echo "minauth=kerberos" >> ~/.nsmbrc
+
+# get rid of our connection
+cti_execute_cmd "smbutil discon //$TUSER@$server"
+sleep 1
+
+cti_report "expect failure next"
+cmd="smbutil view //$TUSER:$TPASS@$server"
+cti_execute -i '' PASS $cmd
+if [[ $? == 0 ]]; then
+	cti_execute_cmd "echo '::nsmb_vc' |sudo -n mdb -k"
+	cti_fail "FAIL: minauth property in SERVER section doesn't work"
+	return
+else
+	cti_report "PASS: minauth property in SERVER section works"
+fi
+
+cti_execute_cmd "rm -f ~/.nsmbrc"
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/nsmbrc/tp_nsmbrc_005.ksh b/usr/src/test/smbclient-tests/tests/nsmbrc/tp_nsmbrc_005.ksh
new file mode 100644
index 0000000..e98512f
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/nsmbrc/tp_nsmbrc_005.ksh
@@ -0,0 +1,95 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
+#
+
+#
+# ID:nsmbrc001
+#
+# DESCRIPTION:
+#        Verify user and domain can work
+#
+# STRATEGY:
+#       1. create a .nsmbrc file
+#       2. run "smbutil view //$server"
+#       3. run "mount -F smbfs //$server/public $TMNT"
+#       4. smbutil and mount can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="nsmbrc005"
+tc_desc=" Verify user and domain in user section can work"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+cti_execute_cmd "rm -f ~/.nsmbrc"
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+pass=$(smbutil crypt $TPASS)
+echo "[default]" > ~/.nsmbrc
+echo "password=$pass" >> ~/.nsmbrc
+echo "user=$TUSER" >> ~/.nsmbrc
+echo "domain=mydomain" >> ~/.nsmbrc
+cti_execute_cmd chmod 600 ~/.nsmbrc
+
+cmd="smbutil view //$server"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: user and domain property in default section doesn't work"
+	return
+else
+	cti_report "PASS: user and domain property in default section works"
+
+fi
+
+cmd="mount -F smbfs //$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: user and domain property in default section doesn't work" \
+	    "for smb mount"
+	return
+else
+	cti_report "PASS: user and domain properity in default section works for" \
+	   "smbmount"
+fi
+
+smbmount_check $TMNT
+if [[ $? != 0 ]]; then
+	smbmount_clean $TMNT
+	return
+fi
+
+cti_execute_cmd "rm -f ~/.nsmbrc"
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/nsmbrc/tp_nsmbrc_006.ksh b/usr/src/test/smbclient-tests/tests/nsmbrc/tp_nsmbrc_006.ksh
new file mode 100644
index 0000000..f2d2520
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/nsmbrc/tp_nsmbrc_006.ksh
@@ -0,0 +1,97 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
+#
+
+#
+# ID:nsmbrc006
+#
+# DESCRIPTION:
+#        Verify user and domain can work in .nsmbrc
+#
+# STRATEGY:
+#       1. create a .nsmbrc file
+#       2. run "smbutil view //$server"
+#       3. run "mount -F smbfs //$server/public $TMNT"
+#       4. smbutil and mount can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="nsmbrc006"
+tc_desc=" Verify user and domain in sever section can work"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+cti_execute_cmd "rm -f ~/.nsmbrc"
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+pass=$(smbutil crypt $TPASS)
+SERVER=$(echo $server | tr "[:lower:]" "[:upper:]")
+echo "[$SERVER]" > ~/.nsmbrc
+echo "password=$pass" >> ~/.nsmbrc
+echo "user=$TUSER" >> ~/.nsmbrc
+echo "domain=mydomain" >> ~/.nsmbrc
+cti_execute_cmd chmod 600 ~/.nsmbrc
+
+cmd="smbutil view //$server"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: user and domain properties in default SERVER section" \
+	   "don't work"
+	return
+else
+	cti_report "PASS: user and domain properties in default SERVER section" \
+	   "work"
+fi
+
+cmd="mount -F smbfs //$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: user and domain properties in default SERVER section" \
+	   "don't work"
+	return
+else
+	cti_report "PASS: user and domain properties in default SERVER section" \
+	   "work"
+fi
+
+smbmount_check $TMNT
+if [[ $? != 0 ]]; then
+	smbmount_clean $TMNT
+	return
+fi
+
+cti_execute_cmd "rm -f ~/.nsmbrc"
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/performance/Makefile b/usr/src/test/smbclient-tests/tests/performance/Makefile
new file mode 100644
index 0000000..32ffd0c
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/performance/Makefile
@@ -0,0 +1,21 @@
+#
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+.PARALLEL:	$(SUBDIRS)
+
+SUBDIRS=	filebench
+
+include		$(SRC)/test/Makefile.com
diff --git a/usr/src/test/smbclient-tests/tests/performance/filebench/Makefile b/usr/src/test/smbclient-tests/tests/performance/filebench/Makefile
new file mode 100644
index 0000000..750db70
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/performance/filebench/Makefile
@@ -0,0 +1,28 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+include		../../../Makefile.com
+
+ROOTTESTDIR=	$(ROOTOPTPKG)/tests/performance/filebench
+
+TESTS=	\
+		tp_filebench_001	\
+		tp_filebench_002	\
+		tp_filebench_003	\
+		tp_filebench_004	\
+		tp_filebench_005
+
+include		../../Makefile.tests
diff --git a/usr/src/test/smbclient-tests/tests/performance/filebench/tp_filebench_001.ksh b/usr/src/test/smbclient-tests/tests/performance/filebench/tp_filebench_001.ksh
new file mode 100644
index 0000000..3b362a6
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/performance/filebench/tp_filebench_001.ksh
@@ -0,0 +1,89 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: filebench_001
+#
+# DESCRIPTION:
+#        Verify filebench fileio testing on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. run fileio filebench can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="filebench_001"
+tc_desc=" Verify filebench on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+sleep 3
+
+cmd="ls -l $filebenchdir/filebench"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_report "FAIL: There is no filebench package, please install it."
+	cti_untested $tc_id
+	return
+fi
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the share \"public\" "
+	return
+else
+	cti_report "PASS: smbmount mount the share successfully"
+fi
+
+
+rm -rf $TMNT/*
+
+#run fileio filebench
+cti_execute_cmd $filebenchdir/filebench ${STF_SUITE}/config/fileio
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: filebench fileio failed"
+	return
+else
+	cti_report "PASS: filebench fileio successfully"
+fi
+
+cti_execute_cmd rm -rf $TMNT/*
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/performance/filebench/tp_filebench_002.ksh b/usr/src/test/smbclient-tests/tests/performance/filebench/tp_filebench_002.ksh
new file mode 100644
index 0000000..ebe2c07
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/performance/filebench/tp_filebench_002.ksh
@@ -0,0 +1,89 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: filebench_002
+#
+# DESCRIPTION:
+#       Verify filebench filemacro on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. run filebench filemacro can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="filebench_002"
+tc_desc=" Verify filebench on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+sleep 3
+
+cmd="ls -l $filebenchdir/filebench"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_report "FAIL: There is no filebench package, please install it."
+	cti_untested $tc_id
+	return
+fi
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the share \"public\" "
+	return
+else
+	cti_report "PASS: smbmount mount the share successfully"
+fi
+
+
+rm -rf $TMNT/*
+
+#run fileio filebench
+cti_execute_cmd $filebenchdir/filebench ${STF_SUITE}/config/filemacro
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: filebench filemacro failed"
+	return
+else
+	cti_report "PASS: filebench filemacro successfully"
+fi
+
+cti_execute_cmd rm -rf $TMNT/*
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/performance/filebench/tp_filebench_003.ksh b/usr/src/test/smbclient-tests/tests/performance/filebench/tp_filebench_003.ksh
new file mode 100644
index 0000000..daa2d42
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/performance/filebench/tp_filebench_003.ksh
@@ -0,0 +1,89 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: filebench_003
+#
+# DESCRIPTION:
+#        Verify filebench filemicro on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. filebench filemicro can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="filebench_003"
+tc_desc=" Verify filebench on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+sleep 3
+
+cmd="ls -l $filebenchdir/filebench"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_report "FAIL: There is no filebench package, please install it."
+	cti_untested $tc_id
+	return
+fi
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the share \"public\" "
+	return
+else
+	cti_report "PASS: smbmount mount the share successfully"
+fi
+
+
+rm -rf $TMNT/*
+
+#run fileio filebench
+cti_execute_cmd $filebenchdir/filebench ${STF_SUITE}/config/filemicro
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: filebench filemicro failed"
+	return
+else
+	cti_report "PASS: filebench filemicro successfully"
+fi
+
+cti_execute_cmd rm -rf $TMNT/*
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/performance/filebench/tp_filebench_004.ksh b/usr/src/test/smbclient-tests/tests/performance/filebench/tp_filebench_004.ksh
new file mode 100644
index 0000000..faeb74a
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/performance/filebench/tp_filebench_004.ksh
@@ -0,0 +1,89 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: filebench_004
+#
+# DESCRIPTION:
+#       Verify filebench on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#	2. filebench randomread can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="filebench_004"
+tc_desc=" Verify filebench on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+sleep 3
+
+cmd="ls -l $filebenchdir/filebench"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_report "FAIL: There is no filebench package, please install it."
+	cti_untested $tc_id
+	return
+fi
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the share \"public\" "
+	return
+else
+	cti_report "PASS: smbmount mount the share successfully"
+fi
+
+
+rm -rf $TMNT/*
+
+#run fileio filebench
+cti_execute_cmd $filebenchdir/filebench ${STF_SUITE}/config/randomread
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: filebench randomread failed"
+	return
+else
+	cti_report "PASS: filebench randomread successfully"
+fi
+
+cti_execute_cmd rm -rf $TMNT/*
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/performance/filebench/tp_filebench_005.ksh b/usr/src/test/smbclient-tests/tests/performance/filebench/tp_filebench_005.ksh
new file mode 100644
index 0000000..dcc0446
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/performance/filebench/tp_filebench_005.ksh
@@ -0,0 +1,88 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: filebench_005
+#
+# DESCRIPTION:
+#       Verify filebench fileio testing on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. run filebench seqread can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="filebench_005"
+tc_desc=" Verify filebench on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+sleep 3
+
+cmd="ls -l $filebenchdir/filebench"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_report "FAIL: There is no filebench package, please install it."
+	cti_untested $tc_id
+	return
+fi
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the share \"public\" "
+	return
+else
+	cti_report "PASS: smbmount mount the share successfully"
+fi
+
+rm -rf $TMNT/*
+
+#run fileio filebench
+cti_execute_cmd $filebenchdir/filebench ${STF_SUITE}/config/seqread
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: filebench fileio failed"
+	return
+else
+	cti_report "PASS: filebench fileio successfully"
+fi
+
+cti_execute_cmd rm -rf $TMNT/*
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/sharectl/Makefile b/usr/src/test/smbclient-tests/tests/sharectl/Makefile
new file mode 100644
index 0000000..866e782
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/sharectl/Makefile
@@ -0,0 +1,29 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+include		../../Makefile.com
+
+ROOTTESTDIR=	$(ROOTOPTPKG)/tests/sharectl
+
+TESTS=	\
+		tp_sharectl_001	\
+		tp_sharectl_002	\
+		tp_sharectl_003	\
+		tp_sharectl_004	\
+		tp_sharectl_005	\
+		tp_sharectl_006
+
+include		../Makefile.tests
diff --git a/usr/src/test/smbclient-tests/tests/sharectl/tp_sharectl_001.ksh b/usr/src/test/smbclient-tests/tests/sharectl/tp_sharectl_001.ksh
new file mode 100644
index 0000000..8de5320
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/sharectl/tp_sharectl_001.ksh
@@ -0,0 +1,82 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: sharectl_001
+#
+# DESCRIPTION:
+#        Verify minauth can work in default
+#
+# STRATEGY:
+#	1. run "sharectl set -p section=default -p minauth=kerberos smbfs"
+#	2. run "smbutil view //$TUSER:$TPASS@$server"
+#	3. sharectl and smbutil can get right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="sharectl001"
+tc_desc=" Verify minauth can work in default"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+cmd="sharectl set -p section=default -p minauth=kerberos smbfs"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: sharectl set minauth in default section failed"
+	return
+else
+	cti_report "succeed: sharectl set minauth in default section succeeded"
+fi
+
+# this should fail
+cmd="smbutil view //$TUSER:$TPASS@$server"
+cti_execute -i '' PASS $cmd
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: smbutil view succeeded for the minauth=kerberos"
+	sharectl delsect default smbfs
+	return
+else
+	cti_report "PASS: smbutil view failed for the minath=kerberos"
+fi
+
+cmd="sharectl delsect default smbfs"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: sharectl delsect default smbfs failed"
+	sharectl delsect default smbfs
+	return
+else
+	cti_report "PASS: sharectl delsect default smbfs succeeded"
+fi
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/sharectl/tp_sharectl_002.ksh b/usr/src/test/smbclient-tests/tests/sharectl/tp_sharectl_002.ksh
new file mode 100644
index 0000000..32264e3
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/sharectl/tp_sharectl_002.ksh
@@ -0,0 +1,116 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: sharectl_002
+#
+# DESCRIPTION:
+#        Verify password can work
+#
+# STRATEGY:
+#       1. run "sharectl set -p section=default -p password=$pass smbfs"
+#       2. run "smbutil view //$TUSER@$server"
+#       3. sharectl and smbutil can get right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="sharectl002"
+tc_desc=" Verify password can work"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+SERVER=$(echo $server|tr "[:lower:]" "[:upper:]")
+pass=$(smbutil crypt $TPASS)
+
+cmd="sharectl set -p section=default -p password=\$pass smbfs"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: sharectl set password in default section failed"
+	return
+else
+	cti_report "PASS: sharectl set password in default section succeeded"
+fi
+
+cmd="smbutil view //$TUSER@$server"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbutil view failed for default password"
+	return
+else
+	cti_report "PASS: smbutil view succeeded for default password"
+fi
+
+sharectl delsect  default smbfs
+
+cmd="sharectl set -p section=$SERVER -p password=\$pass smbfs"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: sharectl set password in $SERVER section failed"
+	return
+else
+	cti_report "PASS: sharectl set password in $SERVER section succeed"
+fi
+
+cmd="sharectl set -p section=$SERVER -p addr=$server smbfs"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: sharectl set addr in $SERVER section failed"
+	sharectl delsect  $SERVER smbfs
+	return
+else
+	cti_report "PASS: sharectl set addr in $SERVER section succeeded"
+fi
+
+cmd="smbutil view //$TUSER@$server"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbutil view failed for SERVER password"
+	sharectl delsect  $SERVER smbfs
+	return
+else
+	cti_report "PASS: smbutil view succeeded for SERVER password"
+fi
+
+cmd="smbutil view //$TUSER1@$server"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbutil view failed by $TUSER1 for SERVER password"
+	sharectl delsect  $SERVER smbfs
+	return
+else
+	cti_report "PASS: smbutil view succeeded by $TUSER1 for SERVER password"
+fi
+
+sharectl delsect  $SERVER smbfs
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/sharectl/tp_sharectl_003.ksh b/usr/src/test/smbclient-tests/tests/sharectl/tp_sharectl_003.ksh
new file mode 100644
index 0000000..cc0944c
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/sharectl/tp_sharectl_003.ksh
@@ -0,0 +1,118 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: sharectl_003
+#
+# DESCRIPTION:
+#        Verify password can work
+#
+# STRATEGY:
+#       1. run "sharectl set -p section=$SERVER:$TUSER -p password=$pass smbfs"
+#       2. run "sharectl set -p section=$SERVER:$TUSER -p addr=$server smbfs"
+#       3. run "smbutil view //$TUSER1@$server"
+#       4. run "mount -F smbfs //$TUSER@$server/public $TMNT"
+#       3. sharectl, smbutil and mount can get right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="sharectl003"
+tc_desc="Verify password can work"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+rm -rf ~root/.nsmbrc
+
+server=$(server_name) || return
+
+pass=$(smbutil crypt $TPASS)
+SERVER=$(echo $server|tr "[:lower:]" "[:upper:]")
+
+cmd="sharectl set -p section=$SERVER:$TUSER -p password=\$pass smbfs"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: sharectl set password in $SERVER section failed"
+	return
+else
+	cti_report "PASS: sharectl set password in $SERVER section succeeded"
+fi
+
+cmd="sharectl set -p section=$SERVER:$TUSER -p addr=$server smbfs"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: sharectl set addr in $SERVER section failed"
+	sharectl delsect  $SERVER:$TUSER smbfs
+	return
+else
+	cti_report "PASS: sharectl set addr in $SERVER section succeeded"
+fi
+
+smbutil logout -a
+
+# get rid of our connection first
+cti_execute_cmd "smbutil discon //$TUSER1@$server"
+sleep 1
+
+cti_report "expect failure next"
+cmd="smbutil view -N //$TUSER1@$server"
+cti_execute -i '' PASS $cmd
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: smbutil view succeeded for SERVER password by $TUSER1"
+	sharectl delsect  $SERVER:$TUSER smbfs
+	return
+else
+	cti_report "PASS: smbutil view ffailed for SERVER password by $TUSER1"
+fi
+
+cmd="mount -F smbfs //$TUSER@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share by $TUSER"
+	sharectl delsect  $SERVER:$TUSER smbfs
+	return
+else
+	cti_report "PASS: smbmount can mount the public share by $TUSER"
+fi
+
+smbmount_check $TMNT
+if [[ $? != 0 ]]; then
+	smbmount_clean $TMNT
+	sharectl delsect  $SERVER:$TUSER smbfs
+	return
+fi
+
+smbmount_clean $TMNT
+sharectl delsect  $SERVER:$TUSER smbfs
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/sharectl/tp_sharectl_004.ksh b/usr/src/test/smbclient-tests/tests/sharectl/tp_sharectl_004.ksh
new file mode 100644
index 0000000..4593232
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/sharectl/tp_sharectl_004.ksh
@@ -0,0 +1,81 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: sharectl_004
+#
+# DESCRIPTION:
+#        Verify minauth can work on user section
+#
+# STRATEGY:
+#       1. run "sharectl set -p section=default -p minauth=kerberos smbfs"
+#       2. run "smbutil view //$TUSER:$TPASS@$server"
+#       3. sharectl and smbutil can get right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="sharectl004"
+tc_desc="Verify minauth can work on user section"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+SERVER=$(echo $server|tr "[:lower:]" "[:upper:]")
+
+cmd="sharectl set -p section=$SERVER -p minauth=kerberos smbfs"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: sharectl set password in SERVER section failed"
+	sharectl delsect $SERVER smbfs
+	return
+else
+	cti_report "PASS: sharectl set password in SERVER section succeeded"
+fi
+
+# get rid of our connection first
+cti_execute_cmd "smbutil discon //$TUSER:$TPASS@$server"
+sleep 1
+
+cti_report "expect failure next"
+cmd="smbutil view //$TUSER:$TPASS@$server"
+cti_execute -i '' PASS $cmd
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: smbutil view succeeded for the minauth=kerberos"
+	sharectl delsect $SERVER smbfs
+	return
+else
+	cti_report "PASS: smbutil view failed for the minauth=kerberos"
+fi
+
+sharectl delsect $SERVER smbfs
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/sharectl/tp_sharectl_005.ksh b/usr/src/test/smbclient-tests/tests/sharectl/tp_sharectl_005.ksh
new file mode 100644
index 0000000..e38c182
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/sharectl/tp_sharectl_005.ksh
@@ -0,0 +1,115 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: sharectl_005
+#
+# DESCRIPTION:
+#        Verify user and domain work in sharctl "default" section
+#
+# STRATEGY:
+#       1. run "sharectl set -p section=default -p password=$pass smbfs"
+#       2. run "sharectl set -p section=default -p user=$TUSER smbfs"
+#       3. run "sharectl set -p section=default -p domain=mydomain smbf"
+#       2. run "mount -F smbfs //$server/public $TMNT"
+#       3. sharectl and mount can get right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="sharectl005"
+tc_desc="Test user and domain in sharctl [default] section."
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+pass=$(smbutil crypt $TPASS)
+cmd="sharectl set -p section=default -p password=\$pass smbfs"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: sharectl set password in default section failed"
+	return
+else
+	cti_report "PASS: sharectl set password in default section succeeded"
+fi
+cmd="sharectl set -p section=default -p user=$TUSER smbfs"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "sharectl set user in default section failed"
+	sharectl delsect default smbfs
+	return
+else
+	cti_report "PASS: sharectl set user in default section succeeded"
+fi
+cmd="sharectl set -p section=default -p domain=mydomain smbfs"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "sharectl set domain in default section failed"
+	sharectl delsect default smbfs
+	return
+else
+	cti_report "PASS sharectl set domain in default section succeeded"
+fi
+
+cmd="smbutil view //$server"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbutil view failed for user and domain properity"
+	sharectl delsect default smbfs
+	return
+else
+	cti_report "PASS: smbutil view suceeded for user and domain properity"
+fi
+
+cmd="mount -F smbfs //$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	sharectl delsect default smbfs
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+smbmount_check $TMNT
+if [[ $? != 0 ]]; then
+	sharectl delsect default smbfs
+	smbmount_clean $TMNT
+	return
+fi
+
+smbmount_clean $TMNT
+sharectl delsect default smbfs
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/sharectl/tp_sharectl_006.ksh b/usr/src/test/smbclient-tests/tests/sharectl/tp_sharectl_006.ksh
new file mode 100644
index 0000000..5063053
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/sharectl/tp_sharectl_006.ksh
@@ -0,0 +1,122 @@
+#!/bin/ksh -p
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: sharectl_006
+#
+# DESCRIPTION:
+#        Verify user and domain can work in sharectl "$SERVER" section
+#
+# STRATEGY:
+#       1. run "sharectl set -p section=$SERVER -p password=$pass smbfs"
+#       2. run "sharectl set -p section=$SERVER -p user=$TUSER smbfs"
+#       3. run "sharectl set -p section=$SERVER -p domain=mydomain smbfs"
+#       4. run "smbutil view //$server"
+#       5. run "mount -F smbfs //$server/public $TMNT"
+#       3. sharectl, smbutil and mount can get right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="sharectl006"
+tc_desc="Test user and domain in sharectl [server] section."
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+pass=$(smbutil crypt $TPASS)
+SERVER=$(echo $server|tr "[:lower:]" "[:upper:]")
+
+cmd="sharectl set -p section=$SERVER -p password=\$pass smbfs"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: sharectl set password in SERVER section failed"
+	sharectl delsect $SERVER smbfs
+	return
+else
+	cti_report "PASS: sharectl set password in SERVER section succeeded"
+fi
+
+cmd="sharectl set -p section=$SERVER -p user=$TUSER smbfs"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: sharectl set user in SERVER section failed"
+	sharectl delsect $SERVER smbfs
+	return
+else
+	cti_report "PASS: sharectl set user in SERVER section succeeded"
+fi
+
+cmd="sharectl set -p section=$SERVER -p domain=mydomain smbfs"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: sharectl set user in SERVER section failed"
+	sharectl delsect $SERVER smbfs
+	return
+else
+	cti_report "PASS: sharectl set user in SERVER section succeeded"
+fi
+
+cmd="smbutil view //$server"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbutil view failed for user and domain properity"
+	sharectl delsect $SERVER smbfs
+	return
+else
+	cti_report "PASS: smbutil view succeeded for user and domain properity"
+fi
+
+cmd="mount -F smbfs //$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	sharectl delsect $SERVER smbfs
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+smbmount_check $TMNT
+if [[ $? != 0 ]]; then
+	smbmount_clean $TMNT
+	sharectl delsect $SERVER smbfs
+	return
+fi
+
+smbmount_clean $TMNT
+sharectl delsect $SERVER smbfs
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/Makefile b/usr/src/test/smbclient-tests/tests/smbfs/Makefile
new file mode 100644
index 0000000..2776ed3
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/Makefile
@@ -0,0 +1,29 @@
+#
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+.PARALLEL:	$(SUBDIRS)
+
+SUBDIRS=	acl		\
+		cptest		\
+		create		\
+		error		\
+		misc		\
+		mkdir		\
+		mmap		\
+		mvtest		\
+		xattr
+
+include		$(SRC)/test/Makefile.com
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/acl/Makefile b/usr/src/test/smbclient-tests/tests/smbfs/acl/Makefile
new file mode 100644
index 0000000..4655c06
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/acl/Makefile
@@ -0,0 +1,28 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+include		../../../Makefile.com
+
+ROOTTESTDIR=	$(ROOTOPTPKG)/tests/smbfs/acl
+
+TESTS=	\
+		tp_acl_001	\
+		tp_acl_002	\
+		tp_acl_003	\
+		tp_acl_004	\
+		tp_acl_005
+
+include		../../Makefile.tests
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/acl/tp_acl_001.ksh b/usr/src/test/smbclient-tests/tests/smbfs/acl/tp_acl_001.ksh
new file mode 100644
index 0000000..f528f11
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/acl/tp_acl_001.ksh
@@ -0,0 +1,118 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: acl_001
+#
+# DESCRIPTION:
+#	Read ACLs in an smbfs mount using "ls"
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. try "ls -V" etc.
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="acl001"
+tc_desc="Verify we can view ACLs with ls"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs -oacl //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# Require that the mount supports ACLs
+smbmount_getmntopts $TMNT |grep /acl/ >/dev/null
+if [[ $? != 0 ]]; then
+	smbmount_clean $TMNT
+	cti_unsupported "UNSUPPORTED (no ACLs in this mount)"
+	return
+fi
+
+# create a file
+cmd="cp /etc/passwd $TMNT/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	return
+fi
+
+# verify "ls -l" shows a plus sign
+cmd="ls -l $TMNT/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	return
+fi
+read mode junk < cti_stdout
+case "$mode" in
+*+)
+	cti_report "PASS: have plus sign"
+	;;
+*)
+	cti_fail "FAIL: no plus sign"
+	smbmount_clean $TMNT
+	return
+esac
+
+# verify "ls -V" shows an ACL
+cmd="ls -V $TMNT/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	return
+fi
+cnt=$(wc -l < cti_stdout)
+if [[ "$cnt" -lt 2 ]] ; then
+	cti_fail "FAIL: no ACEs found"
+	smbmount_clean $TMNT
+	return
+fi
+
+cti_execute_cmd "rm $TMNT/$tc_id"
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/acl/tp_acl_002.ksh b/usr/src/test/smbclient-tests/tests/smbfs/acl/tp_acl_002.ksh
new file mode 100644
index 0000000..561044b
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/acl/tp_acl_002.ksh
@@ -0,0 +1,137 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: acl_002
+#
+# DESCRIPTION:
+#	Copy ACLs to/from and smbfs mount with cpio
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. create a file, make sure it has an ACL
+#       3. cpio -oP -O archive.cpio
+#	4. remove the file
+#	5. cpio -iP -I archive.cpio
+#	6. verify extracted ACL matches original
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="acl002"
+tc_desc="Verify we can save/restore ACLs with cpio"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs -oacl //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# Require that the mount supports ACLs
+smbmount_getmntopts $TMNT |grep /acl/ >/dev/null
+if [[ $? != 0 ]]; then
+	smbmount_clean $TMNT
+	cti_unsupported "UNSUPPORTED (no ACLs in this mount)"
+	return
+fi
+
+# create a file, make sure it has an ACL
+cmd="cp /etc/passwd $TMNT/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	return
+fi
+cmd="ls -V $TMNT/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	return
+fi
+tail +2 cti_stdout > acl_save
+
+#       3. cpio -oP -O archive.cpio
+cmd="echo $tc_id | \
+ ( cd $TMNT ; cpio -ocP -O $TDIR/$tc_id.cpio )"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	return
+fi
+
+#	4. remove the file
+cti_execute_cmd "rm -f $TMNT/$tc_id"
+
+#	5. cpio -iP -I archive.cpio
+cmd="( cd $TMNT ; cpio -icP -I $TDIR/$tc_id.cpio )"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	return
+fi
+
+#	6. verify extracted ACL matches original
+cmd="ls -V $TMNT/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	return
+fi
+tail +2 cti_stdout > acl_test
+
+cmd="diff acl_save acl_test"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	return
+fi
+
+cti_execute_cmd "rm $TDIR/$tc_id.cpio"
+cti_execute_cmd "rm $TMNT/$tc_id"
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/acl/tp_acl_003.ksh b/usr/src/test/smbclient-tests/tests/smbfs/acl/tp_acl_003.ksh
new file mode 100644
index 0000000..4068ac6
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/acl/tp_acl_003.ksh
@@ -0,0 +1,128 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: acl_003
+#
+# DESCRIPTION:
+#	Verify we can modify an ACL (add everyone ACE)
+#
+# STRATEGY:
+#       1. run "mount -F smbfs ..."
+#       2. create a file, make sure it has an ACL
+#       3. chmod A+everyone@:rxaRcs::allow file
+#	4. verify everyone line is there
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="acl003"
+tc_desc="Verify we can modify an ACL (add everyone ACE)"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs -oacl //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# Require that the mount supports ACLs
+smbmount_getmntopts $TMNT |grep /acl/ >/dev/null
+if [[ $? != 0 ]]; then
+	smbmount_clean $TMNT
+	cti_unsupported "UNSUPPORTED (no ACLs in this mount)"
+	return
+fi
+
+# create a file, make sure it has an ACL
+cmd="cp /etc/passwd $TMNT/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	return
+fi
+cmd="ls -V $TMNT/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	return
+fi
+tail +2 cti_stdout > acl_save
+
+#       3. chmod A+everyone@:rxaRcs::allow file
+cmd="chmod A+everyone@:rxaRcs::allow $TMNT/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	return
+fi
+
+#	4. verify everyone line is there
+cmd="ls -V $TMNT/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	return
+fi
+tail +2 cti_stdout > acl_test
+
+# The new ACL should be different, and should contain "everyone@"
+cmd="diff acl_save acl_test"
+cti_execute_cmd $cmd
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: ACL should have changed"
+	smbmount_clean $TMNT
+	return
+fi
+
+grep ' everyone@:' acl_test >/dev/null
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: did not find new ACE"
+	smbmount_clean $TMNT
+	return
+fi
+
+cti_execute_cmd "rm $TMNT/$tc_id"
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/acl/tp_acl_004.ksh b/usr/src/test/smbclient-tests/tests/smbfs/acl/tp_acl_004.ksh
new file mode 100644
index 0000000..9fe17ed
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/acl/tp_acl_004.ksh
@@ -0,0 +1,180 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: acl_004
+#
+# DESCRIPTION:
+#	Verify we can modify an ACL (add $TUSER1)
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //$TUSER@..." $TMNT
+#       2. run "mount -F smbfs //$TUSER1@..." $TMNT2
+#       3. create a file, as $TUSER
+#       4. create file2, as $TUSER1 and get owner UID
+#       5. chmod A+user:$TUSER1@:rxaRcs::allow file
+#	6. verify $TUSER1 ACE is there
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="acl004"
+tc_desc="Verify we can modify an ACL (add user ACE)"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+smbmount_clean $TMNT
+smbmount_clean $TMNT2
+
+smbmount_init $TMNT
+smbmount_init $TMNT2
+
+#       1. run "mount -F smbfs //$TUSER@..." $TMNT
+
+cmd="mount -F smbfs -oacl //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# Require that the mount supports ACLs
+smbmount_getmntopts $TMNT |grep /acl/ >/dev/null
+if [[ $? != 0 ]]; then
+	smbmount_clean $TMNT
+	cti_unsupported "UNSUPPORTED (no ACLs in this mount)"
+	return
+fi
+
+#       2. run "mount -F smbfs //$TUSER1@..." $TMNT2
+
+cmd="mount -F smbfs -oacl //$TUSER1:$TPASS@$server/public $TMNT2"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+#       3. create a file, as $TUSER
+
+cmd="cp /etc/passwd $TMNT/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	smbmount_clean $TMNT2
+	return
+fi
+cmd="ls -V $TMNT/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	smbmount_clean $TMNT2
+	return
+fi
+tail +2 cti_stdout > acl_save
+
+#       4. create a file, as $TUSER1 and get owner UID
+
+cmd="touch $TMNT2/${tc_id}B"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	smbmount_clean $TMNT2
+	return
+fi
+cmd="ls -V $TMNT/${tc_id}B"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	smbmount_clean $TMNT2
+	return
+fi
+# Get the ephemereal UID and GID for $TUSER1
+read mode cnt uid gid junk < cti_stdout
+cti_execute_cmd "rm $TMNT2/${tc_id}B"
+
+#       5. chmod A+user:$TUSER1@:rxaRcs::allow file
+
+cmd="chmod A+user:${uid}:rxaRcs::allow $TMNT/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	smbmount_clean $TMNT2
+	return
+fi
+
+#	6. verify $TUSER1 ACE is there
+
+cmd="ls -V $TMNT/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	smbmount_clean $TMNT2
+	return
+fi
+tail +2 cti_stdout > acl_test
+
+# The new ACL should be different...
+cmd="diff acl_save acl_test"
+cti_execute_cmd $cmd
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: ACL should have changed"
+	smbmount_clean $TMNT
+	smbmount_clean $TMNT2
+	return
+fi
+
+# The new ACL should contain $uid
+grep " user:${uid}:" acl_test >/dev/null
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: did not find new ACE"
+	smbmount_clean $TMNT
+	smbmount_clean $TMNT2
+	return
+fi
+
+cti_execute_cmd "rm $TMNT/$tc_id"
+smbmount_clean $TMNT
+smbmount_clean $TMNT2
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/acl/tp_acl_005.ksh b/usr/src/test/smbclient-tests/tests/smbfs/acl/tp_acl_005.ksh
new file mode 100644
index 0000000..c9c6812
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/acl/tp_acl_005.ksh
@@ -0,0 +1,191 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: acl_005
+#
+# DESCRIPTION:
+#	Verify we can take ownership (chown)
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //$TUSER@..." $TMNT
+#       2. run "mount -F smbfs //$TUSER1@..." $TMNT2
+#       3. create file2, as $TUSER1 and get owner UID
+#       4. create a file as $TUSER
+#	5. give $TUSER1 full control
+#       6. chown UID $TMNT2/file
+#	7. verify $TUSER1 owns it
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="acl005"
+tc_desc="Verify we can take ownership (chown)"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+smbmount_clean $TMNT
+smbmount_clean $TMNT2
+
+smbmount_init $TMNT
+smbmount_init $TMNT2
+
+#       1. run "mount -F smbfs //$TUSER@..." $TMNT
+
+cmd="mount -F smbfs -oacl //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# Require that the mount supports ACLs
+smbmount_getmntopts $TMNT |grep /acl/ >/dev/null
+if [[ $? != 0 ]]; then
+	smbmount_clean $TMNT
+	cti_unsupported "UNSUPPORTED (no ACLs in this mount)"
+	return
+fi
+
+#       2. run "mount -F smbfs //$TUSER1@..." $TMNT2
+
+cmd="mount -F smbfs -oacl //$TUSER1:$TPASS@$server/public $TMNT2"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+#       3. create a file2 as $TUSER1 and get owner UID
+
+cmd="touch $TMNT2/${tc_id}B"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	smbmount_clean $TMNT2
+	return
+fi
+cmd="ls -l $TMNT/${tc_id}B"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	smbmount_clean $TMNT2
+	return
+fi
+# Get the ephemereal UID and GID for $TUSER1
+read mode cnt uid gid junk < cti_stdout
+cti_execute_cmd "rm $TMNT2/${tc_id}B"
+
+#       4. create a file, as $TUSER
+
+cmd="cp /etc/passwd $TMNT/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	smbmount_clean $TMNT2
+	return
+fi
+cmd="ls -l $TMNT/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	smbmount_clean $TMNT2
+	return
+fi
+cp cti_stdout out_save
+
+#	5. give $TUSER1 full control
+cmd="chmod A+user:${uid}:rwxpdDaARWcCos::allow $TMNT/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	smbmount_clean $TMNT2
+	return
+fi
+
+#       6. chown UID $TMNT2/file
+
+cmd="sudo -n chown ${uid} $TMNT2/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	smbmount_clean $TMNT2
+	return
+fi
+
+#	6. verify $TUSER1 owns it
+
+cmd="ls -l $TMNT2/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	smbmount_clean $TMNT
+	smbmount_clean $TMNT2
+	return
+fi
+cp cti_stdout out_test
+
+# The new owner should be different...
+cmd="diff out_save out_test"
+cti_execute_cmd $cmd
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: owner should have changed"
+	smbmount_clean $TMNT
+	smbmount_clean $TMNT2
+	return
+fi
+
+# The new owner should contain $uid
+grep " $uid " out_test >/dev/null
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: did not find $uid"
+	smbmount_clean $TMNT
+	smbmount_clean $TMNT2
+	return
+fi
+
+cti_execute_cmd "rm $TMNT/$tc_id"
+smbmount_clean $TMNT
+smbmount_clean $TMNT2
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/cptest/Makefile b/usr/src/test/smbclient-tests/tests/smbfs/cptest/Makefile
new file mode 100644
index 0000000..b2c94b6
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/cptest/Makefile
@@ -0,0 +1,32 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+include		../../../Makefile.com
+
+ROOTTESTDIR=	$(ROOTOPTPKG)/tests/smbfs/cptest
+
+TESTS=	\
+		tp_cptest_001	\
+		tp_cptest_002	\
+		tp_cptest_003	\
+		tp_cptest_004	\
+		tp_cptest_005	\
+		tp_cptest_006	\
+		tp_cptest_007	\
+		tp_cptest_008	\
+		tp_cptest_009
+
+include		../../Makefile.tests
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_001.ksh b/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_001.ksh
new file mode 100644
index 0000000..56c3bbc
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_001.ksh
@@ -0,0 +1,106 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: cptest_001
+#
+# DESCRIPTION:
+#        Verify cifs client can cp files on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. cp and diff can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="cptest001"
+tc_desc="Verify can cp files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cti_execute_cmd "cp /usr/bin/ls $TMNT/test_file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: cp /usr/bin/ls test_file failed"
+	return
+else
+	cti_report "PASS: cp /usr/bin/ls test_file successfully"
+fi
+
+cti_execute_cmd "cmp -s /usr/bin/ls $TMNT/test_file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: diff /usr/bin/ls test_file failed"
+	return
+else
+	cti_report "PASS: diff /usr/bin/ls test_file succeeded"
+fi
+
+cti_execute_cmd "cp $TMNT/test_file $TDIR/test_file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: cp test_file $TDIR/test_file failed"
+	return
+else
+	cti_report "PASS: cp test_file $TDIR/test_file succeeded"
+fi
+
+cti_execute_cmd "diff /usr/bin/ls $TDIR/test_file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: diff /usr/bin/ls $TDIR/test_file failed"
+	return
+else
+	cti_report "PASS: diff /usr/bin/ls $TDIR/test_file succeeded"
+fi
+
+cti_execute_cmd "rm $TMNT/test_file $TDIR/test_file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: rm test_file $TDIR/test_file failed"
+	return
+else
+	cti_report "PASS: rm test_file $TDIR/test_file succeeded"
+fi
+
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_002.ksh b/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_002.ksh
new file mode 100644
index 0000000..120ff3b
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_002.ksh
@@ -0,0 +1,102 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: cptest_002
+#
+# DESCRIPTION:
+#        Verify cifs client can create and cp 300M file on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. cp and diff can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="cptest002"
+tc_desc="Verify can cp files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cti_execute_cmd "cp $REFFILE $TDIR/test_file"
+cti_execute_cmd "cp $TDIR/test_file $TMNT/test_file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: cp $TDIR/test_file to test_file failed"
+	return
+else
+	cti_report "PASS: cp $TDIR/test_file to test_file succeeded"
+fi
+
+cti_execute_cmd "cmp -s $TMNT/test_file $TDIR/test_file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: diff test_file $TDIR/test_file failed"
+	return
+else
+	cti_report "PASS: diff test_file $TDIR/test_file succeed"
+fi
+
+cti_execute_cmd "cp $TMNT/test_file $TDIR/test_file_cp "
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: cp test_file $TDIR/test_file_cp failed"
+	return
+else
+	cti_report "PASS: cp test_file $TDIR/test_file_cp succeeded"
+fi
+
+cmd="cmp -s $TDIR/test_file $TDIR/test_file_cp"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: diff $TDIR/test_file $TDIR/test_file_cp failed"
+	return
+else
+	cti_report "PASS: diff $TDIR/test_file $TDIR/test_file_cp" \
+	    "succeeded"
+fi
+
+cti_execute_cmd "rm -rf $TMNT/test_file $TDIR/*"
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_003.ksh b/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_003.ksh
new file mode 100644
index 0000000..2217f51
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_003.ksh
@@ -0,0 +1,106 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: cptest_003
+#
+# DESCRIPTION:
+#        Verify can create and cp 150M file on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. cp and diff can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="cptest003"
+tc_desc=" Verify can cp files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+size=150m
+if [[ -n "$STC_QUICK" ]] ; then
+  size=5m
+  # will report SKIP below
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "smbmount can't mount the public share"
+	return
+else
+	cti_report "smbmount can mount the public share"
+fi
+
+cti_execute_cmd "mkfile $size $TDIR/test_file"
+
+cti_execute_cmd "cp $TDIR/test_file $TMNT/test_file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: cp $TDIR/test_file to test_file failed"
+	return
+else
+	cti_report "PASS: cp $TDIR/test_file to test_file succeeded"
+fi
+
+cti_execute_cmd "cmp -s $TDIR/test_file $TMNT/test_file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: diff test_file $TDIR/test_file failed"
+	return
+else
+	cti_report "PASS: diff test_file $TDIR/test_file succeeded"
+fi
+
+cti_execute_cmd "rm $TMNT/test_file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: rm test_file test_file_server failed"
+	return
+else
+	cti_report "PASS: rm test_file test_file_server succeeded"
+fi
+
+cti_execute_cmd "rm -rf $TDIR/*"
+
+smbmount_clean $TMNT
+
+if [[ -n "$STC_QUICK" ]] ; then
+  # Did only 10m test, so report SKIP
+  cti_notinuse "${tc_id}: Copied 5m OK (shortened for STC_QUICK)"
+  return
+fi
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_004.ksh b/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_004.ksh
new file mode 100644
index 0000000..753a736
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_004.ksh
@@ -0,0 +1,107 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: cptest_004
+#
+# DESCRIPTION:
+#        Verify can create and cp 3G file on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. cp and diff can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="cptest004"
+tc_desc="Verify can cp 3g files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+    [[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+	set -x
+fi
+
+# This test is largely redundant with create/tp_create_009
+# so we could probably just delete this test.
+size=3g
+if [[ -n "$STC_QUICK" ]] ; then
+  cti_notinuse "${tc_id}: skipped (STC_QUICK)"
+  return
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "smbmount can't mount the public share"
+	return
+else
+	cti_report "smbmount can mount the public share"
+fi
+
+cti_execute_cmd "mkfile $size $TDIR/test_file"
+cti_execute FAIL "sum $TDIR/test_file"
+read sum1 cnt1 junk < cti_stdout
+
+# cp file to server
+cti_execute_cmd "cp $TDIR/test_file $TMNT/test_file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: cp $TDIR/test_file to test_file failed"
+	return
+else
+	cti_report "PASS: cp $TDIR/test_file to test_file succeeded"
+fi
+
+# compare (which reads the remote file)
+cti_execute FAIL "sum $TMNT/test_file"
+read sum2 cnt2 junk < cti_stdout
+if [[ $sum1 != $sum2 ]] ; then
+	cti_fail "FAIL: first sum of the files are different"
+	return
+else
+	cti_report "PASS: first sums of the files are same"
+fi
+
+cti_execute_cmd "rm $TMNT/test_file"
+if [[ $? != 0 ]]; then
+	cti_fail "rm the test_file failed"
+	return
+else
+	cti_report "rm the test_file successfully"
+fi
+
+cti_execute_cmd "rm -rf $TDIR/*"
+
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_005.ksh b/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_005.ksh
new file mode 100644
index 0000000..ec76c57
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_005.ksh
@@ -0,0 +1,115 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: cptest_005
+#
+# DESCRIPTION:
+#        Verify can cp dir between server and client side
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. cp -r can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="cptest005"
+tc_desc="Verify can cp dir between server and client side"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) ||return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+# mkdir on the local
+cti_execute_cmd "rm -rf $TDIR/*"
+cti_execute_cmd "mkdir $TDIR/test_dir"
+
+# make sure no left over dir in the way, or the cp -r
+# will make a subdir, and fail our later rmdir
+cti_execute_cmd "rm -rf $TMNT/test_dir"
+
+# cp to server
+cti_execute_cmd "cp -r $TDIR/test_dir $TMNT/test_dir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: cp $TDIR/test_dir to server failed"
+	return
+else
+	cti_report "PASS: cp $TDIR/test_dir to server succeeded"
+fi
+
+if [[ ! -d "$TMNT/test_dir" ]]; then
+	cti_fail "FAIL: test_dir doesn't exist on server"
+	return
+else
+	cti_report "PASS: test_dir exists on server"
+fi
+
+# cp dir from the server to local
+cti_execute_cmd "cp -r $TMNT/test_dir $TDIR/test_dir_cp"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: cp test_dir to $TDIR/test_dir_cp failed"
+	return
+else
+	cti_report "PASS: cp test_dir to $TDIR/test_dir_cp succeeded"
+fi
+
+if [[ ! -d "$TDIR/test_dir_cp" ]]; then
+	cti_fail "FAIL: $TDIR/test_dir_cp doesn't exist"
+	return
+else
+	cti_report "PASS: $TDIR/test_dir_cp  exists"
+fi
+
+cti_execute_cmd "rmdir $TMNT/test_dir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: rm test_dir failed"
+	return
+else
+	cti_report "PASS: rm test_dir succeeded"
+fi
+
+cti_execute_cmd "rm -f $TDIR/*"
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_006.ksh b/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_006.ksh
new file mode 100644
index 0000000..144b9b1
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_006.ksh
@@ -0,0 +1,117 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: cptest_006
+#
+# DESCRIPTION:
+#        Verify can cp muti dir/files between server and client
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. cp and diff can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="cptest006"
+tc_desc=" Verify can cp muti dir/files between server and client"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+if [[ -n "$STC_QUICK" ]] ; then
+  cti_notinuse "${tc_id}: skipped (STC_QUICK)"
+  return
+fi
+
+tdir=/kernel/misc
+server=$(server_name)|| return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+cti_execute_cmd "rm -rf $TDIR/*"
+
+# create mutil file/dirs on the local
+cti_execute_cmd "cp -rf $tdir $TDIR/test_dir"
+
+# copy to server
+cti_execute_cmd "cp -rf $TDIR/test_dir $TMNT/test_dir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: cp $TDIR/test_dir to server failed"
+	return
+else
+	cti_report "PASS: cp $TDIR/test_dir to server succeeded"
+fi
+
+# diff the local and server
+cti_execute_cmd "diff -r $TDIR/test_dir $TMNT/test_dir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $TDIR/test_dir is different with server's copy"
+	return
+else
+	cti_report "PASS: $TDIR/test_dir is same with server's copy"
+fi
+
+
+# cp mutil dirs from the server to local
+cti_execute_cmd "cp -rf $TMNT/test_dir $TDIR/test_dir_cp"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: cp test_dir to $TDIR/test_dir_cp failed"
+	return
+else
+	cti_report "PASS: cp test_dir to $TDIR/test_dir_cp succeeded"
+fi
+
+# diff the server to local
+cti_execute_cmd "diff -r $TMNT/test_dir $TDIR/test_dir_cp"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $TDIR/test_dir is different with server's copy"
+	return
+else
+	cti_report "PASS: $TDIR/test_dir is the same with server's copy"
+fi
+
+cti_execute_cmd "rm -rf $TDIR/*"
+cti_execute_cmd "rm -rf $TMNT/*"
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_007.ksh b/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_007.ksh
new file mode 100644
index 0000000..f819e4a
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_007.ksh
@@ -0,0 +1,124 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: cptest_007
+#
+# DESCRIPTION:
+#        Verify can cp muti dir/files between server and local
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. cp and diff can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="cptest007"
+tc_desc=" Verify can cp muti dir/files between server and local"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+if [[ -n "$STC_QUICK" ]] ; then
+  cti_notinuse "${tc_id}: skipped (STC_QUICK)"
+  return
+fi
+
+tdir=/kernel/misc
+server=$(server_name)|| return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+cti_execute_cmd "rm -rf $TDIR/*"
+
+# create mutil file/dirs on the server
+cti_execute_cmd "cp -rf $tdir $TMNT/test_dir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: cp $tdir to test_dir failed"
+	return
+else
+	cti_report "PASS: cp $tdir to test_dir succeeded"
+fi
+
+# cp to local
+cti_execute_cmd "cp -rf  $TMNT/test_dir $TDIR/test_dir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: cp to the local dir:$TDIR/test_dir failed"
+	return
+else
+	cti_report "PASS: cp to the local dir:$TDIR/test_dir failed"
+fi
+
+# diff the server to local
+cti_execute_cmd "diff -r $TMNT/test_dir $TDIR/test_dir"
+if [[ $? != 0 ]]; then
+	cti_fail " $TDIR/test_dir is different with server's copy"
+	return
+else
+	cti_report " $TDIR/test_dir is the same with server's copy"
+fi
+
+# cp muti dir/files from the local to server
+cti_execute_cmd "cp -rf $TDIR/test_dir $TMNT/test_dir_cp"
+if [[ $? != 0 ]]; then
+	cti_fail "cp $TDIR/test_dir to test_dir_cp failed"
+	return
+else
+	cti_report "cp $TDIR/test_dir to test_dir_cp succeeded"
+fi
+
+# diff the server and local
+cti_execute_cmd "diff -r $TDIR/test_dir $TMNT/test_dir_cp"
+if [[ $? != 0 ]]; then
+	cti_fail " $TDIR/test_dir is different with server's copy" \
+	    "test_dir_cp"
+	return
+else
+	cti_report " $TDIR/test_dir is the same with server's copy" \
+	    "test_dir_cp"
+fi
+
+cti_execute_cmd "rm -rf $TDIR/*"
+cti_execute_cmd "rm -rf $TMNT/*"
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_008.ksh b/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_008.ksh
new file mode 100644
index 0000000..c02327c
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_008.ksh
@@ -0,0 +1,104 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: cptest_008
+#
+# DESCRIPTION:
+#        Verify can cp muti dir/files between server and server on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. cp and diff can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="cptest008"
+tc_desc=" Verify can cp muti dir/files between server and local"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+if [[ -n "$STC_QUICK" ]] ; then
+  cti_notinuse "${tc_id}: skipped (STC_QUICK)"
+  return
+fi
+
+# This test is less interesting - pick something small.
+tdir=/kernel/sys
+server=$(server_name)|| return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+# create mutil file/dirs on the server
+cti_execute_cmd  "cp -rf $tdir $TMNT/test_dir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: cp $tdir to test_dir failed"
+	return
+else
+	cti_report "PASS: cp $tdir to test_dir succeeded"
+fi
+
+# cp from to server to server
+cti_execute_cmd "cp -rf  $TMNT/test_dir $TMNT/test_dir_cp"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: cp to the server test_dir_cp failed"
+	return
+else
+	cti_report "PASS: cp to the server test_dir_cp succeeded"
+fi
+
+# diff the server to server
+cti_execute_cmd "diff -r $TMNT/test_dir $TMNT/test_dir_cp"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: test_dir is different with test_dir_cp"
+	return
+else
+	cti_report "PASS: test_dir is same to test_dir_cp"
+fi
+
+cti_execute_cmd "rm -rf $TDIR/*"
+cti_execute_cmd "rm -rf $TMNT/*"
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_009.ksh b/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_009.ksh
new file mode 100644
index 0000000..b806997
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/cptest/tp_cptest_009.ksh
@@ -0,0 +1,98 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: cptest_009
+#
+# DESCRIPTION:
+#        Verify can create and cp 50M file on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. create, cp and diff can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="cptest009"
+tc_desc="Verify can cp files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+if [[ -n "$STC_QUICK" ]] ; then
+  cti_notinuse "${tc_id}: skipped (STC_QUICK)"
+  return
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+# cp file
+
+i=0
+while ((i<10))
+do
+	cp $REFFILE $TMNT/test_file_cp$i  &
+	((i=i+1))
+done
+
+wait
+sleep 5
+
+i=0
+while ((i<10))
+do
+	cti_execute_cmd "diff $REFFILE $TMNT/test_file_cp$i"
+	if [[ $? != 0 ]]; then
+		cti_fail "FAIL: diff test_file and test_file_cp$i failed"
+		return
+	fi
+	((i=i+1))
+done
+
+cti_execute_cmd "rm -rf $TDIR/*"
+cti_execute_cmd "rm -rf $TMNT/*"
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/create/Makefile b/usr/src/test/smbclient-tests/tests/smbfs/create/Makefile
new file mode 100644
index 0000000..795e701
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/create/Makefile
@@ -0,0 +1,35 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+include		../../../Makefile.com
+
+ROOTTESTDIR=	$(ROOTOPTPKG)/tests/smbfs/create
+
+TESTS=	\
+		tp_create_001	\
+		tp_create_002	\
+		tp_create_003	\
+		tp_create_004	\
+		tp_create_005	\
+		tp_create_006	\
+		tp_create_007	\
+		tp_create_008	\
+		tp_create_009	\
+		tp_create_010	\
+		tp_create_011	\
+		tp_create_012
+
+include		../../Makefile.tests
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_001.ksh b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_001.ksh
new file mode 100644
index 0000000..fe30ad5
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_001.ksh
@@ -0,0 +1,97 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: create_001
+#
+# DESCRIPTION:
+#        Verify can create files on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. touch and rm can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="create001"
+tc_desc=" Verify can create files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+# touch file
+cti_execute_cmd "touch $TMNT/file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to touch the file"
+	return
+else
+	cti_report "PASS: touch the file successfully"
+fi
+
+if [[ ! -f "$TMNT/file" ]]; then
+	cti_fail "FAIL: the file should exist, it doesn't exist"
+	return
+else
+	cti_report "PASS: the file exists, it's right"
+fi
+
+cmd="rm $TMNT/file "
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to rm the file"
+	return
+else
+	cti_report "PASS: rm the file successfully"
+fi
+
+if [[  -f "$TMNT/file" ]]; then
+	cti_fail "FAIL: the file should not exist, but it exits"
+	return
+else
+	cti_report "PASS: the file doesn't exist, it's right"
+fi
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_002.ksh b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_002.ksh
new file mode 100644
index 0000000..47fffc6
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_002.ksh
@@ -0,0 +1,99 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: create_002
+#
+# DESCRIPTION:
+#        Verify can create files on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. cp, diff and rm can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="create002"
+tc_desc=" Verify can create files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name)|| return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cmd="cp /usr/bin/ls $TMNT/ls_file"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to cp the /usr/bin/ls file"
+	return
+else
+	cti_report "PASS: cp the /usr/bin/ls file successfully"
+fi
+
+cmd="cmp -s /usr/bin/ls $TMNT/ls_file"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the /usr/bin/ls file is different with the ls_file file"
+	return
+else
+	cti_report "PASS: the /usr/bin/ls file is same to the ls_file file"
+fi
+
+cmd="rm -f $TMNT/ls_file"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to rm the ls_file file"
+	return
+else
+	cti_report "PASS: rm the ls_file file successfully"
+fi
+
+if [[  -f "$TMNT/ls_file" ]]; then
+	cti_fail "FAIL: the ls_file file shouldn't exist, but it exits"
+	return
+else
+	cti_report "PASS: the ls_file file doesn't exist, it's right"
+fi
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_003.ksh b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_003.ksh
new file mode 100644
index 0000000..386ce56
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_003.ksh
@@ -0,0 +1,107 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: create_003
+#
+# DESCRIPTION:
+#        Verify can create 30 byte file on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. dd can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="create003"
+tc_desc="Verify can create files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || rerurn
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+# create 30 byte file
+cmd="dd if=/dev/zero of=$TMNT/file30 bs=30 count=1"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to dd a 30b file"
+	return
+else
+	cti_report "PASS: dd a 30b file successfully"
+fi
+
+if [[ ! -f "$TMNT/file30" ]]; then
+	cti_fail "FAIL: the file file30 shouldn't exist, but it exits"
+	return
+else
+	cti_report "PASS: the file file30 doesn't exist, it's right"
+fi
+
+size=$(file_size $TMNT/file30)
+
+if ((size != 30)); then
+	cti_fail " file size($size) is != 30"
+	return
+fi
+
+# remove file
+cmd="rm $TMNT/file30"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to rm the file30 file"
+	return
+else
+	cti_report "PASS: rm the file30 file successfully"
+fi
+
+if [[  -f "$TMNT/file30" ]]; then
+	cti_fail "FAIL: the file30 file shouldn't exist, but it exits"
+	return
+else
+	cti_report "PASS: the file30 file does not exist, it's right"
+fi
+
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_004.ksh b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_004.ksh
new file mode 100644
index 0000000..1da11a1
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_004.ksh
@@ -0,0 +1,101 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: create_004
+#
+# DESCRIPTION:
+#        Verify can create 50000 byte file on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. dd and rm can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="create004"
+tc_desc=" Verify can create files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+# create 50000 byte file
+cmd="dd if=/dev/zero of=$TMNT/file50000 bs=500 count=100"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to dd a 50000b file"
+	return
+else
+	cti_report "PASS: dd a 50000b file successfully"
+fi
+
+size=$(file_size $TMNT/file50000)
+if ((size != 50000)); then
+	cti_fail "FAIL: the file size($size) is != 50000"
+	return
+else
+	cti_report "PASS: the file size($size) is 50000, it is right"
+fi
+
+
+# remove file
+cmd="rm $TMNT/file50000"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to rm the file50000 file"
+	return
+else
+	cti_report "PASS: rm the file50000 file successfully"
+fi
+
+if [[  -f "$TMNT/file50000" ]]; then
+	cti_fail "FAIL: the file50000 should not exist, but it exists"
+	return
+else
+	cti_report "PASS: the file50000 exists, it is right"
+fi
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_005.ksh b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_005.ksh
new file mode 100644
index 0000000..71905a8
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_005.ksh
@@ -0,0 +1,125 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: create_005
+#
+# DESCRIPTION:
+#        Verify can create files on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. echo and rm can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="create005"
+tc_desc="Verify can create files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+echo "test_test" >$TDIR/file
+echo 'test_test' >$TMNT/file
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to create the file"
+	return
+else
+	cti_report "PASS: create the file successfully"
+fi
+
+if [[ ! -f "$TMNT/file" ]]; then
+	cti_fail "FAIL: the file should exist, but it doesn't exist"
+	return
+else
+	cti_report "PASS: the file exists, it is right"
+fi
+
+cti_execute_cmd "diff $TMNT/file $TDIR/file "
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the first file is different"
+	return
+else
+	cti_report "PASS: the first file is same"
+fi
+
+echo "test_test" >> $TDIR/file
+echo "test_test" >> $TMNT/file
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to create the file"
+	return
+else
+	cti_report "PASS: create the file successfully"
+fi
+
+cti_execute_cmd "diff $TMNT/file $TDIR/file "
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the second file is different"
+	return
+else
+	cti_report "PASS: the second file is same"
+fi
+
+cti_execute_cmd "rm $TMNT/file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to delete the file"
+	return
+else
+	cti_report "PASS: delete the file successfully"
+fi
+
+if [[  -f "$TMNT/file" ]]; then
+	cti_fail "FAIL: the file should not exist, but it exists"
+	return
+else
+	cti_report "PASS: the file exists, it is right"
+fi
+
+cti_execute_cmd "rm  $TDIR/file"
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_006.ksh b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_006.ksh
new file mode 100644
index 0000000..2204676
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_006.ksh
@@ -0,0 +1,128 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: create_006
+#
+# DESCRIPTION:
+#        Verify can create files on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. echo and rm can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="create006"
+tc_desc=" Verify can create files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+echo "test_test" >$TDIR/file
+# create file
+echo 'test_test' >$TMNT/file
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to create the file"
+	return
+else
+	cti_report "PASS: create the file successfully"
+fi
+
+if [[ ! -f "$TMNT/file" ]]; then
+	cti_fail "FAIL: the file should exist, but it doestn't exist"
+	return
+else
+	cti_report "PASS: the file exists, it is right"
+fi
+
+cti_execute_cmd "diff $TMNT/file $TDIR/file "
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the first diff is different"
+	return
+else
+	cti_report "PASS: the first diff is same"
+fi
+
+echo "test_test" >> $TDIR/file
+# create file
+echo "test_test" >> $TMNT/file
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to create the file"
+	return
+else
+	cti_report "PASS: create the file successfully"
+fi
+
+cti_execute_cmd "diff $TMNT/file $TDIR/file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the second diff is different"
+	return
+else
+	cti_report "PASS: the second diff is same"
+fi
+
+
+cti_execute_cmd "rm $TMNT/file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to delete the file"
+	return
+else
+	cti_report "PASS: delete the file successfully"
+fi
+
+if [[  -f "$TMNT/file" ]]; then
+	cti_fail "FAIL: the file should not exist, but it exists"
+	return
+else
+	cti_report "PASS: the file exists, it is right"
+fi
+
+cti_execute_cmd "rm  $TDIR/file"
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_007.ksh b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_007.ksh
new file mode 100644
index 0000000..f382500
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_007.ksh
@@ -0,0 +1,102 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: create_007
+#
+# DESCRIPTION:
+#        Verify can create 200M files on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. create and rm can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="create007"
+tc_desc="Verify can create files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+cti_execute_cmd "mkfile 2m $TDIR/file"
+# create file
+cti_execute_cmd "mkfile 2m $TMNT/file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to create the 20m file"
+	return
+else
+	cti_report "PASS: create the 20m file successfully"
+fi
+
+cti_execute_cmd "cmp -s $TMNT/file $TDIR/file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the files are different"
+	return
+else
+	cti_report "PASS: the files are same"
+fi
+
+cti_execute_cmd "rm $TMNT/file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to delete the file"
+	return
+else
+	cti_report "PASS: delete the file successfully"
+fi
+
+if [[  -f "$TMNT/file" ]]; then
+	cti_fail "FAIL: the file should not exist, but it exits"
+	return
+else
+	cti_report "PASS: the file exists, it is right"
+fi
+
+cti_execute_cmd "rm  $TDIR/file"
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_008.ksh b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_008.ksh
new file mode 100644
index 0000000..3fc4391
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_008.ksh
@@ -0,0 +1,112 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: create_008
+#
+# DESCRIPTION:
+#        Verify can create 1500M file on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. create and rm can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="create008"
+tc_desc="Verify can create 150m files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+size=150m
+if [[ -n "$STC_QUICK" ]] ; then
+  size=5m
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+# create file
+cti_execute_cmd "mkfile $size $TDIR/file"
+cti_execute_cmd "mkfile $size $TMNT/file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to create the $size file"
+	return
+else
+	cti_report "PASS: create the $size file successfully"
+fi
+
+cti_execute_cmd "cmp -s $TMNT/file $TDIR/file "
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the first diff is different"
+	return
+else
+	cti_report "PASS: the first diff is same"
+fi
+
+cti_execute_cmd "rm $TMNT/file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to delete the file"
+	return
+else
+	cti_report "PASS: delete the file successfully"
+fi
+
+if [[  -f "$TMNT/file" ]]; then
+	cti_fail "FAIL: the file should not exist, but it exists"
+	return
+else
+	cti_report "PASS: the file exists, it is right"
+fi
+
+cti_execute_cmd "rm $TDIR/file"
+
+smbmount_clean $TMNT
+
+if [[ -n "$STC_QUICK" ]] ; then
+  cti_notinuse "${tc_id}: Created 5m file (reduced for STC_QUICK)"
+  return
+fi
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_009.ksh b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_009.ksh
new file mode 100644
index 0000000..ada9727
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_009.ksh
@@ -0,0 +1,103 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: create_009
+#
+# DESCRIPTION:
+#        Verify can create 3G file on the smbfs
+#	 (can go beyond 31-bit offsets)
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. create and rm can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="create009"
+tc_desc="Verify can create 3g files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+size=3g
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+# create file on the server
+cmd="dd if=/dev/zero of=$TMNT/file oseek=3071 bs=1024k count=1"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: create $TDIR/test_file to test_file failed"
+	return
+else
+	cti_report "PASS: create $TDIR/test_file to test_file succeeded"
+fi
+
+size=$(file_size $TMNT/file)
+if [[ $size != 3221225472 ]] ; then
+	cti_fail "FAIL: file size is not 3G"
+	return
+else
+	cti_report "PASS: file size if 3G"
+fi
+
+cti_execute_cmd "rm $TMNT/file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to delete the file"
+	return
+else
+	cti_report "PASS: delete the file successfully"
+fi
+
+if [[  -f "$TMNT/file" ]]; then
+	cti_fail "FAIL: the file should not exist, but it exists"
+	return
+else
+	cti_report "PASS: the file exists, it is right"
+fi
+
+cti_execute_cmd "rm  $TDIR/file "
+
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_010.ksh b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_010.ksh
new file mode 100644
index 0000000..7d5cc27
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_010.ksh
@@ -0,0 +1,98 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: create_010
+#
+# DESCRIPTION:
+#        Verify can create and copy 200M file on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. create, cp and rm can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="create010"
+tc_desc="Verify can create files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+if [[ -n "$STC_QUICK" ]] ; then
+  cti_notinuse "${tc_id}: skipped (STC_QUICK)"
+  return
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+cti_execute_cmd "rm -rf $TDIR/*"
+
+# create file
+mkfile 20m $TDIR/file
+cti_execute_cmd "cp $TDIR/file $TMNT/file &"
+pid1=$!
+
+sleep 3
+tail -f $TMNT/file >/dev/null 2>&1 &
+pid2=$!
+
+wait $pid1
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to copy the 20M file"
+	return
+else
+	cti_report "PASS: copied the 20M file successfully"
+fi
+
+sleep 5
+
+cti_execute_cmd "kill -9 $pid2"
+
+sleep 5
+
+cti_execute_cmd "rm $TDIR/file"
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_011.ksh b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_011.ksh
new file mode 100644
index 0000000..24f0406
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_011.ksh
@@ -0,0 +1,94 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: create_011
+#
+# DESCRIPTION:
+#        Verify can create tar file on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. tar and rm can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="create011"
+tc_desc="Verify can create files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+if [[ -n "$STC_QUICK" ]] ; then
+  cti_notinuse "${tc_id}: skipped (STC_QUICK)"
+  return
+fi
+
+# reference dir for copy (ro)
+refdir=/kernel/misc
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+cti_execute_cmd "tar cf $TDIR/kernel.tar $refdir"
+cti_execute_cmd "tar cf $TMNT/kernel.tar $refdir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the tar cf command is failed "
+	return
+else
+	cti_report "PASS: the tar cf command is successful"
+fi
+
+cti_execute_cmd "cmp -s $TMNT/kernel.tar $TDIR/kernel.tar"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the two tar files are different"
+	return
+else
+	cti_report "PASS: the two tar files are same"
+fi
+
+cti_execute_cmd "rm -rf  $TMNT/kernel.tar $TDIR/kernel.tar"
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_012.ksh b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_012.ksh
new file mode 100644
index 0000000..c2dd5c7
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/create/tp_create_012.ksh
@@ -0,0 +1,94 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: create_012
+#
+# DESCRIPTION:
+#        Verify can create 200M file on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. create and rm can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="create012"
+tc_desc="Verify can create files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+if [[ -n "$STC_QUICK" ]] ; then
+  cti_notinuse "${tc_id}: skipped (STC_QUICK)"
+  return
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+# create file
+mkfile 20m $TMNT/file &
+pid1=$!
+
+sleep 3
+tail -f $TMNT/file >/dev/null 2>&1 &
+pid2=$!
+
+wait $pid1
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to create the 20M file on the smbfs"
+	kill -9 $pid2
+	return
+else
+	cti_report "PASS: create the 20M file on the smbfs successfully"
+fi
+
+kill -9 $pid2
+
+cti_execute_cmd "rm -rf $TMNT/*"
+sleep 2
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/error/Makefile b/usr/src/test/smbclient-tests/tests/smbfs/error/Makefile
new file mode 100644
index 0000000..e72e5a3
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/error/Makefile
@@ -0,0 +1,25 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+include		../../../Makefile.com
+
+ROOTTESTDIR=	$(ROOTOPTPKG)/tests/smbfs/error
+
+TESTS=	\
+		tp_error_001	\
+		tp_error_002
+
+include		../../Makefile.tests
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/error/tp_error_001.ksh b/usr/src/test/smbclient-tests/tests/smbfs/error/tp_error_001.ksh
new file mode 100644
index 0000000..bb4c7fc
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/error/tp_error_001.ksh
@@ -0,0 +1,112 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: error_001
+#
+# DESCRIPTION:
+#        Verify link error on the smbfs
+#
+# STRATEGY:
+#        1. run "mount -F smbfs //server/public $TMNT" on the smb
+#        2. touch file and create link
+#	 3. The "ln -s" can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="error001"
+tc_desc=" Verify link error on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "smbmount  can't mount the public share"
+	return
+else
+	cti_report "smbmount  can mount the public share"
+fi
+
+# cleanup
+cti_execute_cmd "rm -rf $TMNT/*"
+
+cti_execute_cmd "touch $TMNT/file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: touch file failed on smbfs"
+	return
+else
+	cti_report "PASS: touch file succeeded on smbfs"
+fi
+
+cti_execute_cmd "(cd $TMNT; ln file file_ln)"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: ln file file_ln succeeded on smbfs"
+	return
+else
+	cti_report "PASS: ln file file_ln failed on smbfs"
+fi
+
+cti_execute_cmd "(cd $TMNT; ln -s file file_ln)"
+if [[ $? == 0 ]]; then
+	cti_fail "ln -s file file_ln succeeded on smbfs"
+	return
+else
+	cti_report "ln -s file file_ln failed on smbfs"
+fi
+cti_execute_cmd "rm $TMNT/file"
+
+cti_execute_cmd "mkdir $TMNT/dir"
+if [[ $? != 0 ]]; then
+	cti_fail "mkdir dir failed on smbfs"
+	return
+else
+	cti_report "mkdir dir succeeded on smbfs"
+fi
+
+cti_execute_cmd "(cd $TMNT; ln -s dir dir_ln)"
+if [[ $? == 0 ]]; then
+	cti_fail "ln -s dir dir_ln succeeded on smbfs"
+	return
+else
+	cti_report "ln -s dir dir_ln failed on smbfs"
+fi
+
+cti_execute_cmd "rmdir $TMNT/dir"
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/error/tp_error_002.ksh b/usr/src/test/smbclient-tests/tests/smbfs/error/tp_error_002.ksh
new file mode 100644
index 0000000..eaf107c
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/error/tp_error_002.ksh
@@ -0,0 +1,74 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: error_002
+#
+# DESCRIPTION:
+#        Verify mknod error  on the smbfs
+#
+# STRATEGY:
+#        1. run "mount -F smbfs //server/public $TMNT" on the smb
+#        2. run "mknod file p" command
+#        3. The mknod can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="error002"
+tc_desc=" Verify mknod error  on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cti_execute_cmd "mknod $TMNT/file p"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: mknod file succeeded on smbfs"
+	return
+else
+	cti_report "PASS: mknod file failed on smbfs"
+fi
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/misc/Makefile b/usr/src/test/smbclient-tests/tests/smbfs/misc/Makefile
new file mode 100644
index 0000000..9480eaf
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/misc/Makefile
@@ -0,0 +1,26 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+include		../../../Makefile.com
+
+ROOTTESTDIR=	$(ROOTOPTPKG)/tests/smbfs/misc
+
+TESTS=	\
+		tp_misc_001	\
+		tp_misc_002	\
+		tp_misc_003
+
+include		../../Makefile.tests
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/misc/tp_misc_001.ksh b/usr/src/test/smbclient-tests/tests/smbfs/misc/tp_misc_001.ksh
new file mode 100644
index 0000000..654152d
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/misc/tp_misc_001.ksh
@@ -0,0 +1,77 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: misc_001
+#
+# DESCRIPTION:
+#        Verify can truncate files on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. truncate and rm can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="misc001"
+tc_desc=" Verify can truncate files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount  can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount  can mount the public share"
+fi
+
+# truncate file
+cmd="file_trunc -f 4194304 -b 8192 -c 100 -s 0 -o 10 $TMNT/test_file"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: truncate file failed"
+	return
+else
+	cti_report "PASS: truncate file succeeded"
+fi
+
+cti_execute_cmd "rm $TMNT/test_file"
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/misc/tp_misc_002.ksh b/usr/src/test/smbclient-tests/tests/smbfs/misc/tp_misc_002.ksh
new file mode 100644
index 0000000..295bd59
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/misc/tp_misc_002.ksh
@@ -0,0 +1,109 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: misc_002
+#
+# DESCRIPTION:
+#	Verify attribute cache invalidation after
+#	some higher-level directory is renamed.
+#
+# STRATEGY:
+#	1. run "mount -F smbfs //server/public /export/mnt"
+#	2. mkdir a/b/c/d
+#	3. mv a z
+#	4. mkdir a
+#	5. verify stat of a/b/c shows ENOENT
+#	(All steps must be completed in less than a few seconds.)
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="misc002"
+tc_desc=" Verify attribute cache invalidation under renamed directory"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name)||return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cmd="mkdir -p $TMNT/a/b/c"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	return
+fi
+
+cmd="mv $TMNT/a $TMNT/z"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	return
+fi
+
+cmd="mkdir $TMNT/a"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	return
+fi
+
+# a should exist, but should have nothing under it.
+if [[ -d $TMNT/a/b/c ]] ; then
+	cti_fail "FAIL: a/b/c/d still exists"
+	return
+fi
+
+# z should exist, and z/b/c
+if [[ ! -d $TMNT/z ]] ; then
+	cti_fail "FAIL: dir 'z' missing"
+	return
+fi
+if [[ ! -d $TMNT/z/b/c ]] ; then
+	cti_fail "FAIL: dir 'z/b/c/d' missing"
+	return
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+smbmount_clean $TMNT
+cti_pass "$tc_id: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/misc/tp_misc_003.ksh b/usr/src/test/smbclient-tests/tests/smbfs/misc/tp_misc_003.ksh
new file mode 100644
index 0000000..421a5ca
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/misc/tp_misc_003.ksh
@@ -0,0 +1,113 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: misc_003
+#
+# DESCRIPTION:
+#	Verify reconnect after connection to server is lost.
+#
+# STRATEGY:
+#	1. run "mount -F smbfs //server/public /export/mnt"
+#	2. create a file
+#	3. force the connection to drop
+#	4. read the file (from step 2)
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="misc003"
+tc_desc=" Verify reconnect after connection loss."
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name)||return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+#	1. run "mount -F smbfs //server/public /export/mnt"
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+#	2. create a file
+
+cmd="touch $TMNT/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	return
+fi
+
+#	3. force the connection to drop
+#	(SMB uses port: 445)
+
+cmd="abort_conn -p 445 $server "
+cti_execute_cmd sudo -n $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	return
+fi
+sleep 2
+
+#	Would be nice to verify the connections are IDLE,
+#	but it can be tricky to identify which is ours.
+#	For now, just log the connection states here.
+#	Our connetion will show state "IDLE".
+
+cmd="echo '::nsmb_vc' |sudo -n mdb -k"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	return
+fi
+
+#	4. read the file (from step 2)
+#	This will initiate a reconnect.
+
+cmd="ls -l $TMNT/$tc_id"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	return
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+smbmount_clean $TMNT
+cti_pass "$tc_id: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mkdir/Makefile b/usr/src/test/smbclient-tests/tests/smbfs/mkdir/Makefile
new file mode 100644
index 0000000..ce23418
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mkdir/Makefile
@@ -0,0 +1,29 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+include		../../../Makefile.com
+
+ROOTTESTDIR=	$(ROOTOPTPKG)/tests/smbfs/mkdir
+
+TESTS=	\
+		tp_mkdir_001	\
+		tp_mkdir_002	\
+		tp_mkdir_003	\
+		tp_mkdir_004	\
+		tp_mkdir_005	\
+		tp_mkdir_006
+
+include		../../Makefile.tests
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_001.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_001.ksh
new file mode 100644
index 0000000..5de1f2c
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_001.ksh
@@ -0,0 +1,84 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: mkdir_001
+#
+# DESCRIPTION:
+#        Verify cifs client can create dir on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mkdir and rmdir can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mkdir001"
+tc_desc=" Verify can create dir on smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+# mkdir
+cti_execute_cmd  "mkdir $TMNT/testdir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: mkdir testdir failed"
+	return
+else
+	cti_report "PASS: mkdir testdir succeeded"
+fi
+
+cti_execute_cmd "rmdir $TMNT/testdir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: rmdir testdir failed"
+	return
+else
+	cti_report "PASS: rmdir testdir succeeded"
+fi
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_002.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_002.ksh
new file mode 100644
index 0000000..7ec88bc
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_002.ksh
@@ -0,0 +1,93 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: mkdir_002
+#
+# DESCRIPTION:
+#        Verify cifs client can create multi-directories on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mkdir and rmdir -p can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mkdir002"
+tc_desc=" Verify can create dir on smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS:smbmount can mount the public share"
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+testdir="dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dir10"
+
+# mkdir on server
+cti_execute_cmd  "(cd $TDIR; mkdir -p $testdir)"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: mkdir -p $TDIR failed"
+	return
+else
+	cti_report "PASS: mkdir -p $TDIR succeeded"
+fi
+
+cti_execute_cmd "(cd $TDIR; rmdir -p $testdir)"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: rmdir -p $TDIR failed"
+	return
+else
+	cti_report "PASS: rmdir -p $TDIR succeeded"
+fi
+
+if [[ -d $TMNT/dir1 ]]; then
+	cti_fail "FAIL: the dir dir1 exists"
+	return
+else
+	cti_report "PASS: the dir dir1 doesn't exist"
+fi
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_003.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_003.ksh
new file mode 100644
index 0000000..09c6db9
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_003.ksh
@@ -0,0 +1,112 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: mkdir_003
+#
+# DESCRIPTION:
+#        Verify cifs client can create multi dirs on the smbfs mount point
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mkdir and rmdir can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mkdir003"
+tc_desc=" Verify can muti dir operation on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name)||return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+# mkdir on smbfs
+cti_execute_cmd  "mkdir $TMNT/testdir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: mkdir testdir failed"
+	return
+else
+	cti_report "PASS: mkdir testdir succeeded"
+fi
+
+# list dir
+cti_execute_cmd "ls -ld $TMNT/testdir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: ls -ld testdir failed"
+	return
+else
+	cti_report "PASS: ls -ld testdir succeeded"
+fi
+
+# access dir
+cti_execute_cmd "ls -l $TMNT/testdir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: ls -l testdir failed"
+	return
+else
+	cti_report "PASS: ls -l testdir succeeded"
+fi
+
+# negative mkdir case
+cti_execute_cmd "mkdir $TMNT/testdir"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: 2nd mkdir testdir should fail"
+	return
+else
+	cti_report "PASS: 2nd mkdir testdir failed"
+fi
+
+# rmdir
+cti_execute_cmd "rmdir $TMNT/testdir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: rmdir testdir failed"
+	return
+else
+	cti_report "PASS: rmdir testdir succeeded"
+fi
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_004.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_004.ksh
new file mode 100644
index 0000000..834ef64
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_004.ksh
@@ -0,0 +1,124 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: mkdir_004
+#
+# DESCRIPTION:
+#        Verify can muti dir operation on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mkdir and rmdir can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mkdir004"
+tc_desc=" Verify can muti dir operation on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name)||return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount  can mount the public share"
+	return
+else
+	cti_report "PASS: smbmount  can't mount the public share"
+fi
+
+cpath=$(pwd)
+cti_execute_cmd "rm -rf $TMNT/*"
+
+# create 40 testdir
+i=1
+while ((i<40)); do
+	cti_execute_cmd "mkdir $TMNT/testdir$i"
+	if [[ $? != 0 ]]; then
+		cti_fail "FAIL: mkdir testdir$i faled"
+		return
+	fi
+	((i=i+1))
+done
+
+cti_execute FAIL "ls -la $TMNT"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: ls -la failed"
+	return
+else
+	cti_report "PASS: ls -la succeeded"
+fi
+
+# del the 40 testdir
+i=1
+while ((i<40)); do
+	cti_execute_cmd "rmdir $TMNT/testdir$i"
+	if [[ $? != 0 ]]; then
+		cti_fail "FAIL: rmdir testdir$i failed"
+		return
+	fi
+	((i=i+1))
+done
+
+# create 40 deep dir
+cdir=$(pwd)
+i=1
+d=testdir_a1
+while ((i<40)); do
+	cti_execute_cmd "mkdir $TMNT/$d"
+	if [[ $? != 0 ]]; then
+		cti_fail "FAIL: mkdir testdir_a$i failed"
+		return
+	fi
+	((i=i+1))
+	d=$d/testdir_a$i
+done
+
+# find on dirs
+cti_execute FAIL "find $TMNT"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: find . failed"
+	return
+else
+	cti_report "PASS: find . succeeded"
+fi
+
+# clean up
+cti_execute_cmd "rm -rf $TMNT/*"
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_005.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_005.ksh
new file mode 100644
index 0000000..fc78857
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_005.ksh
@@ -0,0 +1,93 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: mkdir_005
+#
+# DESCRIPTION:
+#        Verify cifs client can create dir on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mkdir and rmdir can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mkdir005"
+tc_desc=" Verify can muti dir operation on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name)||return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount  can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount  can mount the public share"
+fi
+
+# mkdir on smbfs
+cti_execute_cmd "mkdir $TMNT/testdir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: mkdir testdir failed"
+	return
+else
+	cti_report "PASS: mkdir dir(testdir) succeeded"
+fi
+
+# create file on a exist dir
+cti_execute_cmd "cat /usr/bin/ls > $TMNT/testdir"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: cat /usr/bin/ls > testdir should failed"
+	return
+else
+	cti_report "PASS: cat /usr/bin/ls > testdir failed"
+fi
+
+# rmdir
+cti_execute_cmd "rmdir $TMNT/testdir"
+if [[ $? != 0 ]]; then
+	cti_fail "rmdir testdir failed "
+	return
+else
+	cti_report "rmdir testdir succeeded "
+fi
+
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_006.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_006.ksh
new file mode 100644
index 0000000..83f5dc4
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mkdir/tp_mkdir_006.ksh
@@ -0,0 +1,87 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: mkdir_006
+#
+# DESCRIPTION:
+#        Verify can muti dir operation and create tar file on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mkdir and rmdir can get the right message
+#       3. tar can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mkdir006"
+tc_desc=" Verify can muti dir operation on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name)||return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+# mkdir
+cti_execute_cmd "mkdir -p $TMNT/testdir01/dir002"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: mkdir testdir01/dir02 failed"
+	return
+else
+	cti_report "PASS: mkdir testdir01/dir02 succeeded"
+fi
+
+# create tar file
+cti_execute_cmd "(cd $TMNT; tar cvf test.tar testdir01)"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: create tar file failed"
+	return
+else
+	cti_report "PASS: create tar file succeeded"
+fi
+
+# delete the tar file and directory
+cti_execute_cmd "rm -rf $TMNT/*"
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mmap/Makefile b/usr/src/test/smbclient-tests/tests/smbfs/mmap/Makefile
new file mode 100644
index 0000000..dee1434
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mmap/Makefile
@@ -0,0 +1,33 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+include		../../../Makefile.com
+
+ROOTTESTDIR=	$(ROOTOPTPKG)/tests/smbfs/mmap
+
+TESTS=	\
+		tp_mmap_001	\
+		tp_mmap_002	\
+		tp_mmap_003	\
+		tp_mmap_004	\
+		tp_mmap_005	\
+		tp_mmap_006	\
+		tp_mmap_007	\
+		tp_mmap_008	\
+		tp_mmap_009	\
+		tp_mmap_010
+
+include		../../Makefile.tests
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_001.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_001.ksh
new file mode 100644
index 0000000..f33d248
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_001.ksh
@@ -0,0 +1,125 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+# Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
+
+#
+# mmap test purpose
+#
+# __stc_assertion_start
+#
+# ID: mmap_001
+#
+# DESCRIPTION:
+#        Verify smbfs-mmap can putpage with block i/o
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mkfile in local testdir
+#	3. with continuous mmap, cp the file into smbfs
+#	4. diff src file and des file
+# KEYWORDS:
+#
+# TESTABILITY: explicit
+#
+# __stc_assertion_end
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mmap001"
+tc_desc=" Verify smbfs-mmap can putpage with block i/o"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+# Note: size should be prime (see cp_mmap)
+size=1123k
+
+server=$(server_name) || return
+
+testdir=$TDIR
+mnt_point=$TMNT
+
+testdir_init $testdir
+smbmount_clean $mnt_point
+smbmount_init $mnt_point
+
+test_file="tmp001"
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $mnt_point"
+cti_execute -i '' FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+# make a local file
+
+cmd="mkfile_mmap -n $size -f ${testdir}/${test_file}"
+cti_execute FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return $?
+else
+	cti_report "PASS: $cmd"
+fi
+
+# continuously mmap and read the local file, then write into the smbfs file
+
+cmd="cp_mmap -t c -f ${testdir}/${test_file} ${mnt_point}/${test_file}"
+cti_execute FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# diff the local file & smbfs file
+
+cti_execute_cmd "sum ${testdir}/${test_file}"
+read sum1 cnt1 junk < cti_stdout
+cti_report "local sum $sum1 $cnt1"
+
+cti_execute_cmd "sum ${mnt_point}/${test_file}"
+read sum2 cnt2 junk < cti_stdout
+cti_report "smbfs sum $sum2 $cnt2"
+
+if [[ $sum1 != $sum2 ]] ; then
+        cti_fail "FAIL: the files are different"
+        return
+else
+        cti_report "PASS: the files are the same"
+fi
+
+cti_execute_cmd "rm -rf $testdir/*"
+cti_execute_cmd "rm -f ${mnt_point}/${test_file}"
+
+smbmount_clean $mnt_point
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_002.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_002.ksh
new file mode 100644
index 0000000..531aac1
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_002.ksh
@@ -0,0 +1,125 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+# Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
+
+#
+# mmap test purpose
+#
+# __stc_assertion_start
+#
+# ID: mmap_002
+#
+# DESCRIPTION:
+#        Verify smbfs-mmap can putpage without block i/o
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mkfile in local testdir
+#	3. with discrete mmap, cp the file into smbfs
+#	4. diff src file and des file
+# KEYWORDS:
+#
+# TESTABILITY: explicit
+#
+# __stc_assertion_end
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mmap002"
+tc_desc=" Verify smbfs-mmap can putpage without block i/o"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+# Note: size should be prime (see cp_mmap)
+size=1123k
+
+server=$(server_name) || return
+
+testdir=$TDIR
+mnt_point=$TMNT
+
+testdir_init $testdir
+smbmount_clean $mnt_point
+smbmount_init $mnt_point
+
+test_file="tmp002"
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $mnt_point"
+cti_execute -i '' FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+# make a local file
+
+cmd="mkfile_mmap -n $size -f ${testdir}/${test_file}"
+cti_execute FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# discontinuously mmap and read the local file, then write into the smbfs file
+
+cmd="cp_mmap -t d -f ${testdir}/${test_file} ${mnt_point}/${test_file}"
+cti_execute FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# diff the local file & smbfs file
+
+cti_execute_cmd "sum ${testdir}/${test_file}"
+read sum1 cnt1 junk < cti_stdout
+cti_report "local sum $sum1 $cnt1"
+
+cti_execute_cmd "sum ${mnt_point}/${test_file}"
+read sum2 cnt2 junk < cti_stdout
+cti_report "smbfs sum $sum2 $cnt2"
+
+if [[ $sum1 != $sum2 ]] ; then
+        cti_fail "FAIL: the files are different"
+        return
+else
+        cti_report "PASS: the files are the same"
+fi
+
+cti_execute_cmd "rm -rf $testdir/*"
+cti_execute_cmd "rm -f ${mnt_point}/${test_file}"
+
+smbmount_clean $mnt_point
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_003.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_003.ksh
new file mode 100644
index 0000000..1693c51
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_003.ksh
@@ -0,0 +1,125 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+# Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
+
+#
+# mmap test purpose
+#
+# __stc_assertion_start
+#
+# ID: mmap_003
+#
+# DESCRIPTION:
+#        Verify smbfs-mmap can getpage with block i/o
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mkfile in smbfs
+#	3. with continuous mmap, cp the file into local dir
+#	4. diff src file and des file
+# KEYWORDS:
+#
+# TESTABILITY: explicit
+#
+# __stc_assertion_end
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mmap003"
+tc_desc=" Verify smbfs-mmap can getpage with block i/o"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+# Note: size should be prime (see cp_mmap)
+size=1123k
+
+server=$(server_name) || return
+
+testdir=$TDIR
+mnt_point=$TMNT
+
+testdir_init $testdir
+smbmount_clean $mnt_point
+smbmount_init $mnt_point
+
+test_file="tmp003"
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $mnt_point"
+cti_execute -i '' FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+# make a smbfs file
+
+cmd="mkfile_mmap -n $size -f ${mnt_point}/${test_file}"
+cti_execute FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# continuously mmap and read the smbfs file, then write into a local file
+
+cmd="cp_mmap -t c -f ${mnt_point}/${test_file} ${testdir}/${test_file}"
+cti_execute FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# diff the local file & smbfs file
+
+cti_execute_cmd "sum ${testdir}/${test_file}"
+read sum1 cnt1 junk < cti_stdout
+cti_report "local sum $sum1 $cnt1"
+
+cti_execute_cmd "sum ${mnt_point}/${test_file}"
+read sum2 cnt2 junk < cti_stdout
+cti_report "smbfs sum $sum2 $cnt2"
+
+if [[ $sum1 != $sum2 ]] ; then
+        cti_fail "FAIL: the files are different"
+        return
+else
+        cti_report "PASS: the files are the same"
+fi
+
+cti_execute_cmd "rm -rf $testdir/*"
+cti_execute_cmd "rm -f ${mnt_point}/${test_file}"
+
+smbmount_clean $mnt_point
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_004.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_004.ksh
new file mode 100644
index 0000000..f85ef19
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_004.ksh
@@ -0,0 +1,125 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+# Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
+
+#
+# mmap test purpose
+#
+# __stc_assertion_start
+#
+# ID: mmap_004
+#
+# DESCRIPTION:
+#        Verify smbfs-mmap can getpage without block i/o
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mkfile in smbfs
+#	3. with discrete mmap, cp the file into local dir
+#	4. diff src file and des file
+# KEYWORDS:
+#
+# TESTABILITY: explicit
+#
+# __stc_assertion_end
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mmap004"
+tc_desc=" Verify smbfs-mmap can getpage without block i/o"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+# Note: size should be prime (see cp_mmap)
+size=1123k
+
+server=$(server_name) || return
+
+testdir=$TDIR
+mnt_point=$TMNT
+
+testdir_init $testdir
+smbmount_clean $mnt_point
+smbmount_init $mnt_point
+
+test_file="tmp004"
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $mnt_point"
+cti_execute -i '' FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+# make a smbfs file
+
+cmd="mkfile_mmap -n $size -f ${mnt_point}/${test_file}"
+cti_execute FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# discontinuously mmap and read the smbfs file, then write into a local file
+
+cmd="cp_mmap -t d -f ${mnt_point}/${test_file} ${testdir}/${test_file}"
+cti_execute FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# diff the local file & smbfs file
+
+cti_execute_cmd "sum ${testdir}/${test_file}"
+read sum1 cnt1 junk < cti_stdout
+cti_report "local sum $sum1 $cnt1"
+
+cti_execute_cmd "sum ${mnt_point}/${test_file}"
+read sum2 cnt2 junk < cti_stdout
+cti_report "smbfs sum $sum2 $cnt2"
+
+if [[ $sum1 != $sum2 ]] ; then
+        cti_fail "FAIL: the files are different"
+        return
+else
+        cti_report "PASS: the files are the same"
+fi
+
+cti_execute_cmd "rm -rf $testdir/*"
+cti_execute_cmd "rm -f ${mnt_point}/${test_file}"
+
+smbmount_clean $mnt_point
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_005.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_005.ksh
new file mode 100644
index 0000000..5e72acf
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_005.ksh
@@ -0,0 +1,120 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+# Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
+
+#
+# mmap test purpose
+#
+# __stc_assertion_start
+#
+# ID: mmap_005
+#
+# DESCRIPTION:
+#       Verify compatibility between open(O_RDONLY) &
+#	  mmap(PROT_READ|PROT_WRITE, MAP_SHARED)
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mkfile in smbfs & local dir, with the same size
+#	3. open(O_RDONLY) & mmap(PROT_READ|PROT_WRITE, MAP_SHARED) the smbfs file
+#	4. read data from the local file and write into the smbfs file
+#	4. diff the smbfs file before written & after written
+# KEYWORDS:
+#
+# TESTABILITY: explicit
+#
+# __stc_assertion_end
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mmap005"
+tc_desc=" Verify EACCES with open(O_RDONLY) & mmap(rw, s)"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+size=1111k
+
+server=$(server_name) || return
+
+testdir=$TDIR
+mnt_point=$TMNT
+
+testdir_init $testdir
+smbmount_clean $mnt_point
+smbmount_init $mnt_point
+
+test_file="tmp005"
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $mnt_point"
+cti_execute -i '' FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# make a smbfs file
+cmd="mkfile_mmap -n $size -f ${mnt_point}/${test_file}"
+cti_execute FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# make a local file, with the same size
+cmd="mkfile_mmap -n $size -f ${testdir}/${test_file}"
+cti_execute FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# open(O_RDONLY) & mmap(PROT_READ|PROT_WRITE, MAP_SHARED) the smbfs file,
+# verify can not map write-shared on read-only file
+cti_report "expect EACCESS next"
+cmd="prot_mmap -o r r -m rs rws -f \
+  ${testdir}/${test_file} ${mnt_point}/${test_file}"
+cti_execute_cmd $cmd
+if (($?==0)); then
+	cti_fail "FAIL: should be EACCES: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+cti_execute_cmd "rm -rf $testdir/*"
+cti_execute_cmd "rm -f ${mnt_point}/${test_file}"
+
+smbmount_clean $mnt_point
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_006.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_006.ksh
new file mode 100644
index 0000000..98b876c
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_006.ksh
@@ -0,0 +1,137 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+# Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
+
+#
+# mmap test purpose
+#
+# __stc_assertion_start
+#
+# ID: mmap_006
+#
+# DESCRIPTION:
+#       Verify compatibility between open(O_RDWR) &
+#	  mmap(PROT_READ|PROT_WRITE, MAP_SHARED)
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mkfile in smbfs & local dir, with the same size
+#	3. open(O_RDWR) & mmap(PROT_READ|PROT_WRITE, MAP_SHARED) the smbfs file
+#	4. read data from the local file and write into the smbfs file
+#	4. diff the 2 files
+# KEYWORDS:
+#
+# TESTABILITY: explicit
+#
+# __stc_assertion_end
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mmap006"
+tc_desc=" Verify compatibility between open(O_RDWR) & mmap(rw, s)"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+size=1111k
+
+server=$(server_name) || return
+
+testdir=$TDIR
+mnt_point=$TMNT
+
+testdir_init $testdir
+smbmount_clean $mnt_point
+smbmount_init $mnt_point
+
+test_file="tmp006"
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $mnt_point"
+cti_execute -i '' FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# make a smbfs file
+cmd="mkfile_mmap -n $size -f ${mnt_point}/${test_file}"
+cti_execute FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# make a local file, with the same size
+cmd="mkfile_mmap -n $size -f ${testdir}/${test_file}"
+cti_execute FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# open(O_RDWR) & mmap(PROT_READ|PROT_WRITE, MAP_SHARED) the smbfs file,
+# verify if can write it
+cmd="prot_mmap -o r rw -m rs rws -f \
+  ${testdir}/${test_file} ${mnt_point}/${test_file}"
+cti_execute FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# diff the local file & smbfs file
+
+cti_execute_cmd "sum ${testdir}/${test_file}"
+read sum1 cnt1 junk < cti_stdout
+cti_report "local sum $sum1 $cnt1"
+
+cti_execute_cmd "sum ${mnt_point}/${test_file}"
+read sum2 cnt2 junk < cti_stdout
+cti_report "smbfs sum $sum2 $cnt2"
+
+# verify the data has been written back to the smbfs file
+if [[ $sum1 != $sum2 ]] ; then
+        cti_fail "FAIL: the files are different"
+        return
+else
+        cti_report "PASS: the files are the same"
+fi
+
+cti_execute_cmd "rm -rf $testdir/*"
+cti_execute_cmd "rm -f ${mnt_point}/${test_file}"
+
+smbmount_clean $mnt_point
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_007.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_007.ksh
new file mode 100644
index 0000000..b2e4aeb
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_007.ksh
@@ -0,0 +1,137 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+# Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
+
+#
+# mmap test purpose
+#
+# __stc_assertion_start
+#
+# ID: mmap_007
+#
+# DESCRIPTION:
+#       Verify compatibility between open(O_RDWR) &
+#	  mmap(PROT_READ|PROT_WRITE, MAP_PRIVATE)
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mkfile in smbfs & local dir, with the same size
+#	3. open(O_RDWR) & mmap(PROT_READ|PROT_WRITE, MAP_PRIVATE) the smbfs file
+#	4. read data from the local file and write into the smbfs file
+#	4. diff the smbfs file before written & after written
+# KEYWORDS:
+#
+# TESTABILITY: explicit
+#
+# __stc_assertion_end
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mmap007"
+tc_desc=" Verify compatibility between open(O_RDWR) & mmap(rw, p)"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+size=1111k
+
+server=$(server_name) || return
+
+testdir=$TDIR
+mnt_point=$TMNT
+
+testdir_init $testdir
+smbmount_clean $mnt_point
+smbmount_init $mnt_point
+
+test_file="tmp007"
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $mnt_point"
+cti_execute -i '' FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# make a smbfs file
+cmd="mkfile_mmap -n $size -f ${mnt_point}/${test_file}"
+cti_execute FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# make a local file, with the same size
+cmd="mkfile_mmap -n $size -f ${testdir}/${test_file}"
+cti_execute FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# backup the sum before write the smbfs file
+cti_execute_cmd "sum ${mnt_point}/${test_file}"
+read sum1 cnt1 junk < cti_stdout
+cti_report "before sum $sum1 $cnt1"
+
+# open(O_RDWR) & mmap(PROT_READ|PROT_WRITE, MAP_PRIVATE) the smbfs file,
+# verify if can write it
+cmd="prot_mmap -o r rw -m rs rwp -f \
+  ${testdir}/${test_file} ${mnt_point}/${test_file}"
+cti_execute FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# recalc the sum of the smbfs file
+cti_execute_cmd "sum ${mnt_point}/${test_file}"
+read sum2 cnt2 junk < cti_stdout
+cti_report "after sum $sum2 $cnt2"
+
+# verify the the smbfs file not changed
+if [[ $sum1 != $sum2 ]] ; then
+        cti_fail "FAIL: the smbfs file changed"
+	return
+else
+        cti_report "PASS: the smbfs file not changed"
+fi
+
+cti_execute_cmd "rm -rf $testdir/*"
+cti_execute_cmd "rm -f ${mnt_point}/${test_file}"
+
+smbmount_clean $mnt_point
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_008.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_008.ksh
new file mode 100644
index 0000000..97f4c9d
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_008.ksh
@@ -0,0 +1,120 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+# Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
+
+#
+# mmap test purpose
+#
+# __stc_assertion_start
+#
+# ID: mmap_008
+#
+# DESCRIPTION:
+#        Verify smbfs will keep the SMB FID alive when
+#	 there are mapped pages associated with it.
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mkfile in smbfs
+#	3. open, mmap & close the file, then write data into the mapped addr
+#	4. verify the data successfully written back to smb server
+# KEYWORDS:
+#
+# TESTABILITY: explicit
+#
+# __stc_assertion_end
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mmap008"
+tc_desc=" Verify smbfs will keep the SMB FID alive when there are
+ mapped pages associated with it"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir=$TDIR
+mnt_point=$TMNT
+
+testdir_init $testdir
+smbmount_clean $mnt_point
+smbmount_init $mnt_point
+
+test_file="tmp008"
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $mnt_point"
+cti_execute -i '' FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# open, mmap & close a file in smbfs, then write something into it
+cti_execute FAIL "close_wr ${mnt_point}/${test_file}"
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# do the same thing in local file, for comparison
+cti_execute FAIL "close_wr ${testdir}/${test_file}"
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# diff the local file & smbfs file
+
+cti_execute_cmd "sum ${testdir}/${test_file}"
+read sum1 cnt1 junk < cti_stdout
+cti_report "local sum $sum1 $cnt1"
+
+cti_execute_cmd "sum ${mnt_point}/${test_file}"
+read sum2 cnt2 junk < cti_stdout
+cti_report "smbfs sum $sum2 $cnt2"
+
+if [[ $sum1 != $sum2 ]] ; then
+        cti_fail "FAIL: the files are different"
+        return
+else
+        cti_report "PASS: the files are the same"
+fi
+
+cti_execute_cmd "rm -rf $testdir/*"
+cti_execute_cmd "rm -f ${mnt_point}/${test_file}"
+
+smbmount_clean $mnt_point
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_009.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_009.ksh
new file mode 100644
index 0000000..9c140df
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_009.ksh
@@ -0,0 +1,121 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+# Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
+
+#
+# mmap test purpose
+#
+# __stc_assertion_start
+#
+# ID: mmap_009
+#
+# DESCRIPTION:
+#        Verify smbfs will help sync the dirty pages to the file and close it, including otW close, if the userland does not explicitly do it.
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mkfile in smbfs
+#	3. open, mmap the file, then write some data into the mapped addr
+#	4. exit without close the file
+#	5. verify the data successfully written back to smb server
+# KEYWORDS:
+#
+# TESTABILITY: explicit
+#
+# __stc_assertion_end
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mmap009"
+tc_desc=" Verify smbfs will sync the dirty pages to the file and close it,
+ including otW close, if the userland does not explicitly do it."
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir=$TDIR
+mnt_point=$TMNT
+
+testdir_init $testdir
+smbmount_clean $mnt_point
+smbmount_init $mnt_point
+
+test_file="tmp009"
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $mnt_point"
+cti_execute -i '' FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# open, mmap a file in smbfs, then write something into it,
+# exit without msync/munmap/close
+cti_execute FAIL "no_close ${mnt_point}/${test_file}"
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# do the same thing in local file, for comparison
+cti_execute FAIL "no_close ${testdir}/${test_file}"
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# diff the local file & smbfs file
+
+cti_execute_cmd "sum ${testdir}/${test_file}"
+read sum1 cnt1 junk < cti_stdout
+cti_report "local sum $sum1 $cnt1"
+
+cti_execute_cmd "sum ${mnt_point}/${test_file}"
+read sum2 cnt2 junk < cti_stdout
+cti_report "smbfs sum $sum2 $cnt2"
+
+if [[ $sum1 != $sum2 ]] ; then
+        cti_fail "FAIL: the files are different"
+        return
+else
+        cti_report "PASS: the files are the same"
+fi
+
+cti_execute_cmd "rm -rf $testdir/*"
+cti_execute_cmd "rm -f ${mnt_point}/${test_file}"
+
+smbmount_clean $mnt_point
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_010.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_010.ksh
new file mode 100644
index 0000000..253268d
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mmap/tp_mmap_010.ksh
@@ -0,0 +1,123 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+# Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
+
+#
+# mmap test purpose
+#
+# __stc_assertion_start
+#
+# ID: mmap_010
+#
+# DESCRIPTION:
+#        Verify file read/write is coherent with mmap.
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. open and mmap a test file
+#       3. write something into test file, then check the result through mmap
+#	4. memset some parts of mmaped addr, then check the result through
+#	   file read
+#	5. close test file
+# KEYWORDS:
+#
+# TESTABILITY: explicit
+#
+# __stc_assertion_end
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mmap010"
+tc_desc=" Verify file read/write is coherent with mmap"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+# Note: size should be prime (see cp_mmap)
+size=1123k
+
+server=$(server_name) || return
+
+testdir=$TDIR
+mnt_point=$TMNT
+
+testdir_init $testdir
+smbmount_clean $mnt_point
+smbmount_init $mnt_point
+
+test_file="tmp010"
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $mnt_point"
+cti_execute -i '' FAIL $cmd
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# open, mmap a file in smbfs, then perform the 2 tests mentioned above
+cti_execute FAIL "rw_mmap -n $size -f ${mnt_point}/${test_file}"
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# do the same thing in local file, for comparison
+cti_execute FAIL "rw_mmap -n $size -f ${testdir}/${test_file}"
+if (($?!=0)); then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# diff the local file & smbfs file
+
+cti_execute_cmd "sum ${testdir}/${test_file}"
+read sum1 cnt1 junk < cti_stdout
+cti_report "local sum $sum1 $cnt1"
+
+cti_execute_cmd "sum ${mnt_point}/${test_file}"
+read sum2 cnt2 junk < cti_stdout
+cti_report "smbfs sum $sum2 $cnt2"
+
+if [[ $sum1 != $sum2 ]] ; then
+        cti_fail "FAIL: the files are different"
+        return
+else
+        cti_report "PASS: the files are the same"
+fi
+
+cti_execute_cmd "rm -rf $testdir/*"
+cti_execute_cmd "rm -f ${mnt_point}/${test_file}"
+
+smbmount_clean $mnt_point
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mvtest/Makefile b/usr/src/test/smbclient-tests/tests/smbfs/mvtest/Makefile
new file mode 100644
index 0000000..277891b
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mvtest/Makefile
@@ -0,0 +1,30 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+include		../../../Makefile.com
+
+ROOTTESTDIR=	$(ROOTOPTPKG)/tests/smbfs/mvtest
+
+TESTS=	\
+		tp_mvtest_001	\
+		tp_mvtest_002	\
+		tp_mvtest_003	\
+		tp_mvtest_004	\
+		tp_mvtest_005	\
+		tp_mvtest_006	\
+		tp_mvtest_007
+
+include		../../Makefile.tests
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_001.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_001.ksh
new file mode 100644
index 0000000..df94ab9
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_001.ksh
@@ -0,0 +1,109 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: mvtest_001
+#
+# DESCRIPTION:
+#        Verify can mv files on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mv and diff can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mvtest001"
+tc_desc=" Verify can mv files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cti_execute_cmd "cp /usr/bin/ls $TDIR/test_file"
+# mv file to server
+cti_execute_cmd "mv $TDIR/test_file $TMNT/test_file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: mv $TDIR/test_file test_file failed"
+	return
+else
+	cti_report "PASS: mv $TDIR/test_file test_file succeeded"
+fi
+
+cti_execute_cmd "cmp -s /usr/bin/ls $TMNT/test_file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: diff /usr/bin/ls test_file failed"
+	return
+else
+	cti_report "PASS: diff /usr/bin/ls test_file succeeded"
+fi
+
+cti_execute_cmd "mv $TMNT/test_file $TDIR/test_file_mv"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: mv test_file ${test_file}/test_file_mv failed"
+	return
+else
+	cti_report "PASS: mv test_file ${test_file}/test_file_mv succeeded"
+fi
+
+# test_file should be gone from server
+if [[ -f $TMNT/test_file ]]; then
+	cti_fail "FAIL: test_file exist"
+	return
+else
+	cti_report "PASS: test_file doesn't exist"
+fi
+
+cti_execute_cmd "diff /usr/bin/ls $TDIR/test_file_mv"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: diff /usr/bin/ls $TDIR/test_file failed"
+	return
+else
+	cti_report "PASS: diff /usr/bin/ls $TDIR/test_file succeeded"
+fi
+
+cti_execute_cmd "rm $TDIR/test_file_mv"
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_002.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_002.ksh
new file mode 100644
index 0000000..d0aead5
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_002.ksh
@@ -0,0 +1,105 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: mvtest_002
+#
+# DESCRIPTION:
+#        Verify can mv 300M file on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mv and diff can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mvtest002"
+tc_desc=" Verify can mv large files on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "smbmount can't mount the public share"
+	return
+else
+	cti_report "smbmount can mount the public share"
+fi
+
+cti_execute_cmd "cp $REFFILE $TDIR/test_file"
+cti_execute_cmd "cp $REFFILE $TDIR/test_file_org"
+# mv file to server
+cti_execute_cmd "mv $TDIR/test_file $TMNT/test_file"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: mv $TDIR/test_file to test_file failed"
+	return
+else
+	cti_report "PASS: mv $TDIR/test_file to test_file succeeded"
+fi
+
+cti_execute_cmd "cmp -s $TMNT/test_file $TDIR/test_file_org"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: diff test_file $TDIR/test_file_org failed"
+	return
+else
+	cti_report "PASS: diff test_file $TDIR/test_file_org succeeded"
+fi
+
+# mv from the server to local
+cti_execute_cmd "mv $TMNT/test_file $TDIR/test_file_mv"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: mv test_file $TDIR/test_file_mv failed"
+	return
+else
+	cti_report "PASS: mv test_file $TDIR/test_file_mv succeeded"
+fi
+
+cti_execute_cmd "cmp -s $TDIR/test_file_org $TDIR/test_file_mv"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: diff $TDIR/test_file_org $TDIR/test_file_mv" \
+	    " failed"
+	return
+else
+	cti_report "PASS: diff $TDIR/test_file_org"\
+	    " $TDIR/test_file_mv succeeded"
+fi
+
+cti_execute_cmd "rm -rf $TDIR/*"
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_003.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_003.ksh
new file mode 100644
index 0000000..4b6ff97
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_003.ksh
@@ -0,0 +1,85 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: mvtest_003
+#
+# DESCRIPTION:
+#        Verify can mv dirs on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mv and diff can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mvtest003"
+tc_desc=" Verify can mv dirs between server on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+# mkdir on server
+cti_execute_cmd "mkdir $TMNT/test_dir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: mkdir test_dir failed"
+	return
+else
+	cti_report "PASS: mkdir test_dir succeeded"
+fi
+
+cti_execute_cmd "(cd $TMNT; mv test_dir test_dir_mv)"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: mv test_dir test_dir_mv failed"
+	return
+else
+	cti_report "PASS: mv test_dir test_dir_mv succeeded"
+fi
+
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_004.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_004.ksh
new file mode 100644
index 0000000..53c8138
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_004.ksh
@@ -0,0 +1,88 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: mvtest_004
+#
+# DESCRIPTION:
+#        Verify can mv 3G file on the smbfs
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mv and diff can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mvtest004"
+tc_desc=" Verify can mv large file on the smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+size=3g
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+# create file on the server
+cmd="dd if=/dev/zero of=$TMNT/test_file oseek=3071 bs=1024k count=1"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: create $TDIR/test_file to test_file failed"
+	return
+else
+	cti_report "PASS: create $TDIR/test_file to test_file succeeded"
+fi
+
+# mv on server
+cti_execute_cmd "(cd $TMNT; mv test_file test_file_mv)"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: mv test_file test_file_mv failed"
+	return
+else
+	cti_report "PASS: mv test_file test_file_mv succeeded"
+fi
+
+cti_execute_cmd "rm -rf $TDIR/*"
+
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_005.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_005.ksh
new file mode 100644
index 0000000..bd9b6a4
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_005.ksh
@@ -0,0 +1,95 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: mvtest_005
+#
+# DESCRIPTION:
+#        Verify can mv dir between server and client
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mv can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mvtest005"
+tc_desc=" Verify can mv dir between server and client"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) ||return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can't mount the public share"
+fi
+
+# mkdir on the local
+cti_execute_cmd "mkdir $TDIR/test_dir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: mkdir $TDIR/test_dir failed"
+	return
+else
+	cti_report "PASS: mkdir $TDIR/test_dir failed"
+fi
+
+
+# mv to server
+cti_execute_cmd "mv $TDIR/test_dir $TMNT/test_dir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: mv $TDIR/test_dir to server failed"
+	return
+else
+	cti_report "PASS: mv $TDIR/test_dir to server succeeded"
+fi
+
+# mv dir from the server to local
+cti_execute_cmd "mv $TMNT/test_dir $TDIR/test_dir_mv"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: mv test_dir to $TDIR/test_dir_mv failed"
+	return
+else
+	cti_report "PASS: mv test_dir to $TDIR/test_dir_mv succeeded"
+fi
+
+cti_execute_cmd "rm -rf $TDIR/*"
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_006.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_006.ksh
new file mode 100644
index 0000000..1d8a8b2
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_006.ksh
@@ -0,0 +1,119 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: mvtest_006
+#
+# DESCRIPTION:
+#        Verify can mv muti dir/files between server and local
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mv and diff can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mvtest006"
+tc_desc=" Verify can mv muti dir/files between server and local"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+srcdir=/usr/lib/locale/C
+server=$(server_name)|| return
+
+if [[ $? != 0 ]]; then
+      tet_result UNRESOLVED
+      return
+fi
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+cti_execute_cmd "rm -rf $TDIR/*"
+
+# create mutil file/dirs on the local
+cti_execute_cmd "cp -rf $srcdir $TDIR/test_dir"
+cti_execute_cmd "cp -rf $srcdir $TDIR/test_dir_org"
+
+# mv to server
+cti_execute_cmd "mv $TDIR/test_dir $TMNT/test_dir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: mv $TDIR/test_dir to server failed"
+	return
+else
+	cti_report "PASS: mv $TDIR/test_dir to server succeeded"
+fi
+
+# diff the local and server
+cti_execute_cmd "diff -r $TDIR/test_dir_org $TMNT/test_dir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: diff -r $TDIR/test_dir_org test_dir failed"
+	return
+else
+	cti_report "PASS: diff -r $TDIR/test_dir_org test_dir succeeded"
+fi
+
+# mv mutil dirs from the server to local
+cti_execute_cmd "mv $TMNT/test_dir $TDIR/test_dir_mv"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: mv test_dir to $TDIR/test_dir_mv failed"
+	return
+else
+	cti_report "PASS: mv test_dir to $TDIR/test_dir_mv succeeded"
+fi
+
+# diff the server to local
+cti_execute_cmd "diff -r $TDIR/test_dir_org $TDIR/test_dir_mv"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: diff -r $TDIR/test_dir_org" \
+	    " $TDIR/test_dir_mv failed"
+	return
+else
+	cti_report "PASS: diff -r $TDIR/test_dir_org" \
+	    " $TDIR/test_dir_mv succeeded"
+fi
+
+cti_execute_cmd "rm -rf $TDIR/*"
+cti_execute_cmd "rm -rf $TMNT/*"
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_007.ksh b/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_007.ksh
new file mode 100644
index 0000000..5bb861e
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/mvtest/tp_mvtest_007.ksh
@@ -0,0 +1,145 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: mvtest_007
+#
+# DESCRIPTION:
+#        Verify can mv muti dir/files between server and local
+#
+# STRATEGY:
+#       1. run "mount -F smbfs //server/public /export/mnt"
+#       2. mv and diff can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="mvtest007"
+tc_desc=" Verify can mv muti dir/files between server and local"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+srcdir=/usr/lib/locale/C
+server=$(server_name)|| return
+
+if [[ $? != 0 ]]; then
+      tet_result UNRESOLVED
+      return
+fi
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+# create mutil file/dirs on the server
+cti_execute_cmd "cp -rf $srcdir $TMNT/test_dir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: cp $srcdir to test_dir failed"
+	return
+else
+	cti_report "PASS: cp $srcdir to test_dir succeeded"
+fi
+
+# create mutil file/dirs on the server
+cti_execute_cmd "cp -rf $srcdir $TMNT/test_dir_org"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: cp $srcdir to test_dir_org failed"
+	return
+else
+	cti_report "PASS: cp $srcdir to test_dir_org succeeded"
+fi
+
+# find .
+cti_execute FAIL "(cd $TMNT; find .)"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: find failed on smbfs"
+	return
+else
+	cti_report "PASS: find succeeded on smbfs"
+fi
+
+# mv to local
+cti_execute_cmd "mv $TMNT/test_dir $TDIR/test_dir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: mv test_dir $TDIR/test_dir failed"
+	return
+else
+	cti_report "PASS: mv test_dir $TDIR/test_dir succeeded"
+fi
+
+# diff the local and  org's
+cti_execute_cmd "diff -r $TMNT/test_dir_org $TDIR/test_dir"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: diff -r test_dir_org $TDIR/test_dir failed"
+	return
+else
+	cti_report "PASS: diff -r test_dir_org $TDIR/test_dir succeeded"
+fi
+
+# mv muti dir/files from the local to server
+cti_execute_cmd "mv $TDIR/test_dir $TMNT/test_dir_mv"
+if [[ $? != 0 ]]; then
+	# This test has errors until we do sysattrs
+	noise=' preserve extended system attribute'
+	grep -v "$noise" < cti_stderr > other_stderr
+	if [[ -s other_stderr ]] ; then
+		cti_fail "FAIL: $cmd"
+		return
+	fi
+	cti_report "Partial failure from mv local to mount"
+else
+	cti_report "PASS: mv $TDIR/test_dir to test_dir_mv succeeded"
+fi
+
+# diff the server to local
+cti_execute_cmd  "diff -r $TMNT/test_dir_org $TMNT/test_dir_mv"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: diff -r test_dir_org test_dir_mv failed"
+	return
+else
+	cti_report "PASS: diff -r test_dir_org test_dir_mv succeeded"
+fi
+
+cti_execute_cmd "rm -rf $TDIR/*"
+cti_execute_cmd "rm -rf $TMNT/*"
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/xattr/Makefile b/usr/src/test/smbclient-tests/tests/smbfs/xattr/Makefile
new file mode 100644
index 0000000..7c2ced1
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/xattr/Makefile
@@ -0,0 +1,32 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+include		../../../Makefile.com
+
+ROOTTESTDIR=	$(ROOTOPTPKG)/tests/smbfs/xattr
+
+TESTS=	\
+		tp_xattr_001	\
+		tp_xattr_002	\
+		tp_xattr_003	\
+		tp_xattr_004	\
+		tp_xattr_005	\
+		tp_xattr_006	\
+		tp_xattr_007	\
+		tp_xattr_008	\
+		tp_xattr_009
+
+include		../../Makefile.tests
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_001.ksh b/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_001.ksh
new file mode 100644
index 0000000..6465a18
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_001.ksh
@@ -0,0 +1,81 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID:  xattr_001
+#
+# DESCRIPTION:
+# Verify creating,reading and writing xattrs on smbfs works as expected
+#
+# STRATEGY:
+#	1. Create an xattr on a file using runat
+#	2. Read an empty xattr directory
+#       3. Write the xattr using runat and cat
+#	3. Read the xattr using runat
+#	4. Delete the xattr
+#	5. List the xattr namespace successfully, checking for deletion
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id=xattr_001
+tc_desc="Verify creating,reading and writing xattrs on smbfs works as expected"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+smbmount_getmntopts $TMNT |grep /xattr/ >/dev/null
+if [[ $? != 0 ]]; then
+	smbmount_clean $TMNT
+	cti_unsupported "UNSUPPORTED (no xattr in this mount)"
+	return
+fi
+
+cti_execute_cmd "touch $TMNT/test_file"
+create_xattr $TMNT/test_file passwd /etc/passwd
+verify_write_xattr $TMNT/test_file passwd
+delete_xattr $TMNT/test_file passwd
+
+smbmount_clean $TMNT
+cti_pass "$tc_id: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_002.ksh b/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_002.ksh
new file mode 100644
index 0000000..4a6bfba
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_002.ksh
@@ -0,0 +1,85 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID:  xattr_002
+#
+# DESCRIPTION:
+# Verify trying to read a non-existent xattr should fail.
+#
+# STRATEGY:
+#	1. Create a file
+#       2. Try to read a non-existent xattr, check that an error is returned.
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id=xattr_002
+tc_desc="Verify trying to read a non-existent xattr should fail"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	 cti_fail "FAIL: smbmount can't mount the public share unexpectedly"
+	 return
+else
+	 cti_report "PASS: smbmount can mount the public share as expected"
+fi
+
+smbmount_getmntopts $TMNT |grep /xattr/ >/dev/null
+if [[ $? != 0 ]]; then
+	smbmount_clean $TMNT
+	cti_unsupported "UNSUPPORTED (no xattr in this mount)"
+	return
+fi
+
+# create a file
+
+cti_execute_cmd "touch $TMNT/test_file"
+
+# should not find an xattr file
+cti_execute_cmd "runat $TMNT/test_file cat not-here.txt"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: A read of a non-existent xattr succeeded unexpectedly"
+	return
+else
+	cti_report "PASS: A read of a non-existent xattr fail as expected"
+fi
+
+smbmount_clean $TMNT
+cti_pass "$tc_id: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_003.ksh b/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_003.ksh
new file mode 100644
index 0000000..7b52866
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_003.ksh
@@ -0,0 +1,119 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID:  xattr_003
+#
+# DESCRIPTION:
+# Verify from local tmpfs with xattrs moved to mount point preserve/omit xattrs
+# and from mount point with xattrs moved to local tmpfs preserve/omit xattrs
+#
+# STRATEGY:
+#	1. Create a file, and set an with an xattr
+#       2. Move the file to mount point
+#	3. Check that mv doesn't have any flags to preserve/omit xattrs -
+#          they're always moved.
+#	4. Do the same in reverse.
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id=xattr_003
+tc_desc="Verify from local tmpfs with xattrs moved to mount point preserve/omit xattrs\
+	and from mount point with xattrs moved to local tmpfs preserve/omit xattrs"
+
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	 cti_fail "FAIL: smbmount can't mount the public share unexpectedly"
+	 return
+else
+	 cti_report "PASS: smbmount can mount the public share as expected"
+fi
+
+smbmount_getmntopts $TMNT |grep /xattr/ >/dev/null
+if [[ $? != 0 ]]; then
+	smbmount_clean $TMNT
+	cti_unsupported "UNSUPPORTED (no xattr in this mount)"
+	return
+fi
+
+#create a file in local file system with a xattr and then mv it to mount point
+
+cti_execute_cmd "touch $TDIR/test_file"
+create_xattr $TDIR/test_file passwd /etc/passwd
+cti_execute_cmd "mv $TDIR/test_file $TMNT/test_file"
+if [[ $? != 0 ]]; then
+	 cti_fail "FAIL: can't move the file with xattr from local to mount point unexpectedly
+"
+	 return
+else
+	 cti_report "PASS: can move the file with xattr from local to mount point as expected"
+fi
+cti_execute FAIL "runat $TMNT/test_file diff passwd /etc/passwd"
+if [[ $? != 0 ]]; then
+	 cti_fail "FAIL: after move the xattr has changed unexpectedly"
+	 return
+else
+	 cti_report "PASS: after move the xattr has not changed as expected"
+fi
+cti_execute_cmd "rm -rf $TDIR/*"
+cti_execute_cmd "rm -rf $TMNT/*"
+
+#create a file in mount point with a xattr and then mv it to local file system
+
+cti_execute_cmd "touch $TMNT/test_file"
+create_xattr $TMNT/test_file passwd /etc/passwd
+cti_execute_cmd "mv $TMNT/test_file $TDIR/test_file"
+if [[ $? != 0 ]]; then
+	 cti_fail "FAIL: can't move the file with xattr from mount point to local unexpectedly"
+	 return
+else
+	 cti_report "PASS: can move the file with xattr from mount point to local as expected"
+fi
+cti_execute FAIL "runat $TDIR/test_file diff passwd /etc/passwd"
+if [[ $? != 0 ]]; then
+	 cti_fail "FAIL: after move the xattr has changed unexpectedly"
+	 return
+else
+	 cti_report "PASS: after move the xattr has not changed as expected"
+fi
+
+smbmount_clean $TMNT
+cti_pass "$tc_id: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_004.ksh b/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_004.ksh
new file mode 100644
index 0000000..599875c
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_004.ksh
@@ -0,0 +1,109 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID:  xattr_004
+#
+# DESCRIPTION:
+# Verify from local tmpfs with xattrs copied to mount point retain xattr info
+# and from mount point with xattrs copied to local tmpfs retain xattr info
+#
+# STRATEGY:
+#	1. Create files in local tmpfs with xattrs
+#       2. Copy those files to mount point
+#	3. Ensure the xattrs can be retain
+#	4. Do the same in reverse.
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id=xattr_004
+tc_desc="Verify from local tmpfs with xattrs copied to mount point retain xattr info\
+	  and from mount point with xattrs copied to local tmpfs retain xattr info"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share unexpectedly"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share as expected"
+fi
+
+smbmount_getmntopts $TMNT |grep /xattr/ >/dev/null
+if [[ $? != 0 ]]; then
+	smbmount_clean $TMNT
+	cti_unsupported "UNSUPPORTED (no xattr in this mount)"
+	return
+fi
+
+# Create files in local tmpfs, and set some xattrs on them.
+
+cti_execute_cmd "touch $TDIR/test_file1"
+cti_execute_cmd "runat $TDIR/test_file1 cp /etc/passwd ."
+
+# copy local tmpfs to mount point
+
+cti_execute_cmd "cp -@ $TDIR/test_file1 $TMNT"
+
+# ensure the xattr information has been copied correctly
+
+cti_execute_cmd "runat $TMNT/test_file1 diff passwd /etc/passwd"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: file xattr not retain when it copy from local tmpfs to mount point"
+	return
+else
+	cti_report "PASS: file xattr retain when it copy from local tmpfs to mount point"
+fi
+# copy mount point to local tmpfs
+
+cti_execute_cmd "cp -@ $TMNT/test_file1 $TDIR/test_file2"
+# ensure the xattr information has been copied correctly
+
+cti_execute_cmd "runat $TDIR/test_file2 diff passwd /etc/passwd"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: file xattr not retain when it copy from mount point to local tmpfs"
+	return
+else
+	cti_report "PASS: file xattr retain when it copy from mount point to local tmpfs"
+fi
+
+cti_execute_cmd "rm -rf $TDIR/*"
+
+smbmount_clean $TMNT
+cti_pass "$tc_id: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_005.ksh b/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_005.ksh
new file mode 100644
index 0000000..db9c02d
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_005.ksh
@@ -0,0 +1,131 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID:  xattr_005
+#
+# DESCRIPTION:
+# Verify special . and .. dirs work as expected for xattrs
+#
+# STRATEGY:
+#	1. Create a file and an xattr on that file
+#	2. List the . directory, verifying the output
+#	3. Verify we're unable to list the ../ directory
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id=xattr_005
+tc_desc="Verify special . and .. dirs work as expected for xattrs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share unexpectedly"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share as expected"
+fi
+
+smbmount_getmntopts $TMNT |grep /xattr/ >/dev/null
+if [[ $? != 0 ]]; then
+	smbmount_clean $TMNT
+	cti_unsupported "UNSUPPORTED (no xattr in this mount)"
+	return
+fi
+
+# create a file, and an xattr on it
+
+cti_execute_cmd "touch $TMNT/test_file"
+create_xattr $TMNT/test_file passwd /etc/passwd
+
+# listing the directory . should show one file
+
+OUTPUT=$(runat $TMNT/test_file ls |grep -v SUNWattr_)
+if [ "$OUTPUT" != "passwd" ]
+then
+        cti_fail "Listing the . directory doesn't show \"passwd\" as expected."
+fi
+# list the directory . long form
+
+cti_execute_cmd "runat $TMNT/test_file ls -a . |grep -v SUNWattr_"
+cp cti_stdout output
+
+# create a file that should be the same as the command above
+create_expected_output expected-output  .  ..   passwd
+# compare them
+
+cti_execute_cmd "diff output expected-output"
+if [[ $? != 0 ]]; then
+        cti_fail "FAIL: special . dirs do not work as expected for xattrs"
+	cti_reportfile output
+        return
+else
+        cti_report "PASS: special . dirs work as expected for xattrs"
+fi
+
+# list the directory .. expecting one file
+
+OUTPUT=$(runat $TMNT/test_file ls ..)
+if [ $? != 0 ]
+then
+	cti_fail "runat test file ls .. failed with return val =$? unexpectedly"
+	return
+fi
+
+if [ "$OUTPUT" != ".." ]
+then
+	cti_fail "Listing the .. directory doesn't show \"..\" as expected"
+	return
+fi
+
+# verify we can't list ../
+
+cti_execute_cmd "runat $TMNT/test_file ls  ../"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: can be able to list the ../ directory unexpectedly"
+	return
+else
+	cti_report "PASS: unable to list the ../ directory as expected"
+fi
+
+cti_execute_cmd "rm output expected-output"
+cti_execute_cmd "rm -rf $TDIR/*"
+
+smbmount_clean $TMNT
+cti_pass "$tc_id: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_006.ksh b/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_006.ksh
new file mode 100644
index 0000000..ab4ebb5
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_006.ksh
@@ -0,0 +1,98 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID:  xattr_006
+#
+# DESCRIPTION:
+# Verify links between xattr and normal file namespace fail
+#
+# STRATEGY:
+#	1. Create a file and add an xattr to it (to ensure the namespace exists)
+#       2. Verify we're unable to create a symbolic link
+#	3. Verify we're unable to create a hard link
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id=xattr_006
+tc_desc="Verify links between xattr and normal file namespace fail"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share unexpectedly"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share as expected"
+fi
+
+smbmount_getmntopts $TMNT |grep /xattr/ >/dev/null
+if [[ $? != 0 ]]; then
+	smbmount_clean $TMNT
+	cti_unsupported "UNSUPPORTED (no xattr in this mount)"
+	return
+fi
+
+# Create files set some xattrs on them.
+
+cti_execute_cmd "touch $TMNT/test_file"
+create_xattr $TMNT/test_file passwd /etc/passwd
+
+# Try to create a soft link from the xattr namespace to the default namespace
+
+cti_execute_cmd "runat $TMNT/test_file ln -s /etc/passwd foo"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: symbolic link between xattr and normal file namespace succeeded unexpectedly"
+	return
+else
+	cti_report "PASS: symbolic link between xattr and normal file namespace failed as expected"
+fi
+
+# Try to create a hard link from the xattr namespace to the default namespace
+
+cti_execute_cmd "runat $TMNT/test_file ln /etc/passwd foo"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: hard link between xattr and normal file namespace succeeded unexpectedly "
+	return
+else
+	cti_report "PASS: hard link between xattr and normal file namespace failed as expected"
+fi
+
+smbmount_clean $TMNT
+cti_pass "$tc_id: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_007.ksh b/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_007.ksh
new file mode 100644
index 0000000..d4376d9
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_007.ksh
@@ -0,0 +1,113 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID:  xattr_007
+#
+# DESCRIPTION:
+# Verify mkdir and various mknods fail inside the xattr namespace
+#
+# STRATEGY:
+#	1. Create a file and add an xattr to it (to ensure the namespace exists)
+#       2. Verify that mkdir fails inside the xattr namespace
+#	3. Verify that various mknods fails inside the xattr namespace
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id=xattr_007
+tc_desc="Verify mkdir and various mknods fail inside the xattr namespace"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share unexpectedly"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share as expected"
+fi
+
+smbmount_getmntopts $TMNT |grep /xattr/ >/dev/null
+if [[ $? != 0 ]]; then
+	smbmount_clean $TMNT
+	cti_unsupported "UNSUPPORTED (no xattr in this mount)"
+	return
+fi
+
+# Create files set some xattrs on them.
+
+cti_execute_cmd "touch $TMNT/test_file"
+create_xattr $TMNT/test_file passwd /etc/passwd
+
+# Try to create directory in the xattr namespace
+
+cti_execute_cmd "runat $TMNT/test_file mkdir foo"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: mkdir inside the xattr namespace succeeded unexpectedly"
+	return
+else
+	cti_report "PASS: mkdir inside the xattr namespace failed as expected"
+fi
+# Try to create a range of different filetypes in the xattr namespace
+
+cti_execute_cmd "runat $TMNT/test_file mknod block b 888 888"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: mknod block file succeeded unexpectedly inside the xattr namespace"
+	return
+else
+	cti_report "PASS: mknod block file failed as expected inside the xattr namespace"
+fi
+
+cti_execute_cmd "runat $TMNT/test_file mknod char c"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: mknod char file succeeded unexpectedly inside the xattr namespace"
+	return
+else
+	cti_report "PASS: mknod char file failed as expected inside the xattr namespace"
+fi
+
+cti_execute_cmd "runat $TMNT/test_file mknod fifo p"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: mknod fifo file succeeded unexpectedly inside the xattr namespace"
+	return
+else
+	cti_report "PASS: mknod fifo file failed as expected inside the xattr namespace"
+fi
+
+smbmount_clean $TMNT
+cti_pass "$tc_id: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_008.ksh b/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_008.ksh
new file mode 100644
index 0000000..004bb03
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_008.ksh
@@ -0,0 +1,303 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID:  xattr_008
+#
+# DESCRIPTION:
+# Verify basic applications work with xattrs: cpio cp find mv pax tar
+#
+# STRATEGY:
+#	1. For each application
+#       2. Create an xattr and archive/move/copy/find files with xattr support
+#	3. Also check that when appropriate flag is not used, the xattr
+#	   doesn't get copied
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id=xattr_008
+tc_desc="Verify basic applications work with xattrs: cpio cp find mv pax tar"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+CDIR=$(pwd)
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share unexpectedly"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share as expected"
+fi
+
+smbmount_getmntopts $TMNT |grep /xattr/ >/dev/null
+if [[ $? != 0 ]]; then
+	smbmount_clean $TMNT
+	cti_unsupported "UNSUPPORTED (no xattr in this mount)"
+	return
+fi
+
+# Create a file, and set an xattr on it. This file is used in several of the
+# test scenarios below.
+
+cti_execute_cmd "touch $TMNT/test_file"
+create_xattr $TMNT/test_file passwd /etc/passwd
+
+# For the archive applications below (tar, cpio, pax)
+# we create two archives, one with xattrs, one without
+# and try various cpio options extracting the archives
+# with and without xattr support, checking for correct behaviour
+
+cpio_xattr=$CDIR/xattr.cpio
+cpio_noxattr=$CDIR/noxattr.cpio
+
+cti_report "Checking cpio"
+cti_execute_cmd "touch $TMNT/cpio_test"
+create_xattr $TMNT/cpio_test passwd /etc/passwd
+
+cti_execute_cmd "echo cpio_test| (cd $TMNT; cpio -oc@ -O $cpio_xattr)"
+cti_execute_cmd "echo cpio_test| (cd $TMNT; cpio -oc -O $cpio_noxattr)"
+cti_execute_cmd "rm -rf $TMNT/cpio_test"
+
+# we should have no xattr here
+
+cti_execute_cmd "(cd $TMNT; cpio -iu -I $cpio_xattr)"
+cti_execute_cmd "runat $TMNT/cpio_test cat passwd"
+if [[ $? == 0 ]]
+then
+	cti_fail "Fail: we have xattr here unexpectedly"
+	return
+fi
+cti_execute_cmd "rm -rf $TMNT/cpio_test"
+
+# we should have an xattr here
+
+cti_execute_cmd "(cd $TMNT; cpio -iu@ -I $cpio_xattr)"
+verify_xattr $TMNT/cpio_test passwd /etc/passwd
+cti_execute_cmd "rm -rf $TMNT/cpio_test"
+
+#do the same for the second time
+
+cti_execute_cmd "(cd $TMNT; cpio -iu@ -I $cpio_xattr)"
+verify_xattr $TMNT/cpio_test passwd /etc/passwd
+cti_execute_cmd "rm -rf $TMNT/cpio_test"
+
+# we should have no xattr here
+
+cti_execute_cmd "(cd $TMNT; cpio -iu -I $cpio_noxattr)"
+cti_execute_cmd "runat $TMNT/cpio_test cat passwd"
+if [[ $? == 0 ]]
+then
+	cti_fail "Fail: we have xattr here unexpectedly"
+	return
+fi
+cti_execute_cmd "rm -rf $TMNT/cpio_test"
+
+# we should have no xattr here
+
+cti_execute_cmd "(cd $TMNT; cpio -iu@ -I $cpio_noxattr)"
+cti_execute_cmd "runat $TMNT/cpio_test cat passwd"
+if [[ $? == 0 ]]
+then
+	cti_fail "Fail: we have xattr here unexpectedly"
+	return
+fi
+
+cti_execute_cmd "rm -rf $TMNT/cpio_test"
+cti_execute_cmd "rm -rf $cpio_xattr"
+cti_execute_cmd "rm -rf $cpio_noxattr"
+
+cti_report "Checking cp"
+# check that with the right flag, the xattr is preserved
+
+cti_execute_cmd "(cd $TMNT; cp -@ test_file test_file1)"
+compare_xattrs $TMNT/test_file $TMNT/test_file1 passwd
+cti_execute_cmd "rm -rf $TMNT/test_file1"
+
+# without the right flag, there should be no xattr (ls should fail)
+
+cti_execute_cmd "(cd $TMNT; cp test_file test_file1)"
+cti_execute_cmd "runat $TMNT/cpio_test ls passwd"
+if [[ $? == 0 ]]
+then
+	cti_fail "Fail: we have xattr here unexpectedly"
+	return
+fi
+cti_execute_cmd "rm -rf $TMNT/test_file1"
+
+# create a file without xattrs, and check that find -xattr only finds
+# our test file that has an xattr.
+
+cti_report "Checking find"
+cti_execute_cmd "mkdir $TMNT/noxattrs"
+cti_execute_cmd "touch $TMNT/noxattrs/no-xattr"
+
+cti_execute_cmd "find $TMNT -xattr | grep test_file"
+if [ $? -ne 0 ]
+then
+	cti_fail "find -xattr didn't find our file that had an xattr unexpectedly"
+fi
+cti_execute_cmd "find $TMNT -xattr | grep no-xattr"
+if [ $? -eq 0 ]
+then
+	cti_fail "find -xattr found a file that didn't have an xattr unexpectedly"
+fi
+cti_execute_cmd "rm -rf $TMNT/noxattrs"
+
+# mv doesn't have any flags to preserve/ommit xattrs - they're
+# always moved.
+
+cti_report "Checking mv"
+cti_execute_cmd "touch $TMNT/mvtest"
+create_xattr $TMNT/mvtest passwd /etc/passwd
+cti_execute_cmd "(cd $TMNT; mv mvtest mvtest2)"
+verify_xattr $TMNT/mvtest2 passwd /etc/passwd
+cti_execute_cmd "rm $TMNT/mvtest"
+cti_execute_cmd "rm $TMNT/mvtest2"
+
+pax_xattr=$CDIR/xattr.pax
+pax_noxattr=$CDIR/noxattr.pax
+
+cti_report "Checking pax"
+cti_execute_cmd "touch $TMNT/pax_test"
+create_xattr $TMNT/pax_test passwd /etc/passwd
+cti_execute_cmd "(cd $TMNT; pax -w -f $pax_noxattr pax_test)"
+cti_execute_cmd "(cd $TMNT; pax -w@ -f $pax_xattr pax_test)"
+cti_execute_cmd "rm $TMNT/pax_test"
+
+# we should have no xattr here
+
+cti_execute_cmd "(cd $TMNT; pax -r -f $pax_noxattr)"
+cti_execute_cmd "runat $TMNT/pax_test cat passwd"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: we have xattr here unexpectedly"
+	return
+else
+	cti_report "PASS: we should have no xattr here as expected"
+fi
+cti_execute_cmd "rm $TMNT/pax_test"
+
+# we should have no xattr here
+
+cti_execute_cmd "(cd $TMNT; pax -r@ -f $pax_noxattr)"
+cti_execute_cmd "runat $TMNT/pax_test cat passwd"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: we have xattr here unexpectedly"
+	return
+else
+	cti_report "PASS: we should have no xattr here as expected"
+fi
+cti_execute_cmd "rm $TMNT/pax_test"
+
+# we should have an xattr here
+
+cti_execute_cmd "(cd $TMNT; pax -r@ -f $pax_xattr)"
+verify_xattr $TMNT/pax_test passwd /etc/passwd
+cti_execute_cmd "rm $TMNT/pax_test"
+
+# we should have no xattr here
+
+cti_execute_cmd "(cd $TMNT; pax -r -f $pax_xattr)"
+cti_execute_cmd "runat $TMNT/pax_test cat passwd"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: we have xattr here unexpectedly"
+	return
+else
+	cti_report "PASS: we should have no xattr here as expected"
+fi
+cti_execute_cmd "rm $TMNT/pax_test"
+cti_execute_cmd "rm $pax_noxattr"
+cti_execute_cmd "rm $pax_xattr"
+
+tar_xattr=$CDIR/xattr.tar
+tar_noxattr=$CDIR/noxattr.tar
+
+cti_report "Checking tar"
+cti_execute_cmd "touch $TMNT/tar_test"
+create_xattr $TMNT/tar_test passwd /etc/passwd
+cti_execute_cmd "(cd $TMNT; tar cf $tar_noxattr tar_test)"
+cti_execute_cmd "(cd $TMNT; tar c@f $tar_xattr tar_test)"
+cti_execute_cmd "rm $TMNT/tar_test"
+
+# we should have no xattr here
+
+cti_execute_cmd "(cd $TMNT; tar xf $tar_xattr)"
+cti_execute_cmd "runat $TMNT/tar_test cat passwd"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: we have xattr here unexpectedly"
+	return
+else
+	cti_report "PASS: we should have no xattr here as expected"
+fi
+cti_execute_cmd "rm $TMNT/tar_test"
+
+# we should have an xattr here
+
+cti_execute_cmd "(cd $TMNT; tar x@f $tar_xattr)"
+verify_xattr $TMNT/tar_test passwd /etc/passwd
+cti_execute_cmd "rm $TMNT/tar_test"
+
+# we should have no xattr here
+
+cti_execute_cmd "(cd $TMNT; tar xf $tar_noxattr)"
+cti_execute_cmd "runat $TMNT/tar_test cat passwd"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: we have xattr here unexpectedly"
+	return
+else
+	cti_report "PASS: we should have no xattr here as expected"
+fi
+cti_execute_cmd "rm $TMNT/tar_test"
+
+# we should have no xattr here
+
+cti_execute_cmd "(cd $TMNT; tar x@f $tar_noxattr)"
+cti_execute_cmd "runat $TMNT/tar_test cat passwd"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: we have xattr here unexpectedly"
+	return
+else
+	cti_report "PASS: we should have no xattr here as expected"
+fi
+cti_execute_cmd "rm $TMNT/tar_test"
+cti_execute_cmd "rm $tar_noxattr"
+cti_execute_cmd "rm $tar_xattr"
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+smbmount_clean $TMNT
+cti_pass "$tc_id: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_009.ksh b/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_009.ksh
new file mode 100644
index 0000000..dfe7c51
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbfs/xattr/tp_xattr_009.ksh
@@ -0,0 +1,121 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID:  xattr_009
+#
+# DESCRIPTION:
+# Verify can create many xattrs on a file
+#
+# STRATEGY:
+#	1. Create a file on a filesystem and add 100 xattrs to it
+#	2. Verify that the xattrs should be right
+#	4. Delete those xattrs
+#	5. Verify that xattrs should not be have
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id=xattr_009
+tc_desc="Verify can create many xattrs on a file"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	 cti_fail "FAIL: smbmount can't mount the public share unexpectedly"
+	 return
+else
+	 cti_report "PASS: smbmount can mount the public share as expected"
+fi
+
+smbmount_getmntopts $TMNT |grep /xattr/ >/dev/null
+if [[ $? != 0 ]]; then
+	smbmount_clean $TMNT
+	cti_unsupported "UNSUPPORTED (no xattr in this mount)"
+	return
+fi
+
+# Create a file, and set 100 xattrs on it.
+
+cti_execute_cmd "rm -f $TMNT/test_file"
+cti_execute_cmd "touch $TMNT/test_file"
+typeset -i i=0
+typeset -i j=100
+while [[ $i -lt $j ]]; do
+  create_xattr $TMNT/test_file passwd$i /etc/passwd
+  i=$((i+1))
+done
+
+#create the expected output then compare them with xattrs in the test_file
+
+i=0
+cp /dev/null temp_file
+echo SUNWattr_ro >> temp_file
+echo SUNWattr_rw >> temp_file
+while [[ $i -lt $j ]]; do
+  echo passwd$i >> temp_file
+  i=$((i+1))
+done
+cti_execute_cmd "sort temp_file > expected_file"
+
+#listing the directory passwd*
+
+cti_execute_cmd "runat $TMNT/test_file ls > output"
+cti_execute_cmd "sort output | diff expected_file -"
+if [[ $? != 0 ]]; then
+cti_fail "FAIL: do not work as expected for xattrs"
+return
+else
+cti_report "PASS: work as expected for xattrs"
+fi
+
+#delete xattrs in test_file verify these are no passwd* in test_file
+
+cti_execute_cmd "runat $TMNT/test_file rm -f passwd*"
+cti_execute_cmd "runat $TMNT/test_file ls passwd*"
+if [[ $? == 0 ]]; then
+cti_fail "FAIL: have passwd* xattrs in test_file unexpectedly"
+return
+else
+cti_report "PASS: should not have passwd* xattrs in test_file as expected"
+fi
+
+cti_execute_cmd "rm -f temp_file expected_file output"
+
+smbmount_clean $TMNT
+cti_pass "$tc_id: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbmount/Makefile b/usr/src/test/smbclient-tests/tests/smbmount/Makefile
new file mode 100644
index 0000000..83bc995
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbmount/Makefile
@@ -0,0 +1,39 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+include		../../Makefile.com
+
+ROOTTESTDIR=	$(ROOTOPTPKG)/tests/smbmount
+
+TESTS=	\
+		tp_smbmount_001	\
+		tp_smbmount_002	\
+		tp_smbmount_003	\
+		tp_smbmount_004	\
+		tp_smbmount_005	\
+		tp_smbmount_006	\
+		tp_smbmount_007	\
+		tp_smbmount_008	\
+		tp_smbmount_009	\
+		tp_smbmount_010	\
+		tp_smbmount_011	\
+		tp_smbmount_012	\
+		tp_smbmount_013	\
+		tp_smbmount_014	\
+		tp_smbmount_015	\
+		tp_smbmount_016
+
+include		../Makefile.tests
diff --git a/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_001.ksh b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_001.ksh
new file mode 100644
index 0000000..7a29015
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_001.ksh
@@ -0,0 +1,76 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbmount_001
+#
+# DESCRIPTION:
+#        Verify mount smbfs can mount the public share
+#
+# STRATEGY:
+#	1. run "mount -F smbfs /server/public /export/mnt"
+#	2. mount can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbmount001"
+tc_desc="Verify smbmount can mount public share"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs -o noprompt //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+smbmount_check $TMNT || return
+
+cmd="umount $TMNT"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: umount the $TMNT failed"
+	return
+else
+	cti_report "PASS: mount the $TMNT successfully"
+fi
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_002.ksh b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_002.ksh
new file mode 100644
index 0000000..3534d3c
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_002.ksh
@@ -0,0 +1,76 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbmount_002
+#
+# DESCRIPTION:
+#        Verify smbmount can mount private shares
+#
+# STRATEGY:
+#	1. run "mount -F smbfs //$AUSER:$APASS@$server/$AUSER $TMNT"
+#	3. verify mount worked
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbmount002"
+tc_desc=" Verify smbmount can mount private shares"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs -o noprompt //$AUSER:$APASS@$server/a_share $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the share a_share"
+	return
+else
+	cti_report "PASS: smbmount can mount the share a_share"
+fi
+
+smbmount_check $TMNT || return
+
+cmd="umount $TMNT"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to umount the $TMNT"
+	return
+else
+	cti_report "PASS: umount the $TMNT suceessfully"
+fi
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_003.ksh b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_003.ksh
new file mode 100644
index 0000000..69cdaaf
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_003.ksh
@@ -0,0 +1,71 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbmount_003
+#
+# DESCRIPTION:
+#        Verify smbmount can't mount private share with wrong passwd
+#
+# STRATEGY:
+#	1. run ""mount -F smbfs //$AUSER:$BPASS@$server/$AUSER"
+#	2. mount can get the failed message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbmount003"
+tc_desc=" Verify smbmount can't mount private share with wrong passwd"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+# get rid of our connection first
+cti_execute_cmd "smbutil discon //$AUSER@$server"
+sleep 1
+
+cti_report "expect failure next"
+cmd="mount -F smbfs -o noprompt //$AUSER:badpass@$server/a_share $TMNT"
+cti_execute -i '' PASS $cmd
+if [[ $? == 0 ]]; then
+	cti_execute_cmd "echo '::nsmb_vc' |sudo -n mdb -k"
+	cti_fail "FAIL: smbmount can mount the share a_share with wrong passwd"
+	return
+else
+	cti_report "PASS: smbmount can't mount the share a_share with wrong passwd"
+fi
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_004.ksh b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_004.ksh
new file mode 100644
index 0000000..694abb9
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_004.ksh
@@ -0,0 +1,74 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbmount_004
+#
+# DESCRIPTION:
+#        Verify a share can't be mounted twice on the same point
+#
+# STRATEGY:
+#	1. run "mount -F smbfs //$TUSER:$TPASS@$server/public $TMNT" twice
+#	2. the second mount operation failed
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbmount004"
+tc_desc=" Verify a share can't be mounted twice on the same point"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs -o noprompt //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share with user $TUSER"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share with user $TUSER"
+fi
+
+# cmd= (same as above)
+cti_execute_cmd $cmd
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: smbmount can mount the public share on the same point twice"
+	return
+else
+	cti_report "PASS: smbmount can't mount the public share on the same point twice"
+fi
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_005.ksh b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_005.ksh
new file mode 100644
index 0000000..1fd6370
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_005.ksh
@@ -0,0 +1,166 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbmount_005
+#
+# DESCRIPTION:
+#        Verify "mount -F smbfs -O" work well
+#
+# STRATEGY:
+#	1. create user "$AUSER" and "$BUSER"
+#	2. run "mount -F smbfs //$AUSER:$APASS@$server/a_share $TMNT"
+#	3. mount successfully
+#	4. run "mount -F smbfs -O //$BUSER:$BPASS@$server/b_share $TMNT"
+#	5. mount successfully
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbmount005"
+tc_desc="-O work well"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs -o noprompt //$AUSER:$APASS@$server/a_share $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the share a_share with user $AUSER"
+	return
+else
+	cti_report "PASS: smbmount can mount the share a_share with user $AUSER"
+fi
+
+smbmount_check $TMNT || return
+
+# cp file
+cmd="cp /usr/bin/ls $TMNT/ls_file"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to cp the /usr/bin/ls file"
+	return
+else
+	cti_report "PASS: cp the /usr/bin/ls file successfully"
+fi
+
+cmd="diff /usr/bin/ls $TMNT/ls_file"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the file /usr/bin/ls is different with file ls_file"
+	return
+else
+	cti_report "PASS: the file /usr/bin/ls is same to the ls_file file"
+fi
+
+cmd="mount -F smbfs -O -o noprompt //$BUSER:$BPASS@$server/a_share $TMNT"
+cti_execute -i '' FAIL sudo -n $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the share a_share on the same point twice with -O option"
+	return
+else
+	cti_report "PASS: smbmount can mount the share a_share on the same point twice with -O option"
+fi
+
+smbmount_check $TMNT || {
+  cti_execute_cmd sudo -n "umount $TMNT"
+  return 1
+}
+
+cmd="diff /usr/bin/ls $TMNT/ls_file"
+cti_execute_cmd sudo -n $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the second diff file /usr/bin/ls is different with the ls_file file"
+	return
+else
+	cti_report "PASS: the second diff file /usr/bin/ls is same to the ls_file file"
+fi
+
+# cp file
+cmd="cp /usr/bin/rm $TMNT/rm_file"
+cti_execute_cmd sudo -n $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to cp the /usr/bin/rm file"
+	return
+else
+	cti_report "PASS: cp the file /usr/bin/rm successfully"
+fi
+
+cmd="diff /usr/bin/rm $TMNT/rm_file"
+cti_execute_cmd sudo -n $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the file /usr/bin/rm is different with the rm_file file"
+	return
+else
+	cti_report "PASS: the file /usr/bin/rm is same to the rm_file file"
+fi
+
+cmd="umount $TMNT"
+cti_execute_cmd sudo -n $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the first umount $TMNT is failed "
+	return
+else
+	cti_report "PASS: the first umount $TMNT is successful"
+fi
+
+cmd="diff /usr/bin/ls $TMNT/ls_file"
+cti_execute_cmd sudo -n $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL:the third diff:file /usr/bin/ls is different with file ls_file"
+	return
+else
+	cti_report "PASS:the third diff:file /usr/bin/ls is same to file ls_file"
+fi
+cmd="diff /usr/bin/rm $TMNT/rm_file"
+cti_execute_cmd sudo -n $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the fourth diff:file /usr/bin/rm is different with file rm_file"
+	return
+else
+	cti_report "PASS: the fourth diff:file /usr/bin/rm is same to the rm_file file"
+fi
+
+cmd="umount $TMNT"
+cti_execute_cmd sudo -n $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the second umount $TMNT is failed"
+	return
+else
+	cti_report "PASS: the second umount $TMNT is successful"
+fi
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_006.ksh b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_006.ksh
new file mode 100644
index 0000000..e189bde
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_006.ksh
@@ -0,0 +1,90 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbmount_006
+#
+# DESCRIPTION:
+#        Verify mutil user can't mount on the same mount point"
+#
+# STRATEGY:
+#	1. create user "$AUSER" and "$BUSER"
+#	2. run "mount -F smbfs //$AUSER:$APASS@$server/public $TMNT"
+#	3. mount successfully
+#	4. run "mount -F smbfs //$BUSER:$BPASS@$server/public $TMNT"
+#	5. mount failed
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbmount006"
+tc_desc=" Verify mutil user mount failed on the same plan"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs -o noprompt //$AUSER:$APASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+smbmount_check $TMNT || return
+
+# this should fail
+cmd="mount -F smbfs -o noprompt //$BUSER:$BPASS@$server/public $TMNT"
+cti_execute -i '' PASS sudo -n -u $BUSER $cmd
+if [[ $? == 0 ]]; then
+	cti_execute_cmd "echo '::nsmb_vc' |sudo -n mdb -k"
+	cti_fail "FAIL: smbmount - second mount should have failed"
+	return
+else
+	cti_report "PASS: smbmount - second mount failed as expected"
+fi
+
+cmd="umount $TMNT"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to umount the $TMNT"
+	return
+else
+	cti_report "PASS: umount the $TMNT successfully"
+fi
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_007.ksh b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_007.ksh
new file mode 100644
index 0000000..0b77caf
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_007.ksh
@@ -0,0 +1,127 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbmount_007
+#
+# DESCRIPTION:
+#        Verify mutil user mount success with -O
+#
+# STRATEGY:
+#	1. create users "$AUSER", "$BUSER" and their passwords
+#	2. create $AUSER smb private share for user "$AUSER"
+#	3. run "mount -F smbfs //$AUSER:$APASS@server/public /export/mnt"
+#	4. mount successfully
+#	5. run "mount -F smbfs -O //$BUSER:$BPASS@server/public /export/mnt"
+#	6. mount successfully
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbmount007"
+tc_desc=" Verify mutil user mount success with -o O"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+# SKIP for now (mount -O needs privs)
+no_tested || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs -o noprompt //$AUSER:$APASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount mount the public share successfully"
+fi
+
+smbmount_check $TMNT || return
+
+cmd="cp /usr/bin/ls $TMNT/$AUSER"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to create the file by $AUSER"
+	return
+else
+	cti_report "PASS: create the file by $AUSER successfully"
+fi
+
+cmd="rm -rf $TMNT/$AUSER"
+cti_execute_cmd $cmd
+
+cmd="mount -F smbfs -O -o noprompt //$BUSER:$BPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the second mount with $BUSER failed"
+	return
+else
+	cti_report "PASS: the second mount with $BUSER successfully"
+fi
+
+smbmount_check $TMNT || return
+
+cmd="cp /usr/bin/ls  $TMNT/$BUSER"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to create the file by the $BUSER"
+	return
+else
+	cti_report "PASS: create the file by the $BUSER successfully"
+fi
+
+cmd="rm -rf $TMNT/$BUSER"
+cti_execute_cmd $cmd
+
+cmd="umount $TMNT"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to umount the $TMNT"
+	return
+else
+	cti_report "PASS: umount the $TMNT successfully"
+fi
+
+cmd="umount $TMNT"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the second umount the $TMNT failed"
+	return
+else
+	cti_report "PASS: the second umount the $TMNT successfully"
+fi
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_008.ksh b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_008.ksh
new file mode 100644
index 0000000..1bd3206
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_008.ksh
@@ -0,0 +1,94 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbmount_008
+#
+# DESCRIPTION:
+#          Verify normal smbmount can mount public share
+#
+# STRATEGY:
+#	1. run sudo -u $TUSER "mount -F smbfs -ofileperms=666"
+#	  //$TUSER:$TPASS@$server/public $TMNT""
+#	2. mount successfully
+#	3. run sudo -u $AUSER "cp /usr/bin/ls ls_file"
+#	4. mount and cp can get right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbmount008"
+tc_desc="Verify normal smbmount can mount public share"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+sudo -n chown $TUSER $TMNT
+
+cmd="mount -F smbfs -o noprompt,fileperms=666 \
+ //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL sudo -n $TUSER "$cmd"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the normal user can't mount the public share"
+	smbmount_clean $TMNT
+	return
+else
+	cti_report "PASS: the normal user can mount the public share"
+fi
+
+smbmount_check $TMNT || return
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+cmd="cp /usr/bin/ls $TMNT/ls_file"
+cti_execute FAIL sudo -n -u $AUSER $cmd
+
+cmd="diff /usr/bin/ls $TMNT/ls_file"
+cti_execute FAIL sudo -n -u $AUSER $cmd
+
+cti_execute_cmd "rm $TMNT/ls_file"
+
+cmd="umount $TMNT"
+cti_execute_cmd "sudo -n -u $TUSER $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the normal user can't umount the public share"
+	smbmount_clean $TMNT
+	return
+else
+	cti_report "PASS: the normal user can umount the public share"
+fi
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_009.ksh b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_009.ksh
new file mode 100644
index 0000000..27a7870
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_009.ksh
@@ -0,0 +1,101 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbmount_009
+#
+# DESCRIPTION:
+#         Verify normal smbmount can mount private shares
+#
+# STRATEGY:
+#	1. run "mount -F smbfs //$AUSER:$APASS@$server/$AUSER $TMNT"
+#	2. mount successfully
+#	3. rm and cp can get right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbmount009"
+tc_desc="Verify normal smbmount can mount private shares"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+sudo -n chown $AUSER $TMNT
+
+cmd="mount -F smbfs -o noprompt //$AUSER:$APASS@$server/a_share $TMNT"
+cti_execute -i '' FAIL sudo -n -u $AUSER "$cmd"
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the normal user can't mount the share a_share"
+	return
+else
+	cti_report "PASS: the normal user can mount the share a_share"
+fi
+
+smbmount_check $TMNT || return
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+cmd="cp /usr/bin/ls $TMNT/ls_file"
+cti_execute FAIL sudo -n -u $AUSER $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: cp the file /usr/bin/ls is failed"
+	return
+else
+	cti_report "PASS: cp the file /usr/bin/ls successfully"
+fi
+
+cmd="diff /usr/bin/ls $TMNT/ls_file"
+cti_execute_cmd sudo -n -u $AUSER $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the file /usr/bin/ls is different with the file ls_file"
+	return
+else
+	cti_report "PASS: the file /usr/bin/ls is same to the file ls_file"
+fi
+
+cti_execute_cmd "rm ls_file"
+
+cmd="umount $TMNT"
+cti_execute_cmd sudo -n -u $AUSER $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the normal user failed to umount the $TMNT"
+	return
+else
+	cti_report "PASS: the normal user umount the $TMNT successfully"
+fi
+
+smbmount_clean $TMNT
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_010.ksh b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_010.ksh
new file mode 100644
index 0000000..f25eda3
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_010.ksh
@@ -0,0 +1,108 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbmount_010
+#
+# DESCRIPTION:
+#         Verify smbmount can work well with smbutil login
+#
+# STRATEGY:
+#	1. run "mount -F smbfs "//aaa;$TUSER:$TPASS@$server/public" $TMNT"
+#	2. mount successfully
+#	3. cp and diff can get right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbmount010"
+tc_desc="smbmount can work well with smbutil login"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+smbutil logout -a
+cmd="$EXPECT $SMBUTILEXP $TUSER $TPASS@aaa"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbutil login failed to set passwd"
+	return
+else
+	cti_report "PASS: smbutil login set the passwd successfully"
+fi
+
+cmd="mount -F smbfs -o noprompt //aaa;$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the normal user can't mount the public share"
+	smbutil logout -a
+	return
+else
+	cti_report "PASS: the normal user can mount the public share"
+fi
+
+smbmount_check $TMNT
+if [[ $? != 0 ]]; then
+	smbutil logout -a
+	return
+fi
+
+cmd="cp /usr/bin/ls $TMNT/ls_file"
+cti_execute FAIL $cmd
+
+cmd="cmp -s /usr/bin/ls $TMNT/ls_file"
+cti_execute FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the file /usr/bin/ls is different with the file ls_file"
+	smbutil logout -a
+	return
+else
+	cti_report "PASS: the file /usr/bin/ls is same to with the file ls_file"
+fi
+
+cmd="umount $TMNT"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: the normal user can't umount the public share"
+	smbutil logout -a
+	return
+else
+	cti_report "PASS: the normal user can umount the public share"
+fi
+
+smbmount_clean $TMNT
+smbutil logout -a
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_011.ksh b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_011.ksh
new file mode 100644
index 0000000..86e9c5b
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_011.ksh
@@ -0,0 +1,94 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbmount_011
+#
+# DESCRIPTION:
+#         -o fileperms affects both file and dir permissions
+#
+# STRATEGY:
+#	1. create a smb public share on sever
+#	2. run "mount -F smbfs -o fileperms=744 //server/share
+#	/mnt" on client
+#	3. cd /mnt; touch a; ls -l a get 744 permisson
+#	4. cd /mnt; mkdir d; ls -l a get 755 permisson
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbmount011"
+tc_desc="fileperm=xxx worked well "
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs -o noprompt,noacl,fileperms=744
+ //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+
+cti_execute_cmd "touch $TMNT/a"
+perm=$(cd $TMNT; ls -l a|awk '{ print $1}')
+if [[ $perm != "-rwxr--r--" && $perm != "-rwxr--r--+" ]]; then
+	tet_infoline "ls expect get 744 permission, but get $perm"
+	smbmount_clean $TMNT
+	tet_result FAIL
+	return
+fi
+
+cti_execute_cmd "rm -f $TMNT/a"
+cti_execute_cmd "mkdir $TMNT/d"
+
+perm=$(cd $TMNT; ls -ld d|awk '{ print $1}')
+if [[ $perm != "drwxr-xr-x" && $perm != "drwxr-xr-x+" ]]; then
+	tet_infoline "ls expect get 755 permission, but get $perm"
+	smbmount_clean $TMNT
+	tet_result FAIL
+	return
+fi
+cti_execute_cmd "rm -rf $TMNT/d"
+
+cmd="umount $TMNT"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to umount the $TMNT"
+	return
+else
+	cti_report "PASS: failed to umount the $TMNT"
+fi
+
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_012.ksh b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_012.ksh
new file mode 100644
index 0000000..8a4d3bd
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_012.ksh
@@ -0,0 +1,89 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbmount_012
+#
+# DESCRIPTION:
+#         -o fileperms work well
+#
+# STRATEGY:
+#        1. create a smb public share for user "$AUSER" on sever
+#        2. run "mount -F smbfs -o dirperms=540 //a@server/share
+#        /mnt" on client
+#        3. ls -ld /mnt get 540 permisson
+#        4. smbutil login //a@server
+#        5. cd /PUBLIC get permisson deny
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbmount012"
+tc_desc="dirperms=xxx worked well "
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs -o noprompt,noacl,dirperms=540
+ //$AUSER:$APASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the public share"
+	return
+else
+	cti_report "PASS: smbmount can mount the public share"
+fi
+
+perm=$(ls -ld $TMNT |awk '{ print $1}')
+if [[ $perm != "dr-xr-----" && $perm != "dr-xr-----+" ]]; then
+	cti_fail "FAIL: the expect result is get 540 permission, but get $perm"
+	return
+else
+	cti_report "PASS: the expect result is right"
+fi
+cti_execute_cmd "rm -rf $TMNT/a"
+
+cmd="umount $TMNT"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to umount the $TMNT"
+	return
+else
+	cti_report "PASS: umount the $TMNT successfully"
+fi
+
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_013.ksh b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_013.ksh
new file mode 100644
index 0000000..f53538f
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_013.ksh
@@ -0,0 +1,105 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbmount_013
+#
+# DESCRIPTION:
+#	 -o uid work well
+#
+# STRATEGY:
+#        1. run "mount -F smbfs -o uid=xxx //$TUSER:$TPASS@...
+#        2. ls -ld /mnt get owner xxx
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbmount013"
+tc_desc="uid=xxx worked well"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+# SKIP for now (mount -uid needs privs)
+no_tested || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+# XXX: Should get this user from config
+tc_uid="smmsp"
+
+cmd="mount -F smbfs -o noprompt,noacl,uid=$tc_uid \
+ //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL sudo -n $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	return
+fi
+
+usr=$(ls -ld $TMNT|awk '{ print $3}')
+
+if [[ $usr != "$tc_uid" ]]; then
+	cti_fail "FAIL: ls -ld, expected $tc_uid, got $usr"
+	smbmount_clean $TMNT
+	return
+fi
+
+cti_execute_cmd "touch $TMNT/a"
+usr=$(ls -l a|awk '{ print $3}')
+if [[ $usr != "$tc_uid" ]]; then
+	cti_fail "FAIL: touch a, expected $tc_uid usr, got $usr"
+	smbmount_clean $TMNT
+	return
+fi
+
+cti_execute_cmd "rm -rf $TMNT/b"
+cti_execute_cmd "mkdir $TMNT/b"
+usr=$(ls -ld b|awk '{ print $3}')
+if [[ $usr != "$tc_uid" ]]; then
+	cti_fail "FAIL: mkdir b, expected $tc_uid usr, got $usr"
+	smbmount_clean $TMNT
+	return
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+cmd="umount $TMNT"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to umount the $TMNT"
+	return
+fi
+
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_014.ksh b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_014.ksh
new file mode 100644
index 0000000..3c9a13c
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_014.ksh
@@ -0,0 +1,90 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbmount_014
+#
+# DESCRIPTION:
+#         Verify readonly worked on smbfs
+# STRATEGY:
+#	1. create a smb public share for user "$AUSER" on sever
+#	2. run "mount -F smbfs //$AUSER:$APASS@$server/$AUSER $TMNT"
+#	3. df and cp can get right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbmount014"
+tc_desc="Verify readonly worked on smbfs"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+# SKIP for now (mount priv issues)
+no_tested || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+cmd="mount -F smbfs -o noprompt //$AUSER:$APASS@$server/a_share $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the share a_share"
+	return
+else
+	cti_report "PASS: smbmount can mount the share a_share"
+fi
+
+smbmount_check $TMNT || return
+
+cmd="cp /usr/bin/ls $TMNT"
+cti_execute_cmd sudo -n -u $BUSER $cmd
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: cp to the smbfs should fail, but it's successful"
+	return
+else
+	cti_report "PASS: cp to the smbfs is failed, it's right"
+fi
+
+
+cmd="umount $TMNT"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to umount the $TMNT"
+	return
+else
+	cti_report "PASS: umount the $TMNT succssfully"
+fi
+
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_015.ksh b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_015.ksh
new file mode 100644
index 0000000..6bfeb65
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_015.ksh
@@ -0,0 +1,114 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbmount_015
+#
+# DESCRIPTION:
+#         Verify smbmount can mount 2 private shares
+#
+# STRATEGY:
+#	1. run "mount -F smbfs -o dirperms=777,fileperms=666
+#	//$AUSER:$APASS@$server/$AUSER $TMNT"
+#	2 mount successfully
+#	3. run "mount -F smbfs -o dirperms=777,fileperms=666
+#	//$BUSER:$BPASS@$server/$BUSER $TMNT2"
+#	4 mount successfully
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbmount015"
+tc_desc="Verify smbmount can mount 2 private shares"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+# SKIP for now (mount priv issues)
+no_tested || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+smbmount_clean $TMNT2
+smbmount_init $TMNT2
+
+cmd="mount -F smbfs -o noprompt,dirperms=777,fileperms=666
+ //$AUSER:$APASS@$server/a_share $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbmount can't mount the share a_share"
+	return
+else
+	cti_report "PASS: smbmount can mount the share a_share"
+fi
+
+smbmount_check $TMNT || return
+
+cmd="cp /usr/bin/ls $TMNT/ls_file"
+cti_execute FAIL sudo -n -u $AUSER $cmd
+
+cmd="diff /usr/bin/ls $TMNT/ls_file"
+cti_execute FAIL sudo -n -u $AUSER $cmd
+
+cmd="mount -F smbfs -o noprompt,dirperms=777,fileperms=666
+ //$BUSER:$BPASS@$server/$BUSER $TMNT2"
+cti_execute -i '' FAIL $cmd
+
+smbmount_check $TMNT || return
+
+cmd="cp /usr/bin/ls $TMNT/ls_file"
+cti_execute FAIL sudo -n -u $AUSER $cmd
+
+cmd="diff /usr/bin/ls $TMNT/ls_file"
+cti_execute FAIL sudo -n -u $AUSER $cmd
+
+cmd="umount $TMNT"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to umount the $TMNT"
+	return
+else
+	cti_report "PASS: umount the $TMNT successfully"
+fi
+
+cmd="umount $TMNT2"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to umount the $TMNT2"
+	return
+	cti_report "PASS: umount the $TMNT2 successfully"
+fi
+
+smbmount_clean $TMNT
+smbmount_clean $TMNT2
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_016.ksh b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_016.ksh
new file mode 100644
index 0000000..34d0c1d
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbmount/tp_smbmount_016.ksh
@@ -0,0 +1,101 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbmount_016
+#
+# DESCRIPTION:
+#         -o gid work well
+#
+# STRATEGY:
+#        1. run "mount -F smbfs -o gid=xxx //$TUSER:$TPASS@...
+#        2. ls -ld /mnt get gid xxx
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbmount016"
+tc_desc="gid=xxx worked well"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+testdir_init $TDIR
+smbmount_clean $TMNT
+smbmount_init $TMNT
+
+# XXX: Should get this group from config
+tc_gid="gdm"
+
+cmd="mount -F smbfs -o noprompt,noacl,gid=$tc_gid \
+ //$TUSER:$TPASS@$server/public $TMNT"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	return
+fi
+
+grp=$(ls -ld $TMNT|awk '{ print $4}')
+if [[ $grp != "$tc_gid" ]]; then
+	cti_fail "FAIL: ls -ld, expected $tc_gid, got $grp"
+	smbmount_clean $TMNT
+	return
+fi
+
+cti_execute_cmd "touch $TMNT/a"
+grp=$(cd $TMNT; ls -l a|awk '{ print $4}')
+if [[ $grp != "$tc_gid" ]]; then
+	cti_fail "FAIL: touch a, expected $tc_gid usr, got $grp"
+	smbmount_clean $TMNT
+	return
+fi
+
+cti_execute_cmd "rm -rf $TMNT/b"
+cti_execute_cmd "mkdir $TMNT/b"
+grp=$(cd $TMNT; ls -ld b|awk '{ print $4}')
+if [[ $grp != "$tc_gid" ]]; then
+	cti_fail "FAIL: mkdir b, expected $tc_gid usr, got $grp"
+	smbmount_clean $TMNT
+	return
+fi
+
+cti_execute_cmd "rm -rf $TMNT/*"
+
+cmd="umount $TMNT"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: failed to umount the $TMNT"
+	return
+fi
+
+smbmount_clean $TMNT
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbutil/Makefile b/usr/src/test/smbclient-tests/tests/smbutil/Makefile
new file mode 100644
index 0000000..7527356
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbutil/Makefile
@@ -0,0 +1,39 @@
+#
+# 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 2015 Nexenta Systems, Inc.  All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+include		../../Makefile.com
+
+ROOTTESTDIR=	$(ROOTOPTPKG)/tests/smbutil
+
+TESTS=	\
+		tp_smbutil_001	\
+		tp_smbutil_002	\
+		tp_smbutil_003	\
+		tp_smbutil_004	\
+		tp_smbutil_005	\
+		tp_smbutil_006	\
+		tp_smbutil_007	\
+		tp_smbutil_008	\
+		tp_smbutil_009	\
+		tp_smbutil_010	\
+		tp_smbutil_011	\
+		tp_smbutil_012	\
+		tp_smbutil_013	\
+		tp_smbutil_014	\
+		tp_smbutil_015	\
+		tp_smbutil_016
+
+include		../Makefile.tests
diff --git a/usr/src/test/smbclient-tests/tests/smbutil/tp_smbutil_001.ksh b/usr/src/test/smbclient-tests/tests/smbutil/tp_smbutil_001.ksh
new file mode 100644
index 0000000..18aea3b
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbutil/tp_smbutil_001.ksh
@@ -0,0 +1,88 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbutil_001
+#
+# DESCRIPTION:
+#        Verify smbutil can handle invalid arguments
+#
+# STRATEGY:
+#        1. run "smbutil" ...
+#        2. smbutil can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbutil001"
+tc_desc="Verify smbutil can handle error arg"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+cti_execute_cmd "rm -f core"
+
+cti_execute_cmd "smbutil lookup"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: smbutil lookup succeeded"
+	return
+else
+	cti_report "PASS: smbutil lookup failed"
+fi
+
+cti_execute_cmd "smbutil"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: smbutil succeeded"
+	return
+else
+	cti_report "PASS: smbutil failed"
+fi
+
+cti_execute_cmd "smbutil status"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: smbutil status succeeded"
+	return
+else
+	cti_report "PASS: smbutil status failed"
+fi
+
+cti_execute_cmd "smbutil -a"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: smbutil -a suceeded"
+	return
+else
+	cti_report "PASS: smbutil status failed"
+fi
+
+if [[ -f core ]]; then
+	cti_fail "FAIL: smbutil coredump"
+	return
+fi
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbutil/tp_smbutil_002.ksh b/usr/src/test/smbclient-tests/tests/smbutil/tp_smbutil_002.ksh
new file mode 100644
index 0000000..850e7ad
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbutil/tp_smbutil_002.ksh
@@ -0,0 +1,81 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbutil_002
+#
+# DESCRIPTION:
+#        Verify smbutil lookup can resolve NETBIOS name.
+#
+# STRATEGY:
+#        1. run "smbutil lookup" on  he smb NETBIOS name
+#        2. smbutil can resolve the smb NETBIOS name
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbutil002"
+tc_desc="Test smbutil status, smbutil lookup"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+# Try "status" first, which basically tells us if the
+# server supports NetBIOS.  If not, UNSUPPORTED.
+cmd="smbutil status $server"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_unsupported "SKIP: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+# Get the server name from the status output.
+grep '^Server' cti_stdout | read junk nbname
+if [[ "x$nbname" == x ]] ; then
+	cti_unsupported "SKIP: Can't get NetBIOS name."
+	return
+else
+	cti_report "Server NetBIOS name: $nbname"
+fi
+
+# Now try lookup of the NetBIOS name.
+cmd="smbutil lookup $nbname"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: $cmd"
+	return
+else
+	cti_report "PASS: $cmd"
+fi
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbutil/tp_smbutil_003.ksh b/usr/src/test/smbclient-tests/tests/smbutil/tp_smbutil_003.ksh
new file mode 100644
index 0000000..9ece2ed
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbutil/tp_smbutil_003.ksh
@@ -0,0 +1,91 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbutil_003
+#
+# DESCRIPTION:
+#        Verify smbutil login can work.
+#
+# STRATEGY:
+#	1. run "smbutil login ..."
+#	2. Verify with "smbutil login -c ..."
+#	3. Verify smbutil view can authenticate
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbutil003"
+tc_desc="Verify smbutil login works"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+# clean up all the password
+smbutil logout -a
+cmd="$EXPECT $SMBUTILEXP $TUSER $TPASS"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbutil login failed to set passwd"
+	return
+else
+	cti_report "PASS: smbutil login succeed to set passwd"
+fi
+
+cmd="smbutil login -c $TUSER | grep exists"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: keychain doesn't exist"
+	return
+else
+	cti_report "PASS: the keychain doesn't exist"
+fi
+
+cmd="smbutil view //$TUSER@$server"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbutil can't view shares"
+	return
+else
+	cti_report "PASS: smbutil  can view shares"
+fi
+
+parse_view_output public cti_stdout
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbutil view can't get the public share"
+	return
+else
+	cti_report "PASS: smbutil view can get the public share"
+fi
+
+smbutil logout -a
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbutil/tp_smbutil_004.ksh b/usr/src/test/smbclient-tests/tests/smbutil/tp_smbutil_004.ksh
new file mode 100644
index 0000000..0fb55a2
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbutil/tp_smbutil_004.ksh
@@ -0,0 +1,57 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbutil_004
+#
+# DESCRIPTION:
+#        Verify smbutil status can handle invalid hostname
+#
+# STRATEGY:
+#	1. run "smbutil status  invalid"
+#	2. get correct help message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbutil004"
+tc_desc="Verify smbutil status can handle error arg"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+cti_execute_cmd "smbutil status bad"
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: smbutil status bad succeeded"
+	return
+else
+	cti_report "PASS: smbutil status bad failed"
+fi
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbutil/tp_smbutil_005.ksh b/usr/src/test/smbclient-tests/tests/smbutil/tp_smbutil_005.ksh
new file mode 100644
index 0000000..056acff
--- /dev/null
+++ b/usr/src/test/smbclient-tests/tests/smbutil/tp_smbutil_005.ksh
@@ -0,0 +1,123 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+#
+
+#
+# ID: smbutil_005
+#
+# DESCRIPTION:
+#        Verify smbutil logoutall could work
+#
+# STRATEGY:
+#	1. set up smb server on a test machine
+#	2. run "smbutil logoutall"
+#	3. smbutil logout and smbutil login can get the right message
+#
+
+. $STF_SUITE/include/libtest.ksh
+
+tc_id="smbutil005"
+tc_desc="Verify smbutil logout could work"
+print_test_case $tc_id - $tc_desc
+
+if [[ $STC_CIFS_CLIENT_DEBUG == 1 ]] || \
+	[[ *:${STC_CIFS_CLIENT_DEBUG}:* == *:$tc_id:* ]]; then
+    set -x
+fi
+
+server=$(server_name) || return
+
+# initialize
+sudo -n smbutil logoutall
+
+cmd="$EXPECT $SMBUTILEXP $TUSER $TPASS"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbutil login failed to set passwd"
+	return
+else
+	cti_report "PASS: smbutil login succeeded to set passwd"
+fi
+
+cmd="smbutil login -c $TUSER | grep exists"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: keychain doesn't exist"
+	return
+else
+	cti_report "PASS: keychain exists"
+fi
+
+cmd="smbutil view //$TUSER@$server"
+cti_execute -i '' FAIL $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbutil can't view shares"
+	return
+else
+	cti_report "PASS: smbutil can view shares"
+fi
+
+parse_view_output public cti_stdout
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbutil view can't get the public share"
+	return
+else
+	cti_report "PASS: smbutil view can get the public share"
+fi
+
+cmd="smbutil logout $TUSER"
+cti_execute_cmd $cmd
+if [[ $? != 0 ]]; then
+	cti_fail "FAIL: smbutil logout failed"
+	return
+else
+	cti_report "PASS: smbutil logout succeeded"
+fi
+
+cmd="smbutil login -c $TUSER | grep exists"
+cti_execute_cmd $cmd
+if [[ $? == 0 ]]; then
+	cti_fail "FAIL: keychain exists"
+	return
+else
+	cti_report "PASS: keychain doesn't exist"
+fi
+
+# get rid of our connection first
+cti_execute_cmd "smbutil discon //$TUSER@$server"
+sleep 1
+
+cti_report "expect failure next"
+cmd="smbutil view -N //$TUSER@$server"
+cti_execute -i '' PASS $cmd
+if [[ $? == 0 ]]; then
+	cti_execute_cmd "echo ::nsmb_vc|mdb -k"
+	cti_fail "FAIL: smbutil can view shares"
+	return
+else
+	cti_report "PASS: smbutil can't view shares"
+fi
+
+cti_pass "${tc_id}: PASS"
diff --git a/usr/src/test/smbclient-tests/tests/smbutil/tp_smbutil_006.ksh