[apparmor] [PATCH 2/8] utils: Update the logprof.conf in the test dir to point to in-tree paths
Christian Boltz
apparmor at cboltz.de
Thu Feb 9 12:13:41 UTC 2017
Hello,
Am Mittwoch, 8. Februar 2017, 16:20:38 CET schrieb Seth Arnold:
> On Wed, Feb 08, 2017 at 10:01:39PM +0000, Tyler Hicks wrote:
> > The utils tests should make use of the logprof.conf that resides in
> > utils/test/ when testing against the in-tree parser and profiles.
> > When testing against the system, it the utils tests should continue
> > to use the system logprof.conf.
> >
> > This patch updates the parser and profiles paths to point to the
> > in-tree paths. Another patch is needed to get aa.py to honor a
> > non-hardcoded search path for logprof.conf and other configuration
> > files.
> >
> > Signed-off-by: Tyler Hicks <tyhicks at canonical.com>
> > Cc: Christian Boltz <apparmor at cboltz.de>
>
> This may mean that tests have to be run from one specific current
> working. This is probably a suitable tradeoff.
If you want to avoid this, rename the test/logprof.conf to test/
logprof.conf.in, add some placeholder ("@@testpath@@") and let the
Makefile generate logprof.conf using sed.
That said: I doubt we really need to do this ;-) - the tradeoff is
acceptable (and much better than the previous state)
> Acked-by: Seth Arnold <seth.arnold at canonical.com>
Acked-by: Christian Boltz <apparmor at cboltz.de>
with a little unrelated comment inline:
> > ---
> >
> > utils/test/logprof.conf | 6 +++---
> > utils/test/test-config.py | 2 +-
> > 2 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/utils/test/logprof.conf b/utils/test/logprof.conf
> > index 47ad563..31ed5c9 100644
> > --- a/utils/test/logprof.conf
> > +++ b/utils/test/logprof.conf
> > @@ -10,11 +10,11 @@
> >
> > #
> > ------------------------------------------------------------------
> >
> > [settings]
> >
> > - profiledir = /etc/apparmor.d /etc/subdomain.d
Does someone still use /etc/subdomain.d/? I'd guess we could remove it
in the next major release.
> > - inactive_profiledir = /usr/share/doc/apparmor-profiles/extras
> > + profiledir = ../../profiles/apparmor.d
> > + inactive_profiledir = ../../profiles/apparmor/profiles/extra
> >
> > logfiles = /var/log/audit/audit.log /var/log/syslog
> > /var/log/messages
> >
> > - parser = /sbin/apparmor_parser /sbin/subdomain_parser
> > + parser = ../../parser/apparmor_parser
> >
> > ldd = /usr/bin/ldd
> > logger = /bin/logger /usr/bin/logger
> >
> > diff --git a/utils/test/test-config.py b/utils/test/test-config.py
> > index 70bdfca..3468c3b 100755
> > --- a/utils/test/test-config.py
> > +++ b/utils/test/test-config.py
> >
> > @@ -24,7 +24,7 @@ class Test(unittest.TestCase):
> > conf = ini_config.read_config('logprof.conf')
> > logprof_sections = ['settings', 'repository', 'qualifiers',
> > 'required_hats', 'defaulthat', 'globs']
> > logprof_sections_options = ['profiledir',
> > 'inactive_profiledir', 'logfiles', 'parser', 'ldd',
> > 'logger', 'default_owner_prompt', 'custom_includes']>
> > - logprof_settings_parser = '/sbin/apparmor_parser
> > /sbin/subdomain_parser' + logprof_settings_parser =
> > '../../parser/apparmor_parser'>
> > self.assertEqual(conf.sections(), logprof_sections)
> > self.assertEqual(conf.options('settings'),
> > logprof_sections_options)
Regards,
Christian Boltz
--
wie jeder weiß ist Debian auf ISDN die langsamste bekannte Methode
Selbstmord zu begehen ("Selbstmord durch Erosion")
[http://blog.koehntopp.de/archives/113-Debian-ist-doch-schlecht..html]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20170209/80fc6453/attachment.pgp>
More information about the AppArmor
mailing list