本文整理汇总了Python中apparmor.rule.capability.CapabilityRule.match方法的典型用法代码示例。如果您正苦于以下问题:Python CapabilityRule.match方法的具体用法?Python CapabilityRule.match怎么用?Python CapabilityRule.match使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类apparmor.rule.capability.CapabilityRule
的用法示例。
在下文中一共展示了CapabilityRule.match方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _check_invalid_rawrule
# 需要导入模块: from apparmor.rule.capability import CapabilityRule [as 别名]
# 或者: from apparmor.rule.capability.CapabilityRule import match [as 别名]
def _check_invalid_rawrule(self, rawrule):
obj = None
with self.assertRaises(AppArmorException):
obj = CapabilityRule(CapabilityRule.parse(rawrule))
self.assertFalse(CapabilityRule.match(rawrule))
self.assertIsNone(obj, 'CapbilityRule handed back an object unexpectedly')
示例2: _compare_obj_with_rawrule
# 需要导入模块: from apparmor.rule.capability import CapabilityRule [as 别名]
# 或者: from apparmor.rule.capability.CapabilityRule import match [as 别名]
def _compare_obj_with_rawrule(self, rawrule, expected):
obj = CapabilityRule.parse(rawrule)
self.assertTrue(CapabilityRule.match(rawrule))
self.assertEqual(rawrule.strip(), obj.raw_rule)
self._compare_obj(obj, expected)
示例3: _check_write_rule
# 需要导入模块: from apparmor.rule.capability import CapabilityRule [as 别名]
# 或者: from apparmor.rule.capability.CapabilityRule import match [as 别名]
def _check_write_rule(self, rawrule, cleanrule):
obj = CapabilityRule.parse(rawrule)
clean = obj.get_clean()
raw = obj.get_raw()
self.assertTrue(CapabilityRule.match(rawrule))
self.assertEqual(cleanrule.strip(), clean, 'unexpected clean rule')
self.assertEqual(rawrule.strip(), raw, 'unexpected raw rule')
示例4: _is_equal
# 需要导入模块: from apparmor.rule.capability import CapabilityRule [as 别名]
# 或者: from apparmor.rule.capability.CapabilityRule import match [as 别名]
def _is_equal(self, obj, rule_to_test, strict):
self.assertTrue(CapabilityRule.match(rule_to_test))
return obj.is_equal(CapabilityRule.parse(rule_to_test), strict)
示例5: _is_covered_exact
# 需要导入模块: from apparmor.rule.capability import CapabilityRule [as 别名]
# 或者: from apparmor.rule.capability.CapabilityRule import match [as 别名]
def _is_covered_exact(self, obj, rule_to_test):
self.assertTrue(CapabilityRule.match(rule_to_test))
return obj.is_covered(CapabilityRule.parse(rule_to_test), True, True)