]> git.proxmox.com Git - mirror_zfs.git/blob - tests/zfs-tests/tests/functional/cli_root/zfs_sysfs/zfs_sysfs_live.ksh
17ac8f8a1a4b41f34d654571bd08431b6a6d211b
[mirror_zfs.git] / tests / zfs-tests / tests / functional / cli_root / zfs_sysfs / zfs_sysfs_live.ksh
1 #!/bin/ksh -p
2 #
3 # CDDL HEADER START
4 #
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
8 #
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 #
20 # CDDL HEADER END
21 #
22
23 #
24 # Copyright (c) 2018 by Delphix. All rights reserved.
25 #
26
27 . $STF_SUITE/include/libtest.shlib
28
29 #
30 # DESCRIPTION:
31 # Test if the expected '/sys/module/zfs/<dir>/<attr>' are present
32 #
33
34 verify_runnable "global"
35
36 if ! is_linux ; then
37 log_unsupported "sysfs is linux-only"
38 fi
39
40 claim="Expected '/sys/module/zfs/<dir>/<attr>' attributes are present"
41
42 feature_attr="/sys/module/zfs/features.pool/org.open-zfs:large_blocks/guid"
43 pool_prop__attr="/sys/module/zfs/properties.pool/comment/values"
44 ds_prop__attr="/sys/module/zfs/properties.dataset/recordsize/values"
45
46 log_assert $claim
47
48 log_must cat $feature_attr
49 log_must cat $pool_prop__attr
50 log_must cat $ds_prop__attr
51
52 # force a read of all the attributes for show func code coverage
53 log_must grep -R "[a-z]" /sys/module/zfs/features.*
54 log_must grep -R "[a-z]" /sys/module/zfs/properties.*
55 log_mustnot grep -RE "[^[:print:]]" /sys/module/zfs/properties.*
56
57 log_pass $claim