xref: /freebsd/sys/contrib/openzfs/tests/zfs-tests/tests/functional/alloc_class/alloc_class_010_pos.ksh (revision df58e8b1506f241670be86a560fb6e8432043aee)
1#!/bin/ksh -p
2# SPDX-License-Identifier: CDDL-1.0
3
4#
5# This file and its contents are supplied under the terms of the
6# Common Development and Distribution License ("CDDL"), version 1.0.
7# You may only use this file in accordance with the terms of version
8# 1.0 of the CDDL.
9#
10# A full copy of the text of the CDDL should have accompanied this
11# source.  A copy of the CDDL is also available via the Internet at
12# http://www.illumos.org/license/CDDL.
13#
14
15#
16# Copyright (c) 2017, Intel Corporation.
17# Copyright (c) 2018 by Delphix. All rights reserved.
18#
19
20. $STF_SUITE/tests/functional/alloc_class/alloc_class.kshlib
21
22#
23# DESCRIPTION:
24#	Setting the special_small_blocks property to a valid value succeeds.
25#
26
27verify_runnable "global"
28
29claim="Setting the special_small_blocks property to a valid value succeeds."
30
31log_assert $claim
32log_onexit cleanup
33
34log_must disk_setup
35
36log_must zpool create $TESTPOOL raidz $ZPOOL_DISKS special mirror \
37	$CLASS_DISK0 $CLASS_DISK1
38
39for value in 0 200 512 1300 4096 12345 131072 1572864 16777216
40do
41	log_must zfs set special_small_blocks=$value $TESTPOOL
42	ACTUAL=$(zfs get -p special_small_blocks $TESTPOOL | \
43		awk '/special_small_blocks/ {print $3}')
44	if [ "$ACTUAL" != "$value" ]
45	then
46		log_fail "v. $ACTUAL set for $TESTPOOL, expected v. $value!"
47	fi
48done
49
50log_must zpool destroy -f "$TESTPOOL"
51log_pass $claim
52