apparmor/parser
Steve Beattie b3bf36175d parser - rewrite caching tests in python unittest
This patch rewrites the caching test in python, using python's unittest
framework. It has been used with python 2.7 and python 3.3; python2.6
may have issues. It covers the tests in the existing caching.sh
test script (with the exception of the test that checks for when the
parser in $PATH is newer), as well as adding additional tests that
more extensively cover using a cache in an alternate location from
basedir. It also adds simple tests for the --create-cache-dir option
(along with that option's interaction with the alt-cache option).

(Some further work to be done is listed under TODO.)

Patch history:
  v1: - initial version
  v2: - create template base class
      - add keep_on_fail() decorator to keep temporary test files
        around after a test fails
      - don't dump raw cache file to failure output in
        test_cache_writing_updates_cache_file()
      - push run_cmd into template class
      - create run_cmd_check wrapper to run_cmd that adds an assertion
        check based on whether return code matches the expected rc
        (the valgrind tests only want to verify that the rc is not a
        specific set of values, hence the separate wrapper function)
      - similarly, add a check to run_cmd_check for verifying the output
        contains a specific string, also simplifying many of the caching
        tests.
      - create testlib.write_file() to simplify writing file

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2013-10-15 17:10:12 -07:00
..
libapparmor_re parser - terminate search early if wildcards are discovered 2013-10-14 14:36:05 -07:00
po Fix list email typo 2011-02-23 15:57:36 -08:00
tst parser - rewrite caching tests in python unittest 2013-10-15 17:10:12 -07:00
apparmor-parser.spec.in Add an example parser.conf file 2011-10-07 14:43:54 -07:00
apparmor.d.pod parser: Update man page for DBus rules 2013-07-31 09:03:15 -07:00
apparmor.pod as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
apparmor_parser.pod fix broken URLs in various utils/*.pod files. 2013-09-19 21:17:39 +02:00
COPYING.GPL rpmlint complains about an outdated FSF address in parser/COPYING.GPL. 2011-11-27 13:52:06 +01:00
dbus.c Convert codomain to a class 2013-09-27 16:16:37 -07:00
dbus.h parser - add support for variable expansion in dbus rules 2013-08-29 12:34:13 -07:00
frob_slack_rc as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
immunix.h parser: Add support for DBus rules 2013-07-31 09:05:51 -07:00
lib.c Convert the parser to C++ 2013-09-27 16:13:22 -07:00
lib.h apparmor: abstract out the directory walking routine 2012-08-16 16:26:03 -07:00
Makefile parser - link in libapparmor statically 2013-10-15 17:02:59 -07:00
mount.c Convert the parser to C++ 2013-09-27 16:13:22 -07:00
mount.h Fix mnt_flags passed for remount 2012-03-22 07:55:58 -07:00
parser.conf Commit the example parser.conf file that was supposed to be part of 2011-10-09 20:15:03 -07:00
parser.h parser - Fix const char warnings 2013-10-01 10:59:04 -07:00
parser_alias.c Convert codomain to a class 2013-09-27 16:16:37 -07:00
parser_common.c parser - Fix const char warnings 2013-10-01 10:59:04 -07:00
parser_include.c parser - Fix const char warnings 2013-10-01 10:59:04 -07:00
parser_include.h parser - Fix const char warnings 2013-10-01 10:59:04 -07:00
parser_interface.c parser - fix void* warnings 2013-10-14 14:37:48 -07:00
parser_lex.l parser - fix more memory leaks 2013-10-14 14:34:12 -07:00
parser_main.c parser - build against in-tree libapparmor 2013-10-15 16:46:18 -07:00
parser_merge.c Convert codomain to a class 2013-09-27 16:16:37 -07:00
parser_misc.c parser - fix more memory leaks 2013-10-14 14:34:12 -07:00
parser_policy.c Convert codomain to a class 2013-09-27 16:16:37 -07:00
parser_regex.c parser - Fix const char warnings 2013-10-01 10:59:04 -07:00
parser_symtab.c Convert codomain to a class 2013-09-27 16:16:37 -07:00
parser_variable.c parser - Fix const char warnings 2013-10-01 10:59:04 -07:00
parser_yacc.y parser: Don't generate accept states for audit deny dbus and mount rules 2013-09-27 17:26:39 -07:00
policydb.h Add Basic infrastructure support for the policydb 2012-02-16 08:14:46 -08:00
profile.cc parser - fix more memory leaks 2013-10-14 14:34:12 -07:00
profile.h Convert codomain to a class 2013-09-27 16:16:37 -07:00
rc.aaeventd.redhat as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
rc.aaeventd.suse openSUSE patch to remove the "-f" parameter from startproc in rc.aaeventd.suse / 2011-08-13 14:22:35 +02:00
rc.apparmor.debian as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
rc.apparmor.functions Update the copyright dates for the apparmor_parser 2012-02-24 04:21:59 -08:00
rc.apparmor.redhat as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
rc.apparmor.slackware as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
rc.apparmor.suse It looks like rc.apparmor.functions renamed "aa_log_action_begin()" to 2011-09-15 20:20:23 +02:00
README parser - update README information 2013-10-11 22:14:28 -07:00
subdomain.conf Here's an update to rename another chunk of things that still used 2011-01-13 13:58:26 -08:00
subdomain.conf.pod fix broken URLs in various utils/*.pod files. 2013-09-19 21:17:39 +02:00
techdoc.tex various changes in building techdoc.tex: 2012-05-09 00:41:06 +02:00
unit_test.h Convert codomain to a class 2013-09-27 16:16:37 -07:00

The apparmor_parser allows you to add, replace, and remove AppArmor
policy through the use of command line options. The default is to add.
`apparmor_parser --help` shows what the command line options are.

You can also find more information at http://wiki.apparmor.net

Please send all complaints, feature requests, rants about the software,
and questions to the apparmor@lists.ubuntu.com mailing list. Bug
reports can be filed against the AppArmor project on launchpad.net at
https://launchpad.net/apparmor or reported to the mailing list directly
for those who wish not to register for an account on launchpad.

Security issues can be filed as security bugs on launchpad
or directed to security@ubuntu.com. We will attempt to
conform to the RFP vulnerability disclosure protocol:
http://www.wiretrip.net/rfp/policy.html

Thanks.

-- The AppArmor development team