From: <ssm...@us...> - 2007-03-21 14:34:19
|
Revision: 2295 http://svn.sourceforge.net/selinux/?rev=2295&view=rev Author: ssmalley Date: 2007-03-21 07:33:37 -0700 (Wed, 21 Mar 2007) Log Message: ----------- Author: Karl MacMillan Email: kma...@me... Subject: sepolgen fix tests and refpolicy formatting Date: Tue, 20 Mar 2007 16:42:21 -0400 The changes I made to match sepolgen policy output with the refpolicy missed type transition rules and broke the unit tests. This patch fixes those two problems. Signed-off-by: Karl MacMillan <kma...@me...> Modified Paths: -------------- trunk/sepolgen/src/sepolgen/refpolicy.py trunk/sepolgen/tests/test_refpolicy.py Modified: trunk/sepolgen/src/sepolgen/refpolicy.py =================================================================== --- trunk/sepolgen/src/sepolgen/refpolicy.py 2007-03-20 11:43:07 UTC (rev 2294) +++ trunk/sepolgen/src/sepolgen/refpolicy.py 2007-03-21 14:33:37 UTC (rev 2295) @@ -472,7 +472,7 @@ return "type_member" def to_string(self): - return "%s %s %s : %s %s;" % (self.__rule_type_str(), + return "%s %s %s:%s %s;" % (self.__rule_type_str(), self.src_types.to_space_str(), self.tgt_types.to_space_str(), self.obj_classes.to_space_str(), Modified: trunk/sepolgen/tests/test_refpolicy.py =================================================================== --- trunk/sepolgen/tests/test_refpolicy.py 2007-03-20 11:43:07 UTC (rev 2294) +++ trunk/sepolgen/tests/test_refpolicy.py 2007-03-21 14:33:37 UTC (rev 2295) @@ -88,7 +88,7 @@ a.tgt_types.add("bar_t") a.obj_classes.add("file") a.perms.add("read") - self.assertEquals(a.to_string(), "allow foo_t bar_t : file read;") + self.assertEquals(a.to_string(), "allow foo_t bar_t:file read;") a.rule_type = a.DONTAUDIT a.src_types.add("user_t") @@ -97,7 +97,7 @@ a.perms.add("write") # This test might need to go because set ordering is not guaranteed self.assertEquals(a.to_string(), - "dontaudit { foo_t user_t } { user_home_t bar_t } : { lnk_file file } { read write };") + "dontaudit { foo_t user_t } { user_home_t bar_t }:{ lnk_file file } { read write };") class TestTypeRule(unittest.TestCase): def test_init(self): @@ -114,7 +114,7 @@ a.tgt_types.add("bar_exec_t") a.obj_classes.add("process") a.dest_type = "bar_t" - self.assertEquals(a.to_string(), "type_transition foo_t bar_exec_t : process bar_t;") + self.assertEquals(a.to_string(), "type_transition foo_t bar_exec_t:process bar_t;") class TestParseNode(unittest.TestCase): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |