svn commit: r278475 - head/usr.sbin/pw/tests

Garrett Cooper yaneurabeya at gmail.com
Thu Feb 12 22:06:06 UTC 2015


Hi Brad,

On Feb 9, 2015, at 13:15, Brad Davis <brd at 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.rs at 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!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20150212/4060ef47/attachment.sig>


More information about the svn-src-all mailing list