]>
Commit | Line | Data |
---|---|---|
e8bcb693 DB |
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 | # | |
b4ddec7a | 24 | # Copyright (c) 2018, 2019 by Delphix. All rights reserved. |
e8bcb693 DB |
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 | ||
b4ddec7a DB |
42 | kernel_feature_attr="/sys/module/zfs/features.kernel/org.zfsonlinux:vdev_trim/supported" |
43 | pool_feature_attr="/sys/module/zfs/features.pool/org.open-zfs:large_blocks/guid" | |
e8bcb693 DB |
44 | pool_prop__attr="/sys/module/zfs/properties.pool/comment/values" |
45 | ds_prop__attr="/sys/module/zfs/properties.dataset/recordsize/values" | |
46 | ||
47 | log_assert $claim | |
48 | ||
b4ddec7a DB |
49 | log_must cat $kernel_feature_attr |
50 | log_must cat $pool_feature_attr | |
e8bcb693 DB |
51 | log_must cat $pool_prop__attr |
52 | log_must cat $ds_prop__attr | |
53 | ||
54 | # force a read of all the attributes for show func code coverage | |
55 | log_must grep -R "[a-z]" /sys/module/zfs/features.* | |
56 | log_must grep -R "[a-z]" /sys/module/zfs/properties.* | |
57 | log_mustnot grep -RE "[^[:print:]]" /sys/module/zfs/properties.* | |
58 | ||
59 | log_pass $claim |