aboutsummaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'tests/zfs-tests/cmd')
-rw-r--r--tests/zfs-tests/cmd/libzfs_input_check.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/zfs-tests/cmd/libzfs_input_check.c b/tests/zfs-tests/cmd/libzfs_input_check.c
index a1dfaefd7..c661718a2 100644
--- a/tests/zfs-tests/cmd/libzfs_input_check.c
+++ b/tests/zfs-tests/cmd/libzfs_input_check.c
@@ -27,6 +27,7 @@
#include <sys/vdev_impl.h>
#include <sys/zfs_ioctl.h>
#include <sys/zfs_bootenv.h>
+#include <sys/fs/zfs.h>
/*
* Test the nvpair inputs for the non-legacy zfs ioctl commands.
@@ -688,6 +689,17 @@ test_vdev_trim(const char *pool)
nvlist_free(required);
}
+/* Test with invalid values */
+static void
+test_scrub(const char *pool)
+{
+ nvlist_t *required = fnvlist_alloc();
+ fnvlist_add_uint64(required, "scan_type", POOL_SCAN_FUNCS + 1);
+ fnvlist_add_uint64(required, "scan_command", POOL_SCRUB_FLAGS_END + 1);
+ IOC_INPUT_TEST(ZFS_IOC_POOL_SCRUB, pool, required, NULL, EINVAL);
+ nvlist_free(required);
+}
+
static int
zfs_destroy(const char *dataset)
{
@@ -868,6 +880,8 @@ zfs_ioc_input_tests(const char *pool)
test_set_bootenv(pool);
test_get_bootenv(pool);
+ test_scrub(pool);
+
/*
* cleanup
*/
@@ -1022,6 +1036,7 @@ validate_ioc_values(void)
CHECK(ZFS_IOC_BASE + 82 == ZFS_IOC_GET_BOOKMARK_PROPS);
CHECK(ZFS_IOC_BASE + 83 == ZFS_IOC_WAIT);
CHECK(ZFS_IOC_BASE + 84 == ZFS_IOC_WAIT_FS);
+ CHECK(ZFS_IOC_BASE + 87 == ZFS_IOC_POOL_SCRUB);
CHECK(ZFS_IOC_PLATFORM_BASE + 1 == ZFS_IOC_EVENTS_NEXT);
CHECK(ZFS_IOC_PLATFORM_BASE + 2 == ZFS_IOC_EVENTS_CLEAR);
CHECK(ZFS_IOC_PLATFORM_BASE + 3 == ZFS_IOC_EVENTS_SEEK);