Description: Fix some of the tests
 Some of the tests failed in the pbuilder
 For the ps one, the tty of a process is a bit strange, confusing the testsuite
 The pgrep one, there is some odd buffering going on, reording makes the tests
 pass
Author: Craig Small <csmall@debian.org>
Origin: Debian
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2018-02-10
--- a/testsuite/config/unix.exp
+++ b/testsuite/config/unix.exp
@@ -152,5 +152,9 @@
         return ""
     }
     regexp "/dev/(.+)" $raw_tty > tty
+    if { $tty == "tty" } {
+        warning "TTY is tty"
+        return ""
+    }
     return $tty
 }
--- a/testsuite/ps.test/ps_output.exp
+++ b/testsuite/ps.test/ps_output.exp
@@ -25,8 +25,8 @@
     "%cpu,pcpu,%mem,pmem"   "%CPU\\s+%CPU\\s+%MEM\\s+%MEM\\s+\(\\d+\.\\d+\\s*\){4}$"
     "blocked,sig_block,sigmask,caught,sigcatch,sig_catch" "\(BLOCKED\\s+\){3}\(CAUGHT\\s+\){2}CATCHED\\s+\(<?\[0-9a-f\]+\\s*\){6}$"
     "bsdstart,start,lstart" "\\s*START\\s+STARTED\\s+STARTED\\s+\(\\s*\(\[A-Z\]\[a-z\]{2} \\d+|\\d+:\\d{2}\)\\s+\(\[A-Z\]\[a-z\]{2} \\d+|\\d+:\\d{2}:\\d{2}\)\\s+\[A-Z\]\[a-z\]{2} \[A-Z\]\[a-z\]{2}\\s+\\d+ \\d{2}:\\d{2}:\\d{2} \\d{4}\\s*\)+$"
-    "bsdtime,cputime,etime,etimes" "\\s*TIME\\s+TIME\\s+ELAPSED\\s+ELAPSED\\s*\(\\s*\\d+:\\d{2}\\s+\\d{2}:\\d{2}:\\d{2}\\s+\(\\d{2}:\)?\\d{2}:\\d{2}\\s+\\d+\\s*\)$"
     "user,ruser,group,rgroup,uid,ruid,gid,rgid" "\\s*USER\\s+RUSER\\s+GROUP\\s+RGROUP\\s+UID\\s+RUID\\s+GID\\s+RGID\\s+\(\(\\s*\[A-Za-z0-9_+-\]+\\s+\){4}\(\\d+\\s+\){4}\\s*\)+$"
+    "bsdtime,cputime,etime,etimes" "\\s*TIME\\s+TIME\\s+ELAPSED\\s+ELAPSED\\s*\(\\s*\\d+:\\d{2}\\s+\\d{2}:\\d{2}:\\d{2}\\s+\(\\d{2}:\)?\\d{2}:\\d{2}\\s+\\d+\\s*\)$"
 }
 
 foreach { flag match } $flag_match  {
