当前位置: 首页>>代码示例>>Python>>正文


Python CapabilityRule.match方法代码示例

本文整理汇总了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')
开发者ID:crossbuild,项目名称:apparmor,代码行数:9,代码来源:test-capability.py

示例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)
开发者ID:crossbuild,项目名称:apparmor,代码行数:10,代码来源:test-capability.py

示例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')
开发者ID:crossbuild,项目名称:apparmor,代码行数:10,代码来源:test-capability.py

示例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)
开发者ID:crossbuild,项目名称:apparmor,代码行数:5,代码来源:test-capability.py

示例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)
开发者ID:crossbuild,项目名称:apparmor,代码行数:5,代码来源:test-capability.py


注:本文中的apparmor.rule.capability.CapabilityRule.match方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。