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

Christian Boltz apparmor at cboltz.de
Fri May 6 20:59:46 UTC 2016


while running test-translations.py with the fixed german translations,
I noticed that I still get errors about hotkey conflicts

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.

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

[ 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


Christian Boltz
Ich freue mich auf das Eröffnungsspiel Deutschland gegen Costa Rica.
Auf der einen Seite eine Bananenrepublik und auf der anderen Seite:
Costa Rica.   [Thomas Gottschalk, Wetten dass...?, 10.12.2005]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20160506/7347be2e/attachment.pgp>

More information about the AppArmor mailing list