コード例 #1
0
 def testProcessCommonLine(self):
     common_policy = SELinuxPolicy()
     common_offset = 279  # needs changing if file changes
     self.test_file.seek(common_offset, 0)
     line = self.test_file.readline()
     common_policy.process_common_line(line, self.test_file)
     self.failUnless('file' in common_policy.common_classes)
     self.failUnless(
         common_policy.common_classes['file'] == common_classes['file'])
コード例 #2
0
 def testProcessClassLine(self):
     class_policy = SELinuxPolicy()
     #offsets need changing if test file changes
     common_offset = 279
     class_initial_offset = 212
     class_perm_offset = 437
     self.test_file.seek(common_offset, 0)
     line = self.test_file.readline()
     class_policy.process_common_line(line, self.test_file)
     self.test_file.seek(class_initial_offset, 0)
     line = self.test_file.readline()
     class_policy.process_class_line(line, self.test_file)
     self.failUnless('file' in class_policy.classes)
     self.test_file.seek(class_perm_offset, 0)
     line = self.test_file.readline()
     class_policy.process_class_line(line, self.test_file)
     self.failUnless(class_policy.classes['file'] == classes['file'])