コード例 #1
0
ファイル: permmap.py プロジェクト: gkpln3/setools
 def test_110_set_direction(self):
     """PermMap set direction"""
     permmap = PermissionMap("tests/perm_map")
     self.validate_permmap_entry(permmap._permmap, 'infoflow2', 'low_w',
                                 'w', 1, True)
     permmap.set_direction("infoflow2", "low_w", "r")
     self.validate_permmap_entry(permmap._permmap, 'infoflow2', 'low_w',
                                 'r', 1, True)
コード例 #2
0
ファイル: permmap.py プロジェクト: gkpln3/setools
 def test_113_set_direction_unmapped_permission(self):
     """PermMap set direction unmapped class"""
     permmap = PermissionMap("tests/perm_map")
     with self.assertRaises(UnmappedPermission):
         permmap.set_direction("infoflow2", "UNMAPPED", "w")
コード例 #3
0
ファイル: permmap.py プロジェクト: gkpln3/setools
 def test_112_set_direction_unmapped_class(self):
     """PermMap set direction unmapped class"""
     permmap = PermissionMap("tests/perm_map")
     with self.assertRaises(UnmappedClass):
         permmap.set_direction("UNMAPPED", "write", "w")
コード例 #4
0
ファイル: permmap.py プロジェクト: gkpln3/setools
 def test_111_set_direction_invalid(self):
     """PermMap set invalid direction"""
     permmap = PermissionMap("tests/perm_map")
     with self.assertRaises(ValueError):
         permmap.set_direction("infoflow2", "low_w", "X")
コード例 #5
0
ファイル: permmap.py プロジェクト: GitForNeo/setools
 def test_113_set_direction_unmapped_permission(self):
     """PermMap set direction unmapped class"""
     permmap = PermissionMap("tests/perm_map")
     with self.assertRaises(UnmappedPermission):
         permmap.set_direction("infoflow2", "UNMAPPED", "w")
コード例 #6
0
ファイル: permmap.py プロジェクト: GitForNeo/setools
 def test_112_set_direction_unmapped_class(self):
     """PermMap set direction unmapped class"""
     permmap = PermissionMap("tests/perm_map")
     with self.assertRaises(UnmappedClass):
         permmap.set_direction("UNMAPPED", "write", "w")
コード例 #7
0
ファイル: permmap.py プロジェクト: GitForNeo/setools
 def test_111_set_direction_invalid(self):
     """PermMap set invalid direction"""
     permmap = PermissionMap("tests/perm_map")
     with self.assertRaises(ValueError):
         permmap.set_direction("infoflow2", "low_w", "X")
コード例 #8
0
ファイル: permmap.py プロジェクト: GitForNeo/setools
 def test_110_set_direction(self):
     """PermMap set direction"""
     permmap = PermissionMap("tests/perm_map")
     self.validate_permmap_entry(permmap.permmap, 'infoflow2', 'low_w', 'w', 1, True)
     permmap.set_direction("infoflow2", "low_w", "r")
     self.validate_permmap_entry(permmap.permmap, 'infoflow2', 'low_w', 'r', 1, True)