예제 #1
0
 def testGetLineType(self):
     self.failUnless(
         SELinux_CTS.get_line_type('type bluetooth, domain;') ==
         SELinux_CTS.TYPE)
     self.failUnless(
         SELinux_CTS.get_line_type('attribute unconfineddomain;') ==
         SELinux_CTS.ATTRIBUTE)
     self.failUnless(
         SELinux_CTS.get_line_type('typeattribute bluetooth appdomain;') ==
         SELinux_CTS.TYPEATTRIBUTE)
     self.failUnless(
         SELinux_CTS.get_line_type('class file') == SELinux_CTS.CLASS)
     self.failUnless(
         SELinux_CTS.get_line_type('common file') == SELinux_CTS.COMMON)
     self.failUnless(
         SELinux_CTS.get_line_type(
             'allow healthd healthd_exec:file { entrypoint read execute };')
         == SELinux_CTS.ALLOW_RULE)
     self.failUnless(
         SELinux_CTS.get_line_type(
             'neverallow { appdomain -unconfineddomain -bluetooth } self:capability *;'
         ) == SELinux_CTS.NEVERALLOW_RULE)
     self.failUnless(
         SELinux_CTS.get_line_type('# FLASK') == SELinux_CTS.OTHER)