示例#1
0
 def test_init(self):
     a = refpolicy.TypeRule()
     self.assertEqual(a.rule_type, a.TYPE_TRANSITION)
     self.assertTrue(isinstance(a.src_types, set))
     self.assertTrue(isinstance(a.tgt_types, set))
     self.assertTrue(isinstance(a.obj_classes, set))
     self.assertEqual(a.dest_type, "")
示例#2
0
 def test_to_string(self):
     a = refpolicy.TypeRule()
     a.src_types.add("foo_t")
     a.tgt_types.add("bar_exec_t")
     a.obj_classes.add("process")
     a.dest_type = "bar_t"
     self.assertEqual(a.to_string(), "type_transition foo_t bar_exec_t:process bar_t;")