Example #1
0
    def mock_avrule_factory(self, source, target):
        mock_rule = Mock(qpol_role_allow_t)
        mock_rule.rule_type.return_value = "allow"
        mock_rule.source_role.return_value = source
        mock_rule.target_role.return_value = target

        return rbac_rule_factory(self.p, mock_rule)
Example #2
0
    def mock_avrule_factory(self, source, target):
        mock_rule = Mock(qpol_role_allow_t)
        mock_rule.rule_type.return_value = "allow"
        mock_rule.source_role.return_value = source
        mock_rule.target_role.return_value = target

        return rbac_rule_factory(self.p, mock_rule)
Example #3
0
    def mock_roletrans_factory(self, source, target, tclass, default):
        mock_rule = Mock(qpol_role_trans_t)
        mock_rule.rule_type.return_value = "role_transition"
        mock_rule.source_role.return_value = source
        mock_rule.target_type.return_value = target
        mock_rule.object_class.return_value = tclass
        mock_rule.default_role.return_value = default

        return rbac_rule_factory(self.p, mock_rule)
Example #4
0
    def mock_roletrans_factory(self, source, target, tclass, default):
        mock_rule = Mock(qpol_role_trans_t)
        mock_rule.rule_type.return_value = "role_transition"
        mock_rule.source_role.return_value = source
        mock_rule.target_type.return_value = target
        mock_rule.object_class.return_value = tclass
        mock_rule.default_role.return_value = default

        return rbac_rule_factory(self.p, mock_rule)
Example #5
0
 def test_000_factory(self):
     """RoleAllow factory lookup."""
     with self.assertRaises(TypeError):
         rbac_rule_factory(self.p, "INVALID")
Example #6
0
 def test_000_factory(self):
     """RoleAllow factory lookup."""
     with self.assertRaises(TypeError):
         rbac_rule_factory(self.p, "INVALID")