From 532dc9239d33a3f7bb25de438fb2a709b0269863 Mon Sep 17 00:00:00 2001 From: Craig Small Date: Mon, 2 Jan 2012 17:39:41 +1100 Subject: [PATCH] Updated testsuite files for new NLS output --- testsuite/config/unix.exp | 7 ++++++- testsuite/kill.test/kill.exp | 4 ++-- testsuite/pgrep.test/pgrep.exp | 2 +- testsuite/pkill.test/pkill.exp | 2 +- testsuite/pmap.test/pmap.exp | 9 +++++---- testsuite/pwdx.test/pwdx.exp | 4 ++-- testsuite/slabtop.test/slabtop.exp | 2 +- testsuite/sysctl.test/sysctl_read.exp | 2 +- testsuite/w.test/w.exp | 2 +- 9 files changed, 20 insertions(+), 14 deletions(-) diff --git a/testsuite/config/unix.exp b/testsuite/config/unix.exp index b1d28fae..5331b0df 100644 --- a/testsuite/config/unix.exp +++ b/testsuite/config/unix.exp @@ -1,11 +1,16 @@ regexp "(.*\/)testsuite" $objdir objdir topdir +# These are the same as include/c.h +set usage_help "\\s*-h, --help\\s+display this help and exit\\s+" +set usage_version "\\s*-V, --version\\s+output version information and exit\\s+" +set usage_man "\\s*For more details see \\S+\\." + proc procps_v_version { tool } { global topdir set toolpath ${topdir}${tool} set tmp [ exec $toolpath -V ] - regexp "procps-ng version (\[0-9.\]*)" $tmp tmp version + regexp "from procps-ng (\[0-9.\]*)" $tmp tmp version clone_output "$toolpath version $version\n" } diff --git a/testsuite/kill.test/kill.exp b/testsuite/kill.test/kill.exp index 5f4e8ec9..8b0d61b4 100644 --- a/testsuite/kill.test/kill.exp +++ b/testsuite/kill.test/kill.exp @@ -5,7 +5,7 @@ set kill ${topdir}kill set test "kill with no arguments" spawn $kill -expect_pass "$test" "Usage:\\s+kill pid ...\\s+Send SIGTERM to every process listed.\\r\\s+kill signal pid ...\\s+Send a signal to every process listed.\\r\\s+kill -s signal pid ...\\s+Send a signal to every process listed.\\r\\s+kill -l\\s+List all signal names.\\r\\s+kill -L\\s+List all signal names in a nice table.\\r\\s+kill -l signal\\s+Convert between signal numbers and names." +expect_pass "$test" "Usage:\\s+\(lt-\)?kill \\\[options\\\] \\\[...\\\]\\s+Options:\\s+ \\\[...\\\]\\s+send signal to every listed\\s+-, -s, --signal \\s+specify the to be sent\\s+-l, --list=\\\[\\\]\\s+list all signal names, or convert one to a name\\\s+-L, --table\\s+list all signal names in a nice table$usage_help$usage_version$usage_man" set test "kill list signal names" spawn $kill -l @@ -16,7 +16,7 @@ spawn $kill -L expect_pass "$test" "^\(\\s+\\d+ \[A-Z12\]+\)+\\s*$" set test "kill convert signal name to number" -spawn $kill -l HUP +spawn $kill -lHUP expect_pass "$test" "^1\\s*" set test "kill convert signal number to name" diff --git a/testsuite/pgrep.test/pgrep.exp b/testsuite/pgrep.test/pgrep.exp index c030092b..02340994 100644 --- a/testsuite/pgrep.test/pgrep.exp +++ b/testsuite/pgrep.test/pgrep.exp @@ -19,7 +19,7 @@ set testproc1_sid [ string trim [ exec ps --no-headers -o sid $testproc1_pid ] ] set test "pgprep with no arguments" spawn $pgrep -expect_pass "$test" "^pgrep: No matching criteria specified\\s*" +expect_pass "$test" "^\(lt-\)\?pgrep: no matching criteria specified\\s*" set test "pgrep find both test pids" spawn $pgrep $testproc_comm diff --git a/testsuite/pkill.test/pkill.exp b/testsuite/pkill.test/pkill.exp index 50d73387..83a6d757 100644 --- a/testsuite/pkill.test/pkill.exp +++ b/testsuite/pkill.test/pkill.exp @@ -18,7 +18,7 @@ set testproc1_sid [ exec ps --no-headers -o sid $testproc1_pid ] set test "pkill with no arguments" spawn $pkill -expect_pass "$test" "^pkill: No matching criteria specified\\s*" +expect_pass "$test" "^\(lt-\)\?pkill: no matching criteria specified\\s*" set test "pkill find both test pids" #spawn $pkill $testproc diff --git a/testsuite/pmap.test/pmap.exp b/testsuite/pmap.test/pmap.exp index 5dce21e7..343e5242 100644 --- a/testsuite/pmap.test/pmap.exp +++ b/testsuite/pmap.test/pmap.exp @@ -7,19 +7,20 @@ set mypid [pid] set pmap_procname "${mypid}:\\s+\\S+\[^\\r\]+\\s+" set pmap_std_header $pmap_procname set pmap_device_header "${pmap_procname}Address\\s+Kbytes\\s+Mode\\s+Offset\\s+Device\\s+Mapping\\s+" -set pmap_ext_header "${pmap_procname}Address\\s+Kbytes\\s+RSS\\s+Anon\\s+Locked\\s+Mode\\s+Mapping\\s+" +set pmap_ext_header "${pmap_procname}Address\\s+Kbytes\\s+RSS\\s+Dirty\\s+Mode\\s+Mapping\\s+" set pmap_std_items "\(\[0-9a-f\]+\\s+\\d+K \[rwx-\]{5}\\s+\\S+\[^\\r\]+\\s*\)+" set pmap_device_items "\(\[0-9a-f\]+\\s+\\d+ \[rwx-\]{5}\\s+\[0-9a-f\]+\\s+\[0-9a-f\]{3}:\[0-9a-f\]{5}\\s+\\S+\[^\\r\]+\\s*\)+" -set pmap_ext_items "\(\[0-9a-f\]+\\s+\\d+\\s+-\\s+-\\s+- \[rwx-\]{5}\\s+\\S+\[^\\r\]+\\s*\)+" +set pmap_ext_items "\(\[0-9a-f\]+\\s+\\d+\\s+\\d+\\s+\\d+ \[rwx-\]{5}\\s+\\S+\[^\\r\]+\\s*\)+" set pmap_std_footer "total\\s+\\d+K\\s*\$" set pmap_device_footer "mapped:\\s+\\d+K\\s+writeable\/private:\\s+\\d+K\\s+shared:\\s+\\d+K\\s*\$" -set pmap_ext_footer "\[ -\]+\\s+total kB\\s+\\d+\\s+-\\s+-\\s+-\\s*\$" +set pmap_ext_footer "\[ -\]+\\s+total kB\\s+\\d+\\s+\\d+\\s+\\d+\\s*\$" set test "pmap with no arguments" spawn $pmap -expect_pass "$test" "^Usage: pmap \\\[-x | -d\\\] \\\[-q\\\] \\\[-A low,high\\\] pid\\.\\.\\.\\s+-x\\s+show details\\s+-d\\s+show offset and device number\\s+-q\\s+quiet; less header/footer info\\s+-V\\s+show the version number\\s+-A\\s+limit results to the given range\\s*" +expect_pass "$test" "^\(lt-\)\?pmap: argument missing" +#expect_pass "$test" "^Usage: pmap \\\[-x | -d\\\] \\\[-q\\\] \\\[-A low,high\\\] pid\\.\\.\\.\\s+-x\\s+show details\\s+-d\\s+show offset and device number\\s+-q\\s+quiet; less header/footer info\\s+-V\\s+show the version number\\s+-A\\s+limit results to the given range\\s*" set test "pmap standard output" spawn $pmap $mypid diff --git a/testsuite/pwdx.test/pwdx.exp b/testsuite/pwdx.test/pwdx.exp index 20882ca1..0ca0b152 100644 --- a/testsuite/pwdx.test/pwdx.exp +++ b/testsuite/pwdx.test/pwdx.exp @@ -3,12 +3,12 @@ set pwdx "${topdir}pwdx" # Run pwdx with no arguments set test "pwdx no args" spawn $pwdx -expect_pass "$test" "^Usage: pwdx pid\.\.\." +expect_pass "$test" "^\\s*Usage:\\s+\(lt-\)\?pwdx \\\[options\\\] pid\.\.\." # Run pwdx with pid 0 which is invalid set test "pwdx pid 0 should be invalid" spawn $pwdx 0 -expect_pass "$test" "^pwdx: invalid process id" +expect_pass "$test" "^0: No such process" # Run pwdx with existing pid set test "pwdx finds sleep in cwd" diff --git a/testsuite/slabtop.test/slabtop.exp b/testsuite/slabtop.test/slabtop.exp index 99f74790..93f99791 100644 --- a/testsuite/slabtop.test/slabtop.exp +++ b/testsuite/slabtop.test/slabtop.exp @@ -14,7 +14,7 @@ set slabtop_header "^ $avst Objects $used \\d+ / \\d+ ${pct}\\s+$avst Slabs $use set test "slabtop help" spawn $slabtop --help -expect_pass $test "usage: \\S+ \\\[options\\\]" +expect_pass $test "^\\s+Usage:\\s+\(lt-\)\?slabtop \\\[options\\\]" set sort_tests { "a" "active objects" "^\\s*\\d+\\s+(\\d+)\\s+\\d+%\\s+\\d+\\.\\d+K\\s+\\d+\\s+\\d+\\s+\\d+K\\s+\\S\[^\r\]+\\s*" diff --git a/testsuite/sysctl.test/sysctl_read.exp b/testsuite/sysctl.test/sysctl_read.exp index aa2b185c..aa2368c0 100644 --- a/testsuite/sysctl.test/sysctl_read.exp +++ b/testsuite/sysctl.test/sysctl_read.exp @@ -6,7 +6,7 @@ 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+" +expect_pass "$test" "^\\s+Usage:\\s+\(lt-\)?sysctl \\\[options\\\] \\\[variable\\\[=value\\\] \.\.\.\\\]" set test "sysctl reading a variable using slash delimiter" spawn $sysctl kernel/hostname diff --git a/testsuite/w.test/w.exp b/testsuite/w.test/w.exp index 2eebab42..eb76882b 100644 --- a/testsuite/w.test/w.exp +++ b/testsuite/w.test/w.exp @@ -12,7 +12,7 @@ set w_fromshort_header "${w_uptime}USER\\s+TTY\\s+FROM\\s+IDLE\\s+WHAT\\s+" set w_user "\[A-Za-z0-9_-\]+" set w_tty "\[a-z0-9/]+" -set w_from "\[A-Za-z0-9.:-\]+" +set w_from "\[A-Za-z0-9.:-\]*" set w_login "\(\\d+\[A-Z\]\[a-z\]{2}\\d+\|\[A-Z\]\[a-z\]{2}\\d+\|\\d+:\\d+\)" set w_idle "\(\\?xdm\\?\|\\?\|\\d+days\|\\d+:\\d+m?\|\\d+.\\d+s\)" set w_ival7 "\(\\?\|\\d+days\|\\d+:\\d+m?\|\\d+.\\d+s\)"