[apparmor] [patch] inprove runtests-py*.sh

Steve Beattie steve at nxnw.org
Thu Jul 17 01:15:36 UTC 2014


On Wed, Jul 16, 2014 at 01:39:49PM +0200, Christian Boltz wrote:
> Am Dienstag, 15. Juli 2014 schrieb Steve Beattie:
> > On Mon, Jul 14, 2014 at 10:37:52PM +0200, Christian Boltz wrote:
> > > this patch changes runtests-py*.sh (scripts for manually running the
> > > utils/test/*.py testcases) to
> > > - sleep 10 seconds after each failed test to make failures more
> > > annoying> 
> > >   ^W^W^W^Wgive people a chance to read failure details
> > 
> > Is there a reason to do it this way and not just add 'set -e' to the
> > script such that it will abort with a non-zero exit status if one
> > of the commands in the script fails? For the record, that is what
> > happens if 'make check' is invoked and one of the tests fails.
> 
> Yes. I want the script to run all tests, even if one of them fails, so
> that I get an overview of all tests. (The script still does "exit 1" 
> if there was a failure.)
> 
> I know "all tests succeeded" is the expected result, and we should
> always have that.

Indeed. I wish I could get that with make check with the distribution's
python apparmor packages installed on ubuntu 14.04, but thanks to some
python brain-damage that causes it to always use the system version
of libraries instead of the local ones (even with your patches to
append ',.' to sys.path, as well as explicitly setting the PYTHONPATH
variable), I can't.

> Nevertheless it's useful to be able to run all tests
> even if the first one fails ;-)  (maybe I'm able to fix the second one?)

Eh, I can understand that. Fair warning though, I don't use these
scripts for testing because the non test-*.py scripts always failed
for me, and I hadn't gotten around to fixing them due to them looking
like they had a bunch of issues to be resolved.

> > > === modified file 'utils/test/runtests-py2.sh'
> > > --- utils/test/runtests-py2.sh  2014-02-13 00:59:27 +0000
> > > +++ utils/test/runtests-py2.sh  2014-07-14 20:29:55 +0000
> > > @@ -1,1 +1,5 @@
> > > -for file in *.py ; do echo "running $file..." ; python $file; echo;
> > > done +#!/bin/bash
> > > +
> > > +RUNTESTS_PY__PYTHON_BINARY=python2
> > 
> > Generally, we've just used the environment variable PYTHON to specify
> > which python interpreter to use.
> 
> I know, and this is why I avoid it here ;-)
> 
> The script name already implies which python version to use, therefore I 
> don't want strange side effects (using a wrong/unexpected python 
> version) if someone has set $PYTHON.

Okay. I'm not a fan, as I'd rather have a consistent way of setting the
interpreter tree-wide, but I can see why you want to do it this way.

> Updated patch (only change: bash changed to sh):

Acked-by: Steve Beattie <steve at nxnw.org>

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20140716/89057cde/attachment.pgp>


More information about the AppArmor mailing list