public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] FEATURES=-userpriv and testcases that fail as root or a user
@ 2008-08-07 19:00 Robin H. Johnson
  2008-08-07 19:10 ` Alec Warner
  2008-08-07 19:17 ` Alexis Ballier
  0 siblings, 2 replies; 3+ messages in thread
From: Robin H. Johnson @ 2008-08-07 19:00 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1189 bytes --]

More than a year ago, I had my first occurrence of a package that
refused to work when run as root: dev-db/mysql. This lead to the following
block of code in the src_test block:

if [[ $UID -eq 0 ]]; then
	die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
fi  

The latest package to fall into the same trap is dev-util/git. With testcases
that are designed as expected failures, but pass when run as root, and the
testsuite says that the package is broken thusly.

setup:
# mkdir d &&
# touch d/f &&
# chmod a-x d 
expected failure test:
# stat d/f

Having the if/die structure in src_test however is ugly, as if you are testing
lots of packages, and you miss it, then you get mucked over. I think that there
are also other packages that NEED root to run their tests due to kernel
interaction (audit, cpu affinity iirc).

Does anybody have suggestions on a better way of enforcing user/root for
src_test, instead of having a nasty die structure?

-- 
Robin Hugh Johnson
Gentoo Linux Developer & Infra Guy
E-Mail     : robbat2@gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85

[-- Attachment #2: Type: application/pgp-signature, Size: 329 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] FEATURES=-userpriv and testcases that fail as root or a user
  2008-08-07 19:00 [gentoo-dev] FEATURES=-userpriv and testcases that fail as root or a user Robin H. Johnson
@ 2008-08-07 19:10 ` Alec Warner
  2008-08-07 19:17 ` Alexis Ballier
  1 sibling, 0 replies; 3+ messages in thread
From: Alec Warner @ 2008-08-07 19:10 UTC (permalink / raw
  To: gentoo-dev

On Thu, Aug 7, 2008 at 12:00 PM, Robin H. Johnson <robbat2@gentoo.org> wrote:
> More than a year ago, I had my first occurrence of a package that
> refused to work when run as root: dev-db/mysql. This lead to the following
> block of code in the src_test block:
>
> if [[ $UID -eq 0 ]]; then
>        die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
> fi
>
> The latest package to fall into the same trap is dev-util/git. With testcases
> that are designed as expected failures, but pass when run as root, and the
> testsuite says that the package is broken thusly.
>
> setup:
> # mkdir d &&
> # touch d/f &&
> # chmod a-x d
> expected failure test:
> # stat d/f
>
> Having the if/die structure in src_test however is ugly, as if you are testing
> lots of packages, and you miss it, then you get mucked over. I think that there
> are also other packages that NEED root to run their tests due to kernel
> interaction (audit, cpu affinity iirc).
>
> Does anybody have suggestions on a better way of enforcing user/root for
> src_test, instead of having a nasty die structure?

The opposite of RESTRICT=userpriv, eg. RESTRICT=root ;)

-Alec

>
> --
> Robin Hugh Johnson
> Gentoo Linux Developer & Infra Guy
> E-Mail     : robbat2@gentoo.org
> GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] FEATURES=-userpriv and testcases that fail as root or a user
  2008-08-07 19:00 [gentoo-dev] FEATURES=-userpriv and testcases that fail as root or a user Robin H. Johnson
  2008-08-07 19:10 ` Alec Warner
@ 2008-08-07 19:17 ` Alexis Ballier
  1 sibling, 0 replies; 3+ messages in thread
From: Alexis Ballier @ 2008-08-07 19:17 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 709 bytes --]

On Thu, 7 Aug 2008 12:00:23 -0700
"Robin H. Johnson" <robbat2@gentoo.org> wrote:

> More than a year ago, I had my first occurrence of a package that
> refused to work when run as root: dev-db/mysql. This lead to the
> following block of code in the src_test block:
> 
> if [[ $UID -eq 0 ]]; then
> 	die "Testing with FEATURES=-userpriv is no longer supported
> by upstream. Tests MUST be run as non-root." fi  

I've used that for flac:
    if [ $UID != 0 ] ; then
        emake check || die "tests failed"
    else
        ewarn "Tests will fail if ran as root, skipping."
    fi


ie, don't die and continue. If someone is interested in the tests
they can read the ewarn.


Alexis.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-08-07 19:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-07 19:00 [gentoo-dev] FEATURES=-userpriv and testcases that fail as root or a user Robin H. Johnson
2008-08-07 19:10 ` Alec Warner
2008-08-07 19:17 ` Alexis Ballier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox