Commit graph

125 commits

Author SHA1 Message Date
Steve Beattie
12876afa07 This patch fixes up a bit that leaked into kees' commit rev 1727
to support a top level make clean target.
2011-05-23 16:05:10 -07:00
Steve Beattie
bb31faff1b This patch extends the stress profile generator to add variable
definition and references.
2011-03-28 21:07:44 -07:00
Steve Beattie
162b49b417 This patch attempts to address the over-aggressive behavior of the
stress tests on the parser, by dropping the maximum number of rules
each profile can have, as well as reducing the number of profiles to
generate by default to 50. It also cleans up the emitted profiles
a little, creates the profile names with the suffix .sd [1], fixes
stress.sh to actually honor the -p (alternate parser) argument, fixes
the profile flags generation to not generate duplicates flags, and
fixes the file rules to always start with a constant randomly-generated
prefix element (rather than a regex or variable) to greatly reduce
the possibility of X dominance collisions in the parser
2011-03-28 20:48:30 -07:00
Steve Beattie
e14c6c39f1 Make tcp test support current network syntax, reanable tcp test 2011-03-02 05:02:45 -08:00
Steve Beattie
0e87acb318 Change the compilation ordering in the regression testsuite as the
toolchain has gotten stricter about linking order; in short, linked
libraries need to come after the objects referring to them. Adding to
LDLIBS is the correct solution for this.

See https://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition for more
details.
2011-01-07 10:35:47 -08:00
Kees Cook
723a20ba7d as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
Steve Beattie
317197a6b5 This patch modifies the xattr regression test to use a separate
loopback mounted filesystem to operate on, to guarantee that the mount
option user_xattr is enabled (it's disabled by default on Ubuntu).

With this change, a number of the user xattr testcases that were
expected to pass but weren't started working; however, some of the
ones that were failing as expected are now passing. I've touched up
the expectations as well.
2010-09-30 10:49:26 -07:00
John Johansen
d256e1f9c0 The upstream 2.6.36 kernel is missing the /sys/kernel/security/apparmor/profiles file, so introspection of which profiles are loaded is not possible.
Make testing of profiles loaded conditional on introspection being present.
2010-08-26 10:38:27 -07:00
John Johansen
350520a650 Add check to the regression tests that verifies the expected profiles
are loaded.
2010-08-10 09:24:41 -04:00
Kees Cook
cc434a1c7f Fixes "deleted" test case to match the documentation for the expected
outcome. Adds additional positive test, fixes spelling.
2010-08-04 12:22:48 -07:00
John Johansen
5c8581a345 Update the regression test suite to test chmod, chown and chgrp on directories. 2010-08-04 10:25:44 -07:00
Kees Cook
32d899eb6d The coredump regression test existed in the tree, but was not hooked up to
the testsuite. It looks like coredump mediation may have been removed,
since it is rather a corner-case, so I have currently marked it as XFAIL.

In hooking it back up, the "prologue.inc" was reviewed, dead code dropped,
and the "image=" argument changed to correctly handle the imageperms
syntax used elsewhere. It was working in other tests out of coincidence.
2010-07-26 10:55:00 -07:00
Kees Cook
b30b4c1877 Fixes several warnings, typos, clarifies a subtest description and starts
to try to get rid of programmatic use of $Id$ in kernel regression tests.
2010-07-26 10:50:33 -07:00
Kees Cook
0d357a892b Actually fail "make tests" if any of the tests fail to run. 2010-07-26 10:46:03 -07:00
Kees Cook
e180ed4ccb There didn't seem to be a way to see individual test successes, so I added
a check for "VERBOSE=1" in the kernel regression testsuite.
2010-07-26 09:30:36 -07:00
Kees Cook
27ce962708 Rename "subdomain" to "apparmor" in kernel regression tests.
Includes spelling fixes, drops of old documentation, and removal of notes on
tests that no longer fail.
2010-07-26 09:26:26 -07:00
Kees Cook
084f975d5e Drop unused file descriptor. 2010-07-26 09:25:00 -07:00
Steve Beattie
d6713e49cd First, readlink is in /bin/ on ubuntu, not /usr/bin - checked both
paths. Secondly, the /lib64 -> /lib symlink would mean the
/lib64/ld-linux symlink would incorrectly be generated as
/lib64/ld-N.NN.so which still has a symlink in its path, and thus
apparmor wouldn't permit the access. Fixing by having readlink
canonicalize the entire path.

ack thppt.
2010-04-27 02:37:30 -07:00
Steve Beattie
8c7fea39d4 Expand parser stress test to included regexs and rlimit rules. 2010-03-15 11:31:38 -07:00
Steve Beattie
2a0df39961 Ease memory usage by collating rules in string form rather than as Rule
objects. Add randomly generating profile flags.
2010-03-12 03:05:25 -08:00
Steve Beattie
66286494a2 Resurrect another of the stress tests; it kinda works, though it requires
killall-ing a few things in order to make it stop. And alas, it does seem
to eventually cause kernel hangs with 2.6.32-16. (Committing now before ext4
eats my changes and brain.)
2010-03-10 20:56:47 -08:00
Steve Beattie
140495fe64 Make kernel stress tests work again (kill.sh works at least) 2010-03-10 17:56:51 -08:00
Steve Beattie
60f6153446 Fixup parser stress test to work with modern parser args.. 2010-03-10 16:11:39 -08:00
John Johansen
91f0f0053f Update regression tests test harness for known problems to use xpass and
xfail instead of known_{pass,fail}, also have it only reports unexpected
results, error for when result != what it should, and Alert for when it
result is what is should be but is a known problem and hence expected
to report something else.

Also update the regression tests for known problems under AppArmor 2.5,
this does not fix all known problems, (ie hats being removed differently
and hence resulting in unable to load profile errors, and the mknod
problem on alternate runs of the test suite, nor xattrs tests not ensuring
that the fs supports xattrs).
2010-02-06 23:04:57 -08:00
John Johansen
56d1be6ca6 Update ptrace test to fix case where unconfined is ptracing child helper
which is now allowed and add case where confined app is ptracing child
which isn't allowed.
2010-02-06 20:09:55 -08:00
John Johansen
516e3f60e4 update change_hat tests for correct error codes on AppArmor 2.5 2010-02-06 20:08:51 -08:00
John Johansen
db796ef3f1 Update test harness to allow for tests defined by profile X 2010-02-06 20:07:44 -08:00
Kees Cook
da6c9246f5 clear remaining $Id$ tags, since bzr does not suppor them 2009-11-11 10:44:26 -08:00
Kees Cook
317a3a0ad2 load test profiles from commandline instead of stdin 2009-08-25 00:26:57 +00:00
John Johansen
0018491c1e Add basic changeprofile re test and enable changeprofile tests by default 2009-08-21 20:39:45 +00:00
John Johansen
0320e0e849 Update changeprofile tests
Have the parser skip the caches
2009-08-20 23:46:48 +00:00
John Johansen
c80b2c9766 Fix library resolution when linux-vdso.so.1 is used instead of
linux-vdso32.so.1 or linux-vdso64.so.1
2009-08-20 12:33:29 +00:00
John Johansen
ed8530d9b6 start of some changeprofile tests 2009-08-20 04:13:08 +00:00
John Johansen
4f3e6daae9 Fix the clone regression test so that the correct end of the stack is
used.
2009-07-28 02:17:10 +00:00
John Johansen
100d791e84 Update mount test to allow for cability sys_admin, allowing mount and unmount 2009-07-08 21:35:28 +00:00
Steve Beattie
e18d431b0e Resurrect a random profile generator for stress testing the parser.
Needs love in the form of enhancements to support regexs, all the added
features in upcoming 2.3 release, etc.

Could also stand a bit of refactoring to make the ruby program not suck
up so much ram by writing out profiles as things go along rather than
generating a bunch of large objects and keeping them around.
2008-11-26 22:16:48 +00:00
Steve Beattie
0ebee05092 Fix a compilation error on ubuntu; wondering if there's older distros
where glibc doesn't provide /usr/include/dirent.h.
Also fixed a compilation warning around fprintf sizes.
2008-10-08 19:43:28 +00:00
John Johansen
748e398c21 - various patches and cleanups from kees@ubuntu.com 2008-06-11 20:19:36 +00:00
John Johansen
3897c52414 update link_subset test, to include child x 2008-06-04 05:59:11 +00:00
Steve Beattie
7a751a53f6 Not sure why the close of stdout and redirection of the pipe was here,
given that the following write was to the specific file descriptor in
the pipe.
2008-04-17 22:09:05 +00:00
John Johansen
3bbca91391 fix fatal errors so that they don't exit with an exit code of 0 when no
previsous tests failed.  Instead have fatal errors always exit with
a exit code of 127
2008-03-28 07:17:14 +00:00
John Johansen
6b6c045fbf Update ptrace test
- fix some races that could lead to tests randomly failing
- extend tests to test more combinations
2008-03-27 17:27:39 +00:00
John Johansen
e103873eb2 merge over r1151 - update to exec.sh test which allows it to run on
64 bit platforms using /lib64
2008-03-27 01:16:40 +00:00
John Johansen
db7fe20a54 Update the link subset test to reflect the newer link semantics
- safe exec is no longer considered a subset of unsafe exec
- add tests for pix permission to link subset
2008-03-08 10:23:19 +00:00
John Johansen
ed4e639d7e make longpath a default test 2008-03-08 04:17:40 +00:00
John Johansen
7e69d3c91c add more missing files 2008-03-08 02:49:17 +00:00
John Johansen
66276373cd add missing link subset tests 2008-02-18 11:19:11 +00:00
John Johansen
bad1c12112 remove patches for tests as they are now applied 2007-12-23 01:17:23 +00:00
John Johansen
781e6d1882 Add the ability to mark as test as a known_fail or known_pass,
which means the failure of the tests is known.  So known_fail
means the test should fail but is known to succeed and similar
for known_pass.

This allows tests to be marked as having a known problem so that
regressions are useful to those less familure with what is failing
2007-12-23 01:10:29 +00:00
John Johansen
5d51c46fd6 make the link subset test livable 2007-12-23 01:07:16 +00:00