本文整理匯總了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)