2011-11-27 13:42:56 +05:30
|
|
|
#
|
|
|
|
# Dejagnu tests for uptime - part of procps
|
|
|
|
#
|
2022-08-29 14:43:10 +05:30
|
|
|
set uptime "${topdir}src/uptime"
|
2011-11-27 13:42:56 +05:30
|
|
|
|
|
|
|
set test "uptime"
|
|
|
|
spawn $uptime
|
2012-03-02 17:35:28 +05:30
|
|
|
expect_pass "$test" "^\\s+\\d{2}:\\d{2}:\\d{2} up (\\d+ days?,)?\\s*\\d+( min|:\\d+), +\\d+ users?, +load average: \[0-9.\]+, \[0-9.\]+, \[0-9.\]+\\s*$"
|
2012-12-26 17:51:44 +05:30
|
|
|
|
|
|
|
set test "uptime since option"
|
|
|
|
spawn $uptime --since
|
|
|
|
expect_pass "$test" "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\s*$"
|
2023-01-16 11:52:26 +05:30
|
|
|
|
|
|
|
set test "uptime pretty option"
|
|
|
|
spawn $uptime --pretty
|
|
|
|
expect_pass "$test" "up (\\d+ decades?, )?(\\d+ years?, )?(\\d+ weeks?, )?(\\d+ days?, )?(\\d+ hours?, )?(\\d+ minutes?)\\s*$"
|
|
|
|
|