Chris PeBenito
0745f8011c
SELinuxPolicyTest: clean up temp binary policy in case of setUpClass error
...
This should never be hit since the source policy already was complied
by checkpolicy.
2015-04-01 13:26:48 -04:00
Chris PeBenito
c146f0ab47
Restructure exceptions across the entire project.
...
Group all exception classes into a module for each package. This is the
first step towards having all exceptions raised by setools libs be a child of
SEToolsException.
2015-04-01 12:10:45 -04:00
Chris PeBenito
bb1734e9e5
RangeFactoryTest: add test for high end of range being invalid
2015-03-29 09:40:15 -04:00
Chris PeBenito
f2d334c691
LevelFactoryTest: add extra test for category range parse error.
...
Such as: s0:c0.c2.c4
2015-03-20 12:03:09 -04:00
Chris PeBenito
ed35d206d9
Change unit tests to use setUpClass for opening policies.
2015-03-18 09:44:16 -04:00
Chris PeBenito
f4b1b68195
Rename type attribute interfaces.
...
Make sure they reflect that they are for type rather than role attributes.
2015-03-16 10:38:43 -04:00
Chris PeBenito
46392c752b
Add tests for MLS factory functions on MLS-disabled policy.
2015-03-15 15:01:46 -04:00
Chris PeBenito
1657d9d09e
Change SELinuxPolicy unit test 001 to output notice to stderr.
...
Qpol prints out a parse error to stderr. Put the message about this being
expected on stderr too, to sync up the messages.
2015-03-12 10:48:41 -04:00
Chris PeBenito
0aacb700da
Fix alias handling for sensitivities and categories.
...
If there are aliases, qpol includes those in the counts.
2015-03-07 11:06:24 -05:00
Chris PeBenito
0b295755de
Distinguish policy syntax errors from other OS errors, eg ENOENT.
...
The policy parser does not set errno, so the libqpol code assumes the
errors from parser code are always invalid syntax, rather than something
else like out of memory. This may not always be the case, but any other
kind of error is unlikely (and likely catastrophic)
2015-03-06 10:44:32 -05:00
Chris PeBenito
ee6e4fa12f
Add binary policy SELinuxPolicy tests.
2015-03-05 12:16:37 -05:00
Chris PeBenito
e6db6eaa90
Adjust SELinuxPolicy item count tests to remove overlaps.
...
Eliminates the chance that the items are accidentally getting the right
answer by counting one of the overlapping items (e.g. by copy-paste error
in the code)
2015-03-04 12:17:13 -05:00
Chris PeBenito
f7f0b96a6b
Fix conditional rules in SELinuxPolicy test policy.
...
Adjust so no optimization can be made (with a theoretical future
optimizing compiler)
2015-03-04 12:16:50 -05:00
Chris PeBenito
af3c5b5e3e
Add SELinuxPolicy test cases.
...
Created a test policy with prime number counts of everything so there
should be no accidental correct answers.
2015-03-03 13:18:29 -05:00
Chris PeBenito
f472d6c912
Break up tests in policrep/mls.
2015-02-28 10:59:53 -05:00
Chris PeBenito
a8d7f740b2
Change range constructor to use regular levels instead of semantic ones.
...
This affords better error reporting since levels can be invalid for
several reasons.
* Fix memory leak in qpol_semantic_level
* Add unit tests
2015-02-22 09:24:39 -05:00