Gentoo Archives: gentoo-dev

From: Alec Warner <antarus@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] FEATURES=-userpriv and testcases that fail as root or a user
Date: Thu, 07 Aug 2008 19:10:57
Message-Id: b41005390808071210x7900cc5le906af9658268560@mail.gmail.com
In Reply to: [gentoo-dev] FEATURES=-userpriv and testcases that fail as root or a user by "Robin H. Johnson"
1 On Thu, Aug 7, 2008 at 12:00 PM, Robin H. Johnson <robbat2@g.o> wrote:
2 > More than a year ago, I had my first occurrence of a package that
3 > refused to work when run as root: dev-db/mysql. This lead to the following
4 > block of code in the src_test block:
5 >
6 > if [[ $UID -eq 0 ]]; then
7 > die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
8 > fi
9 >
10 > The latest package to fall into the same trap is dev-util/git. With testcases
11 > that are designed as expected failures, but pass when run as root, and the
12 > testsuite says that the package is broken thusly.
13 >
14 > setup:
15 > # mkdir d &&
16 > # touch d/f &&
17 > # chmod a-x d
18 > expected failure test:
19 > # stat d/f
20 >
21 > Having the if/die structure in src_test however is ugly, as if you are testing
22 > lots of packages, and you miss it, then you get mucked over. I think that there
23 > are also other packages that NEED root to run their tests due to kernel
24 > interaction (audit, cpu affinity iirc).
25 >
26 > Does anybody have suggestions on a better way of enforcing user/root for
27 > src_test, instead of having a nasty die structure?
28
29 The opposite of RESTRICT=userpriv, eg. RESTRICT=root ;)
30
31 -Alec
32
33 >
34 > --
35 > Robin Hugh Johnson
36 > Gentoo Linux Developer & Infra Guy
37 > E-Mail : robbat2@g.o
38 > GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85
39 >