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 https://opensource.org/licenses/CDDL-1.0. 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, 2019 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 34verify_runnable "global" 35 36if ! is_linux ; then 37 log_unsupported "sysfs is linux-only" 38fi 39 40claim="Expected '/sys/module/zfs/<dir>/<attr>' attributes are present" 41 42kernel_feature_attr="/sys/module/zfs/features.kernel/org.zfsonlinux:vdev_trim/supported" 43pool_feature_attr="/sys/module/zfs/features.pool/org.open-zfs:large_blocks/guid" 44pool_prop__attr="/sys/module/zfs/properties.pool/comment/values" 45ds_prop__attr="/sys/module/zfs/properties.dataset/recordsize/values" 46 47log_assert $claim 48 49log_must cat $kernel_feature_attr 50log_must cat $pool_feature_attr 51log_must cat $pool_prop__attr 52log_must cat $ds_prop__attr 53 54# force a read of all the attributes for show func code coverage 55log_must grep -R "[a-z]" /sys/module/zfs/features.* 56log_must grep -R "[a-z]" /sys/module/zfs/properties.* 57log_mustnot grep -RE "[^[:print:]]" /sys/module/zfs/properties.* 58 59log_pass $claim 60