[apparmor] [PATCH 2/8] utils: Update the logprof.conf in the test dir to point to in-tree paths
Seth Arnold
seth.arnold at canonical.com
Thu Feb 9 00:20:38 UTC 2017
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.
Acked-by: Seth Arnold <seth.arnold at canonical.com>
Thanks
> ---
> 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
> - 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)
-------------- 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/20170208/43d46049/attachment.pgp>
More information about the AppArmor
mailing list