]> granicus.if.org Git - procps-ng/commitdiff
Add sysctl check and tests to extra_dist
authorCraig Small <csmall@enc.com.au>
Mon, 28 Nov 2011 11:02:27 +0000 (22:02 +1100)
committerCraig Small <csmall@enc.com.au>
Mon, 28 Nov 2011 11:02:27 +0000 (22:02 +1100)
testsuite/Makefile.am
testsuite/sysctl.test/sysctl_read.exp [new file with mode: 0644]

index 35a41d3f105a9cf5605d74295fd0a0c959ef316a..50676f97e68eb64a828afcab7d819e6eb2bfddcb 100644 (file)
@@ -11,4 +11,15 @@ DEJATOOL = \
                   w
                
        
-
+EXTRA_DIST = \
+                        w.test/w.exp \
+                        pgrep.test/pgrep.exp \
+                        site.exp \
+                        config/unix.exp \
+                        uptime.test/uptime.exp \
+                        pmap.test/pmap.exp \
+                        pwdx.test/pwdx.exp \
+                        free.test/free.exp \
+                        global-conf.exp \
+                        sysctl.test/sysctl_read.exp \
+                        vmstat.test/vmstat.exp
diff --git a/testsuite/sysctl.test/sysctl_read.exp b/testsuite/sysctl.test/sysctl_read.exp
new file mode 100644 (file)
index 0000000..aa2b185
--- /dev/null
@@ -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"