testsuite: Test for uptime --pretty

References:
 procps-ng/procps#263
This commit is contained in:
Craig Small 2023-01-16 17:22:26 +11:00
parent d70879fb9c
commit 647a2aa9e1

View File

@ -10,3 +10,8 @@ expect_pass "$test" "^\\s+\\d{2}:\\d{2}:\\d{2} up (\\d+ days?,)?\\s*\\d+( min|:\
set test "uptime since option" set test "uptime since option"
spawn $uptime --since spawn $uptime --since
expect_pass "$test" "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\s*$" expect_pass "$test" "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\s*$"
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*$"