From b36fe6efc5e44dcc0f8b3b5838d6e10105a46e6a Mon Sep 17 00:00:00 2001 From: Craig Small Date: Mon, 28 Nov 2011 22:02:27 +1100 Subject: Add sysctl check and tests to extra_dist --- testsuite/sysctl.test/sysctl_read.exp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 testsuite/sysctl.test/sysctl_read.exp (limited to 'testsuite/sysctl.test') diff --git a/testsuite/sysctl.test/sysctl_read.exp b/testsuite/sysctl.test/sysctl_read.exp new file mode 100644 index 0000000..aa2b185 --- /dev/null +++ b/testsuite/sysctl.test/sysctl_read.exp @@ -0,0 +1,25 @@ +# +# Dejagnu tests for sysctl (read only) - part of procps +# +set sysctl ${topdir}sysctl +set hostname [ exec cat "/proc/sys/kernel/hostname" ] + +set test "sysctl with no arguments" +spawn $sysctl +expect_pass "$test" "^usage:\\s+\(lt-\)?sysctl \\\[-n\\\] \\\[-e\\\] variable \\.\\.\\.\\s+" + +set test "sysctl reading a variable using slash delimiter" +spawn $sysctl kernel/hostname +expect_pass "$test" "kernel.hostname = ${hostname}" + +set test "sysctl reading a variable using dot delimiter" +spawn $sysctl kernel.hostname +expect_pass "$test" "kernel.hostname = ${hostname}" + +set test "sysctl reading a variable suppress key" +spawn $sysctl -n kernel.hostname +expect_pass "$test" "${hostname}" + +set test "sysctl reading a variable suppress value" +spawn $sysctl -N kernel.hostname +expect_pass "$test" "kernel.hostname" -- cgit v1.2.1