Updated testsuite files for new NLS output
This commit is contained in:
parent
c3405fab1a
commit
532dc9239d
@ -1,11 +1,16 @@
|
|||||||
|
|
||||||
regexp "(.*\/)testsuite" $objdir objdir topdir
|
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 } {
|
proc procps_v_version { tool } {
|
||||||
global topdir
|
global topdir
|
||||||
set toolpath ${topdir}${tool}
|
set toolpath ${topdir}${tool}
|
||||||
set tmp [ exec $toolpath -V ]
|
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"
|
clone_output "$toolpath version $version\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ set kill ${topdir}kill
|
|||||||
|
|
||||||
set test "kill with no arguments"
|
set test "kill with no arguments"
|
||||||
spawn $kill
|
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\\\] <pid> \\\[...\\\]\\s+Options:\\s+<pid> \\\[...\\\]\\s+send signal to every <pid> listed\\s+-<signal>, -s, --signal <signal>\\s+specify the <signal> to be sent\\s+-l, --list=\\\[<signal>\\\]\\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"
|
set test "kill list signal names"
|
||||||
spawn $kill -l
|
spawn $kill -l
|
||||||
@ -16,7 +16,7 @@ spawn $kill -L
|
|||||||
expect_pass "$test" "^\(\\s+\\d+ \[A-Z12\]+\)+\\s*$"
|
expect_pass "$test" "^\(\\s+\\d+ \[A-Z12\]+\)+\\s*$"
|
||||||
|
|
||||||
set test "kill convert signal name to number"
|
set test "kill convert signal name to number"
|
||||||
spawn $kill -l HUP
|
spawn $kill -lHUP
|
||||||
expect_pass "$test" "^1\\s*"
|
expect_pass "$test" "^1\\s*"
|
||||||
|
|
||||||
set test "kill convert signal number to name"
|
set test "kill convert signal number to name"
|
||||||
|
@ -19,7 +19,7 @@ set testproc1_sid [ string trim [ exec ps --no-headers -o sid $testproc1_pid ] ]
|
|||||||
|
|
||||||
set test "pgprep with no arguments"
|
set test "pgprep with no arguments"
|
||||||
spawn $pgrep
|
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"
|
set test "pgrep find both test pids"
|
||||||
spawn $pgrep $testproc_comm
|
spawn $pgrep $testproc_comm
|
||||||
|
@ -18,7 +18,7 @@ set testproc1_sid [ exec ps --no-headers -o sid $testproc1_pid ]
|
|||||||
|
|
||||||
set test "pkill with no arguments"
|
set test "pkill with no arguments"
|
||||||
spawn $pkill
|
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"
|
set test "pkill find both test pids"
|
||||||
#spawn $pkill $testproc
|
#spawn $pkill $testproc
|
||||||
|
@ -7,19 +7,20 @@ set mypid [pid]
|
|||||||
set pmap_procname "${mypid}:\\s+\\S+\[^\\r\]+\\s+"
|
set pmap_procname "${mypid}:\\s+\\S+\[^\\r\]+\\s+"
|
||||||
set pmap_std_header $pmap_procname
|
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_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_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_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_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_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"
|
set test "pmap with no arguments"
|
||||||
spawn $pmap
|
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"
|
set test "pmap standard output"
|
||||||
spawn $pmap $mypid
|
spawn $pmap $mypid
|
||||||
|
@ -3,12 +3,12 @@ set pwdx "${topdir}pwdx"
|
|||||||
# Run pwdx with no arguments
|
# Run pwdx with no arguments
|
||||||
set test "pwdx no args"
|
set test "pwdx no args"
|
||||||
spawn $pwdx
|
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
|
# Run pwdx with pid 0 which is invalid
|
||||||
set test "pwdx pid 0 should be invalid"
|
set test "pwdx pid 0 should be invalid"
|
||||||
spawn $pwdx 0
|
spawn $pwdx 0
|
||||||
expect_pass "$test" "^pwdx: invalid process id"
|
expect_pass "$test" "^0: No such process"
|
||||||
|
|
||||||
# Run pwdx with existing pid
|
# Run pwdx with existing pid
|
||||||
set test "pwdx finds sleep in cwd"
|
set test "pwdx finds sleep in cwd"
|
||||||
|
@ -14,7 +14,7 @@ set slabtop_header "^ $avst Objects $used \\d+ / \\d+ ${pct}\\s+$avst Slabs $use
|
|||||||
|
|
||||||
set test "slabtop help"
|
set test "slabtop help"
|
||||||
spawn $slabtop --help
|
spawn $slabtop --help
|
||||||
expect_pass $test "usage: \\S+ \\\[options\\\]"
|
expect_pass $test "^\\s+Usage:\\s+\(lt-\)\?slabtop \\\[options\\\]"
|
||||||
|
|
||||||
set sort_tests {
|
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*"
|
"a" "active objects" "^\\s*\\d+\\s+(\\d+)\\s+\\d+%\\s+\\d+\\.\\d+K\\s+\\d+\\s+\\d+\\s+\\d+K\\s+\\S\[^\r\]+\\s*"
|
||||||
|
@ -6,7 +6,7 @@ set hostname [ exec cat "/proc/sys/kernel/hostname" ]
|
|||||||
|
|
||||||
set test "sysctl with no arguments"
|
set test "sysctl with no arguments"
|
||||||
spawn $sysctl
|
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"
|
set test "sysctl reading a variable using slash delimiter"
|
||||||
spawn $sysctl kernel/hostname
|
spawn $sysctl kernel/hostname
|
||||||
|
@ -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_user "\[A-Za-z0-9_-\]+"
|
||||||
set w_tty "\[a-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_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_idle "\(\\?xdm\\?\|\\?\|\\d+days\|\\d+:\\d+m?\|\\d+.\\d+s\)"
|
||||||
set w_ival7 "\(\\?\|\\d+days\|\\d+:\\d+m?\|\\d+.\\d+s\)"
|
set w_ival7 "\(\\?\|\\d+days\|\\d+:\\d+m?\|\\d+.\\d+s\)"
|
||||||
|
Loading…
Reference in New Issue
Block a user