Commit Graph

18 Commits

Author SHA1 Message Date
Chris PeBenito
4684eca5bc tests: Revise unit tests for binary-only policy support.
Closes 
2018-06-15 20:26:49 -04:00
Chris PeBenito
51b91d6130 Convert policyrep and SWIG wrapper into Cython libpolicyrep. 2018-06-15 20:26:49 -04:00
Chris PeBenito
cc313f9791 __future__ print functions no longer need importing. 2017-09-24 20:40:29 -04:00
Chris PeBenito
c0ebad8d15 SELinuxPolicy: Create enumerations for handle_unknown and target_platform. 2016-11-11 13:58:43 -05:00
Chris PeBenito
2d23bd42ce SELinuxPolicyTest: add extended permission rule count tests
Closes 
2016-03-29 09:55:51 -04:00
Chris PeBenito
6f4860dd7a SELinuxPolicyLoadError: create test suite for loading invalid policies
Create a test case for testing user's default level not in the range,
 even though it is not yet fixed.
2016-01-20 14:13:56 -05:00
Chris PeBenito
f8a2023391 DomainTransitionAnalysis: implement Edge class and descriptors for graph access
Includes policyrep changes to handle the deepcopy needed by NetworkX. The
SWIG objects are treated as immutable, since they are proxies of C pointers
to immutable objects (raw policydb).

Also fixes PolicySymbol.__hash__(), as returning NotImplemented would
raise a TypeError.
2015-04-22 09:55:21 -04:00
Chris PeBenito
f3ca479a27 Address remaining pylint errors.
Also implement some suggested changes.
2015-04-06 09:51:32 -04:00
Chris PeBenito
9d51dcc7e3 Misc cleanups suggested by pylint
* unnecessary parentheses on return
* variable shadowing
* unused variables
* classmethod variable naming
2015-04-02 14:50:21 -04:00
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
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
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
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
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