Commit Graph

11 Commits

Author SHA1 Message Date
Chris PeBenito
e6f59d04e5 Refactor SETools queries/analyses to use descriptors instead of get/setters
This is Pythonic.
2015-05-16 21:59:10 -04:00
Chris PeBenito
d82a28262c setools __init__: import query/analysis classes
Makes use simpler. The setools submodules map 1:1 to classes anyway;
the separate modules are simply to ease organization.

Change seinfo to use conditional setter use rather than conditional
instantiation of queries.  Note: pylint disable is added because pylint
gets confused by the reuse of the q variable and thinks that q is always
BoolQuery, so it incorrectly reports missing member functions.
2015-04-15 12:00:59 -04:00
Chris PeBenito
f3ca479a27 Address remaining pylint errors.
Also implement some suggested changes.
2015-04-06 09:51:32 -04:00
Chris PeBenito
816fc94e3b MLSRuleQueryTest: PEP8 fix 2015-04-03 14:59:07 -04:00
Chris PeBenito
cfbedfb9f3 tests: implement ValidateRule mixin
Simplifies testing and uncovered a couple minor bugs in unit tests.
2015-04-03 14:48:25 -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
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
175b7c167f Implement range matching in MLSRuleQuery.
Skip adding all of the range matching options in sesearch for now, as it
already has a large number of CLI options.

closes #5
2015-02-25 14:17:38 -05:00
Chris PeBenito
8ba3cf16f5 Change all unit tests for "unset" query to use full comparison.
Fully compare the lists rather than only counting objects.

Also fix comparison problem in Nodecon and Genfscon. In libqpol, the all
genfscons/nodecons iterators allocate new objects, so the pointer
comparison in PolicySymbol fails.
2014-11-25 13:24:36 -05:00
Chris PeBenito
248df414ab Add MLSRuleQuery unit tests.
Turns out the rules are always expanded, so indirect options had
no effect.
2014-11-06 19:59:02 -05:00