Commit graph

44 commits

Author SHA1 Message Date
Steve Beattie
edfa025814 Move preamble inclusions to a different directory since it was breaking
the test on including an entire directory.
Add some basic local profile tests.
2008-11-25 19:05:40 +00:00
Steve Beattie
2e5807b6c4 Add two tests for aliases within include files. 2008-11-24 19:53:36 +00:00
Steve Beattie
1e3e427263 Bleah, the previous code was killing the wrapper sh created by the
open("|")  call, but not the actual apparmor_parser process itself.
2008-11-21 05:00:06 +00:00
Steve Beattie
a64d8142c9 Add a 2 minute (by default, configurable) timeout to each testcase, this
should prevent runaway apparmor_parser processes.
2008-11-20 23:22:43 +00:00
Steve Beattie
e1a2c27cfd Update documentation on how many entries the 3rd stress test generates. 2008-11-20 17:38:38 +00:00
John Johansen
de3ed997a7 Add a test for dfa tree optimization. The test is a profile that could
OOM a machine without dfa tree optimization.
2008-11-20 17:27:32 +00:00
Steve Beattie
a8fea9babc With jjohansen@suse.de's latest optimisation commits, this test case is
now feasible once again.
2008-11-20 17:27:01 +00:00
Steve Beattie
aed481debe Add simple testcase for alias duplicate detection. 2008-11-16 00:49:43 +00:00
Steve Beattie
96e124bf8d Bah, the last commit message was wrong; it added support for mixing
alias rules and variable declarations within the preamble of a profile.

This commit adds another testcase for alias rules; one in which there is
an overlapping pair of aliases. The parser parses it, but based on -dd
output, I don't believe it's treating it properly.
2008-11-14 16:46:16 +00:00
Steve Beattie
cc923edf3c - Add AF_ISDN to filtered list of AF tags
- Restructure filter sed script to be shorter
- Add a make check target which is equiv to make tests
2008-11-14 16:25:44 +00:00
Steve Beattie
6b793b1a8b Add a testcase for the alias handling 2008-11-13 23:48:11 +00:00
John Johansen
100ff7cabb Update to allow external hats by specifying the hat keyword in front of
the profile name.
2008-06-09 12:00:42 +00:00
John Johansen
015df061e3 Named transition - but disabled due to a bug 2008-04-16 04:45:02 +00:00
John Johansen
831f2e252c add missing tests 2008-04-06 18:57:05 +00:00
John Johansen
34f2c96700 let a profile set a tasks caps, similar to fscaps 2008-04-06 18:55:27 +00:00
John Johansen
d4c9f0ad0c recommit namespace update to use :namespace: 2008-04-06 18:53:59 +00:00
John Johansen
c460dcc52f update change_hats rules to generate rules for all hats 2008-04-06 18:52:47 +00:00
John Johansen
bbd31c70a1 change namespaces to use the :namespace: format 2008-04-05 05:46:06 +00:00
John Johansen
ec08477129 fix type on typename in cast bug 2008-04-05 04:57:51 +00:00
John Johansen
edda8c2604 add owner parser tests 2007-12-20 12:58:16 +00:00
John Johansen
ace86e6d01 fix overlapping x modifiers perm computation 2007-12-20 12:56:50 +00:00
John Johansen
40c3686041 remove old netdomain syntax 2007-11-16 09:34:01 +00:00
John Johansen
c841a140b3 make the use of flags= optional 2007-11-16 09:31:33 +00:00
John Johansen
20d5d20855 tests for pix exec mode 2007-11-16 09:28:30 +00:00
John Johansen
230b04231c add pix transition mode 2007-11-16 09:27:34 +00:00
John Johansen
92a569fdb3 profile namespace tests 2007-11-16 09:22:49 +00:00
Steve Beattie
cfef502c54 Basic change_profile testcases, basic network rules testcases, testcases
around carat symbols and commas in file rules, and basic permission
modes first testcases from jjohansen@suse.de.

Acked-By: Steve Beattie <steve@nxnw.org>
2007-10-01 06:34:27 +00:00
Steve Beattie
815c103488 lock mode bit tests from jjohansen@suse.de
Also, make 'check' toplevel target be an alias for 'tests'

Acked-By: Steve Beattie <steve@nxnw.org>
2007-10-01 06:12:26 +00:00
Steve Beattie
4e0679ecc6 Append testcases from jjohansen@suse.de.
Acked-By: Steve Beattie <steve@nxnw.org>
2007-10-01 06:04:18 +00:00
John Johansen
87b55accec Allow inverted character classes in non-quoted pathnames. This conflicts
with old style hats but we haven't allowed for them for a couple of years.

Disable tests that check for old style hats.
2007-05-10 05:21:44 +00:00
Steve Beattie
9467d933df Add a little more oddball space formatting test of hat definitions. 2007-05-08 06:28:08 +00:00
Steve Beattie
4e2bf5ab74 Resurrect apparmor-docs package, this time as a subpackage of
apparmor-parser. The html version of the parser manpages as well as pdf,
html, and text versions of the techdoc are included in the -docs
package.

Disabled a regression stress test that is a bit problematic on 64bit
arches; the stress test itself is a bit absurd given how many rules it
generates.
2007-04-14 04:48:56 +00:00
Steve Beattie
90c9b5c0cd This patch fixes the apparmor parser tst Makefile to not use popd/pushd
bashisms which were in place to get around PWD not getting set
correctly. Instead, fix the simple.pl script to call pwd directly.
Based on feedback from PLD/Arkadiusz Miskiewicz <arekm@maven.pl>.
2006-12-15 08:10:25 +00:00
Steve Beattie
6b54cce437 This patch removes using the libcap-devel capability header, and only
uses the linux kernel definitions of them.

(It also adds to the simple capbilities regression tests verifying the
parser can parse the new audit capiability names.)
2006-11-08 10:59:09 +00:00
Steve Beattie
398ef08bf4 This patch adds support for including all the files within a directory
by naming the directory (e.g. #include </etc/apparmor.d/abstractions>).
It will skip over dotfiles and as well as subdirectories. It is intended
to make scripting and packaging easier, as the including profile will
not need to know explicitly all of the names to include.

Long term, rather than hardcode that dotfiles will be skipped, it should
be configurable via /etc/apparmor.d/subdomain what patterns of files
should be skipped; genprof/logprof should also honor this setting. The
code could be reused as I'd like to make the parser just take a directory
on the command line rather than being fed profiles one at a time; again
it would skip files based on these same patterns.

This patch also eliminates some dead code in the include processing, as
well as replaces a couple of undersized fixed-size buffer (PATH_MAX is
4095 on linux, buffer is not overflowable due to use of strncpy/snprintf)
with dynamically allocated ones.
2006-10-10 21:36:10 +00:00
Steve Beattie
84a0136a88 Add a new testcase for #include statements that are on the same line as
file rules.
2006-09-28 16:47:11 +00:00
John Johansen
c13b341fef add parser test files that I failed to add when the parser m and P patches where committed 2006-08-04 17:24:51 +00:00
John Johansen
3cb147e25c [https://bugzilla.novell.com/show_bug.cgi?id=172061]
This (updated) patch to trunk adds support for Px and Ux (toggle
bprm_secure on exec) in the parser, As requested, lowercase p and u
corresponds to an unfiltered environmnet on exec, uppercase will filter
the environment.  It applies after the 'm' patch.

As a side effect, I tried to reduce the use of hardcoded characters in
the debugging statements -- there are still a few warnings that have
hard coded letters in them; not sure I can fix them all.

This version issues a warning for every unsafe ux and issues a single
warning for the first 'R', 'W', 'X', 'L', and 'I' it encounters,
except when the "-q" or "--quiet" flag , "--remove" profile flag, or
"-N" report names flags are passed.  Unfortunately, it made the logic
somewhat more convoluted.  Wordsmithing improvements welcome.
2006-08-04 17:14:49 +00:00
Steve Beattie
8cdcb6f0ea Set properties on parser testfiles 2006-06-01 17:02:28 +00:00
Steve Beattie
08a4b5ce52 Set svn keyword properties on a couple of missed files. 2006-05-31 21:44:14 +00:00
Steve Beattie
dd2d41bae8 Make the build process significantly quieter with respect to the unit
and regression tests to avoid developer confusion.
2006-05-31 21:30:50 +00:00
Steve Beattie
84ff459a53 Default to using the parser in the parent directory, and build it if it
doesn't exist.
2006-05-02 17:19:50 +00:00
Steve Beattie
1b56f269dd This change does a few things:
- adds a distinct includes/ subdirectory, populated with a couple of
    files that test profiles can include. We purposefully choose to use
    a different directory structure than the shipped profile set so that
    changes to it will not break our tests.
  - modifies the existing test profiles to take advantage of the
    includes/ directory.
  - modifies tst/Makefile with pushd/popd to get around some pwd
    limitations in the parser (that need to be fixed).
2006-05-02 16:15:41 +00:00
Steve Beattie
bc9d0ee80b MOve the parser regression tests to the parser package itself. 2006-04-13 20:38:37 +00:00