[apparmor] [patch] Run utils tests with C locale

Seth Arnold seth.arnold at canonical.com
Fri May 6 23:34:15 UTC 2016


On Fri, May 06, 2016 at 10:59:46PM +0200, Christian Boltz wrote:
> It turned out that test-translations.py reads the system-wide
> apparmor-utils.mo in addition to the in-tree translations.
> (I have the 2.11 beta1 translations installed, which contain hotkey
> conflicts for the german translations).
> 
> This is surprising because test-translations.py explicitely sets the
> locale path. Interestingly, this happens only 4 times (checked with a
> temp profile with audit for those files) while test-translations.py has
> 9 tests).
> 
> (Any idea if this behaviour is normal or a bug?)
> 
> 
> This patch adds LC_ALL=C to the make check and make coverage commandline
> so that the system-wide translations don't get used.

This feels like a coincidence of implementation rather than the intended
effect; is there no better way to do this?

> I checked with a modified de.po that in-tree hotkey conflicts still get
> detected.
> 

Acked-by: Seth Arnold <seth.arnold at canonical.com>

Thanks

> 
> [ 78-run_utils_tests_with_C_locale.diff ]
> 
> === modified file 'utils/test/Makefile'
> --- utils/test/Makefile 2016-01-25 22:49:26 +0000
> +++ utils/test/Makefile 2016-05-05 09:55:19 +0000
> @@ -62,10 +62,10 @@
>         rm -rf __pycache__/ .coverage htmlcov
>  
>  check: __libapparmor
> -       export PYTHONPATH=$(PYTHONPATH) ; export LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) ; $(foreach test, $(wildcard test-*.py), echo ; echo === $(test) === ; $(call pyalldo, $(test)))
> +       export PYTHONPATH=$(PYTHONPATH) ; export LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) ; export LC_ALL=C; $(foreach test, $(wildcard test-*.py), echo ; echo === $(test) === ; $(call pyalldo, $(test)))
>  
>  .coverage: $(wildcard ../aa-* ../apparmor/*.py test-*.py) __libapparmor
> -       export PYTHONPATH=$(PYTHONPATH) ; export LD_LIBRARY_PATH=$(LD_LIBRARY_PATH); $(COVERAGE_IGNORE_FAILURES_CMD) ; $(foreach test, $(wildcard test-*.py), echo ; echo === $(test) === ; $(PYTHON) -m coverage run --branch -p $(test); )
> +       export PYTHONPATH=$(PYTHONPATH) ; export LD_LIBRARY_PATH=$(LD_LIBRARY_PATH); export LC_ALL=C; $(COVERAGE_IGNORE_FAILURES_CMD) ; $(foreach test, $(wildcard test-*.py), echo ; echo === $(test) === ; $(PYTHON) -m coverage run --branch -p $(test); )
>         $(PYTHON) -m coverage combine
>  
>  coverage: .coverage
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20160506/4718479f/attachment.pgp>


More information about the AppArmor mailing list