"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: got-build-regress.sh: run gotd regress suite too
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Mon, 18 Dec 2023 12:21:52 +0100

Download raw body.

Thread
On Sun, Dec 17, 2023 at 09:08:24PM +0100, Omar Polo wrote:
> gotd regress suite needs some set up so can't work out-of-the-box.
> However, assuming it was set up and doas is configured without password
> it can work.  It's not great, but it's the only way to have the regress
> running automatically (and periodically).
> 
> I'd like to have this so I can run gotd regress in my regress machine.

ok by me.

The only other solution I can think of is to require got-build-regress.sh
to be run as root and priv-drop to a regular user for all the non-gotd
tests. But I'm not sure if that would be any better.

> diff /home/op/w/got
> commit - 452d8310907a64cc34ef0d0f1258a3ddc8bb5aea
> path + /home/op/w/got
> blob - 7edb5fbb0f79762a8be9b626fcc9eb2c407c4c7a
> file + util/got-build-regress.sh
> --- util/got-build-regress.sh
> +++ util/got-build-regress.sh
> @@ -15,19 +15,22 @@
>  # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
>  
>  prog=`basename $0`
> -usage="$prog [-f] [-b branch] [-R testroot] [-r from-address] [-w worktree] email-address ..."
> +usage="$prog [-fG] [-b branch] [-R testroot] [-r from-address] [-w worktree] email-address ..."
>  branch=main
>  worktree=$HOME/got
>  fromaddr_arg=
>  force=0
> +gotd=0
>  testroot="/tmp"
>  
> -while getopts b:fR:r:w: arg; do
> +while getopts b:fGR:r:w: arg; do
>  	case $arg in
>  		b)
>  			branch="$OPTARG" ;;
>  		f)
>  			force=1 ;;
> +		G)
> +			gotd=1 ;;
>  		w)
>  			worktree="$OPTARG" ;;
>  		r)
> @@ -149,6 +152,21 @@ if [ "$regress_status" -ne 0 -o "$regress_failure_grep
>  	exit 0
>  fi
>  
> +if [ $gotd -ne 0 ]; then
> +	printf "\n\n\tRunning gotd tests\n\n" >> build.log
> +	log_cmd regress.log doas env PATH=$HOME/bin:$PATH make server-regress
> +	regress_status=$?
> +	cat regress.log >> build.log
> +	egrep "test.*failed" regress.log > failures.log
> +	regress_failure_grep="$?"
> +	if [ "$regress_status" -ne 0 -o "$regress_failure_grep" -eq 0 ]; then
> +		printf "\n\n\t Test failures:\n\n" >> build.log
> +		cat failures.log >> build.log
> +		mail $fromaddr_arg -s "$prog regress failure" $recipients < build.log
> +		exit 0
> +	fi
> +fi
> +
>  printf "\n\n\tTesting a release build\n\n" >> build.log
>  log_cmd build.log make clean
>  log_cmd build.log make obj
> 
>