diff mbox series

[1/5] fstests: add _require_sysctl_variable helper

Message ID 594b47bd-26b6-5156-9200-cc4c4d51d05d@redhat.com (mailing list archive)
State New, archived
Headers show
Series fstests: recent series rollup / misc tests & fixes | expand

Commit Message

Eric Sandeen May 18, 2020, 4:11 p.m. UTC
New _require_sysctl_variable test to ensure that the sysctl we wish to
test is available on the system.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

Next 2 patches will use this.

V2: rename to "_require_sysctl_variable" (sysctl man page calls these
"variables")

 common/rc | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/common/rc b/common/rc
index b25cad0e..62952036 100644
--- a/common/rc
+++ b/common/rc
@@ -4209,6 +4209,12 @@  _require_bsd_process_accounting()
 	$ACCTON_PROG off >> $seqres.full
 }
 
+_require_sysctl_variable()
+{
+	local name=$1
+	sysctl $name &>/dev/null || _notrun "$name sysctl unavailable"
+}
+
 init_rc
 
 ################################################################################