From 09372ddfbaeb45facface67dea795f8e9059d899 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sat, 22 Oct 2011 03:16:00 +0300 Subject: Fixes in the testsuite & some minor fixes. * comsat/comsat.c (main): Use real UID to determine user name. Don't rely on environment variables. * maidag/util.c (maidag_error): Re-initialize va_list before reusing it. * mh/ali.c (ali_print_name_list): Change printing loop to correctly handle empty lists. * mh/mh_whatnow.c (quit): Print newline before returning. * comsat/tests/testsuite.at: Skip tests if run as root. * maidag/tests/forward.at: Skip test if run as root. * mh/tests/ali.at: Ignore comment lines in /etc/passwd and /etc/group. Make sure awk is run with a valid stdin. Some implementations (true awk, in particular) try to close stdin even if it is not used and bail out if unable to do so. * mh/tests/atlocal.in (mimeflt): Make sure awk is run with a valid stdin (see above). * mh/tests/anno.at: Always use semicolon before closing curly brace in sed expressions. * mh/tests/mark.at: Likewise. * mh/tests/pick.at: Likewise. * testsuite/testsuite.inc: Likewise. * mh/tests/comp.at: Reflect changes to mh_whatnow.c. * mh/tests/mhn.at: Don't rely on a particular tar output format. --- mh/tests/ali.at | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'mh/tests/ali.at') diff --git a/mh/tests/ali.at b/mh/tests/ali.at index 4686aa8a2..21372a226 100644 --- a/mh/tests/ali.at +++ b/mh/tests/ali.at @@ -75,7 +75,7 @@ ali: mh_aliases2:2: `mh_aliases' already included at top level ]) MH_CHECK([ali: group name],[ali04 ali-group-name],[ -awk -F : '$4!="" { print $1; print $4; exit 0 }' /etc/group > tmpout +cat /etc/group | awk -F : '/^#/ { next } $4!="" { print $1; print $4; exit 0 }' > tmpout test -s tmpout || AT_SKIP_TEST sed -n '1s/.*/korzen: =&/p' tmpout > mh_aliases sed '1d' tmpout | tr -d ' ' > expout @@ -85,14 +85,12 @@ ali -a ./mh_aliases korzen | tr -d ' ' [expout]) MH_CHECK([ali: group id],[ali05 ali-group-id ali-gid],[ -awk -F : '$4==0 { print $1 }' /etc/passwd > expout +cat /etc/passwd | awk -F : '/^#/ { next } $4==0 { print $1 }' > expout test -s expout || AT_SKIP_TEST -name=`awk -F : '$3==0 { print $1 }' /etc/group` +name=`awk -F : '/^#/ { next } $3==0 { print $1 }' /etc/group < /dev/null` test -z "$name" && AT_SKIP_TEST -AT_DATA([mh_aliases],[ -korzen: +root -]) +echo "korzen: +$name" > mh_aliases # FIXME: Do I need to sort the output? ali -list -a ./mh_aliases korzen ], @@ -100,7 +98,7 @@ ali -list -a ./mh_aliases korzen [expout]) MH_CHECK([ali: everybody],[ali06 ali-everybody],[ -awk -F : '$3>200 { print $1 }' /etc/passwd > expout +cat /etc/passwd | awk -F : '/^#/ { next } $3>200 { print $1 }' > expout test -s expout || AT_SKIP_TEST AT_DATA([mh_aliases],[ everybody: * -- cgit v1.2.1