From: Jan D Date: Wed, 11 Jun 1997 00:00:00 +0000 (+1200) Subject: op/groups test fails on Linux (groups in /bin) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7b7ef14c26e3283cb33eb794bdf774867119ade0;p=p5sagit%2Fp5-mst-13.2.git op/groups test fails on Linux (groups in /bin) The test op/groups checks for groups in /usr/bin and /usr/ucb. This fails on some Linux distributions that has groups in /bin. A better test would be to just run groups (take whatever is in the path) and see if it outputs a list that includes the current group. Possibly you could prepend /bin:/usr/bin:/usr/ucb to the current path. Something like this. p5p-msgid: 199705191120.NAA08130@ostrich.gaia.swipnet.se --- diff --git a/t/op/groups.t b/t/op/groups.t index 078689b..73239b5 100755 --- a/t/op/groups.t +++ b/t/op/groups.t @@ -1,6 +1,13 @@ #!./perl -if (! -x ($groups = '/usr/ucb/groups') && ! -x ($groups = '/usr/bin/groups')) { +$ENV{'PATH'} = "/bin:/usr/ucb:/usr/bin:$ENV{'PATH'}"; + +$curgrp = (getgrgid($())[0]; +foreach (split(/\s+/, `groups 2>/dev/null`)) { + $ok++, last if $_ eq $curgrp; +} + +if (! $ok) { print "1..0\n"; exit 0; } @@ -26,7 +33,7 @@ for (split(' ', $()) { $gr1 = join(' ', sort @gr); -$gr2 = join(' ', grep(!$basegroup{$_}++, sort split(' ',`$groups`))); +$gr2 = join(' ', grep(!$basegroup{$_}++, sort split(' ',`groups`))); if ($gr1 eq $gr2) { print "ok 1\n";