--- old/usr/src/pkg/manifests/system-test-zfstest.mf	Mon Nov 30 12:57:57 2015
+++ new/usr/src/pkg/manifests/system-test-zfstest.mf	Mon Nov 30 12:57:57 2015
@@ -1916,6 +1916,7 @@
 file path=opt/zfs-tests/tests/functional/refquota/refquota_004_pos mode=0555
 file path=opt/zfs-tests/tests/functional/refquota/refquota_005_pos mode=0555
 file path=opt/zfs-tests/tests/functional/refquota/refquota_006_neg mode=0555
+file path=opt/zfs-tests/tests/functional/refquota/refquota_007_pos mode=0555
 file path=opt/zfs-tests/tests/functional/refquota/setup mode=0555
 file path=opt/zfs-tests/tests/functional/refreserv/cleanup mode=0555
 file path=opt/zfs-tests/tests/functional/refreserv/refreserv.cfg mode=0555
--- old/usr/src/test/zfs-tests/runfiles/delphix.run	Mon Nov 30 12:57:58 2015
+++ new/usr/src/test/zfs-tests/runfiles/delphix.run	Mon Nov 30 12:57:58 2015
@@ -434,7 +434,8 @@
 
 [/opt/zfs-tests/tests/functional/refquota]
 tests = ['refquota_001_pos', 'refquota_002_pos', 'refquota_003_pos',
-    'refquota_004_pos', 'refquota_005_pos', 'refquota_006_neg']
+    'refquota_004_pos', 'refquota_005_pos', 'refquota_006_neg',
+    'refquota_007_pos']
 
 [/opt/zfs-tests/tests/functional/refreserv]
 tests = ['refreserv_001_pos', 'refreserv_002_pos', 'refreserv_003_pos',
--- old/usr/src/test/zfs-tests/runfiles/omnios.run	Mon Nov 30 12:57:58 2015
+++ new/usr/src/test/zfs-tests/runfiles/omnios.run	Mon Nov 30 12:57:58 2015
@@ -433,7 +433,8 @@
 
 [/opt/zfs-tests/tests/functional/refquota]
 tests = ['refquota_001_pos', 'refquota_002_pos', 'refquota_003_pos',
-    'refquota_004_pos', 'refquota_005_pos', 'refquota_006_neg']
+    'refquota_004_pos', 'refquota_005_pos', 'refquota_006_neg',
+    'refquota_007_pos']
 
 [/opt/zfs-tests/tests/functional/refreserv]
 tests = ['refreserv_001_pos', 'refreserv_002_pos', 'refreserv_003_pos',
--- old/usr/src/test/zfs-tests/runfiles/openindiana.run	Mon Nov 30 12:57:58 2015
+++ new/usr/src/test/zfs-tests/runfiles/openindiana.run	Mon Nov 30 12:57:58 2015
@@ -433,7 +433,8 @@
 
 [/opt/zfs-tests/tests/functional/refquota]
 tests = ['refquota_001_pos', 'refquota_002_pos', 'refquota_003_pos',
-    'refquota_004_pos', 'refquota_005_pos', 'refquota_006_neg']
+    'refquota_004_pos', 'refquota_005_pos', 'refquota_006_neg',
+    'refquota_007_pos']
 
 [/opt/zfs-tests/tests/functional/refreserv]
 tests = ['refreserv_001_pos', 'refreserv_002_pos', 'refreserv_003_pos',
--- old/usr/src/test/zfs-tests/tests/functional/refquota/Makefile	Mon Nov 30 12:57:58 2015
+++ new/usr/src/test/zfs-tests/tests/functional/refquota/Makefile	Mon Nov 30 12:57:58 2015
@@ -25,6 +25,7 @@
 	refquota_004_pos \
 	refquota_005_pos \
 	refquota_006_neg \
+	refquota_007_pos \
 	setup
 
 CMDS = $(PROGS:%=$(TESTDIR)/%)
--- /dev/null	Mon Nov 30 12:57:58 2015
+++ new/usr/src/test/zfs-tests/tests/functional/refquota/refquota_007_pos.ksh	Mon Nov 30 12:57:58 2015
@@ -0,0 +1,83 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# 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.
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+#
+# DESCRIPTION:
+#	refquota should be sent-and-received, but it should not interfere with
+#	the receipt of intermediate snapshots that may have proceeded the
+#	final snapshot, where the refquota should hold.
+#
+# STRATEGY:
+#	1. Create a filesystem.
+#	2. Create two equal-sized large files.
+#	3. Snapshot the filesystem.
+#	4. Remove one of the two large files.
+#	5. Create a refquota larger than one file, but smaller than both.
+#	6. Snapshot the filesystem again.
+#	7. Send a replication stream of the second snapshot to a new filesystem.
+#
+#
+# NOTE:	illumos bug 4986 used the above strategy to demonstrate a failure.
+# 	This test will fail until illumos 4986 is fixed.
+#
+
+verify_runnable "both"
+
+function cleanup
+{
+	log_must $ZFS destroy -rf $TESTPOOL/$TESTFS1
+	log_must $ZFS destroy -rf $TESTPOOL/$TESTFS2
+}
+
+log_assert "refquota is properly sent-and-received, regardless of any " \
+	"intermediate snapshots sent by a replication stream."
+log_onexit cleanup
+
+orig=$TESTPOOL/$TESTFS1
+dest=$TESTPOOL/$TESTFS2
+#	1. Create a filesystem.
+log_must $ZFS create $orig
+origdir=$(get_prop mountpoint $orig)
+
+#	2. Create two equal-sized large files.
+log_must $MKFILE 25M $origdir/file1
+log_must $MKFILE 25M $origdir/file2
+log_must $SYNC
+
+#	3. Snapshot the filesystem.
+log_must $ZFS snapshot $orig@1
+
+#	4. Remove one of the two large files.
+log_must $RM $origdir/file2
+log_must $SYNC
+
+#	5. Create a refquota larger than one file, but smaller than both.
+log_must $ZFS set refquota=38M $orig
+
+#	6. Snapshot the filesystem again.
+log_must $ZFS snapshot $orig@2
+
+#	7. Send a replication stream of the second snapshot to a new filesystem.
+log_must $ZFS send -R $orig@2 | $ZFS recv $dest
+
+log_pass "refquota is properly sent-and-received, regardless of any " \
+	"intermediate snapshots sent by a replication stream."
