Hi Brad,

On Feb 9, 2015, at 13:15, Brad Davis <b...@freebsd.org> wrote:

> Author: brd (doc committer)
> Date: Mon Feb  9 21:15:52 2015
> New Revision: 278475
> URL: https://svnweb.freebsd.org/changeset/base/278475
> 
> Log:
>  Add tests for `pw usernext'.
> 
>  PR:          197120
>  Submitted by:        Robert O'Neil <oneil...@gmail.com>
>  Approved by: will
> 
> Added:
>  head/usr.sbin/pw/tests/pw_usernext.sh   (contents, props changed)
> Modified:
>  head/usr.sbin/pw/tests/Makefile

…

> +     var0=1
> +     LIMIT=`jot -r 1 2 10`
> +     while [ "$var0" -lt "$LIMIT" ]
> +     do
> +             atf_check -s exit:0 ${PW} useradd -n test$var0 -g 0
> +             var0=`expr $var0 + 1`
> +     done
> +     atf_check -s exit:0 -o match:"100${LIMIT}:1001}” \

This line is incorrect (there’s a trailing `}` after 1001).

Removing it will fix the test, but is assuming that 1001 will always be the 
next group correct (it’s correct in the default install, but IIRC it wasn’t 
correct if you started groups at gid=500)?

Wouldn’t it be safer to create a bogus group, get the gid for the group, then 
test to ensure that that god is matched?

Thanks!

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to