コード例 #1
0
 def test_basic(self) -> None:
     task_def_from_py = TaskDefinition(
         features=[TaskFeature.target_exe, TaskFeature.target_env],
         containers=[
             ContainerDefinition(
                 type=ContainerType.inputs,
                 compare=Compare.AtLeast,
                 value=1,
                 permissions=[
                     ContainerPermission.Read, ContainerPermission.Write
                 ],
             )
         ],
         monitor_queue=None,
         vm=VmDefinition(compare=Compare.AtLeast, value=1),
     )
     TaskDefinition.validate(task_def_from_py)
コード例 #2
0
 TaskDefinition(
     features=[
         TaskFeature.target_exe,
         TaskFeature.target_options,
         TaskFeature.analyzer_exe,
         TaskFeature.analyzer_env,
         TaskFeature.analyzer_options,
     ],
     vm=VmDefinition(compare=Compare.AtLeast, value=1),
     containers=[
         ContainerDefinition(
             type=ContainerType.setup,
             compare=Compare.Equal,
             value=1,
             permissions=[
                 ContainerPermission.Read, ContainerPermission.List
             ],
         ),
         ContainerDefinition(
             type=ContainerType.analysis,
             compare=Compare.Equal,
             value=1,
             permissions=[
                 ContainerPermission.Write,
                 ContainerPermission.Read,
                 ContainerPermission.List,
                 ContainerPermission.Create,
             ],
         ),
         ContainerDefinition(
             type=ContainerType.crashes,
             compare=Compare.Equal,
             value=1,
             permissions=[
                 ContainerPermission.Read, ContainerPermission.List
             ],
         ),
         ContainerDefinition(
             type=ContainerType.tools,
             compare=Compare.Equal,
             value=1,
             permissions=[
                 ContainerPermission.Read, ContainerPermission.List
             ],
         ),
     ],
     monitor_queue=ContainerType.crashes,
 ),
コード例 #3
0
ファイル: defs.py プロジェクト: ranweiler/onefuzz
 TaskType.coverage: TaskDefinition(
     features=[
         TaskFeature.target_exe,
         TaskFeature.target_env,
         TaskFeature.target_options,
         TaskFeature.target_timeout,
         TaskFeature.coverage_filter,
         TaskFeature.target_must_use_input,
     ],
     vm=VmDefinition(compare=Compare.Equal, value=1),
     containers=[
         ContainerDefinition(
             type=ContainerType.setup,
             compare=Compare.Equal,
             value=1,
             permissions=[ContainerPermission.Read, ContainerPermission.List],
         ),
         ContainerDefinition(
             type=ContainerType.readonly_inputs,
             compare=Compare.AtLeast,
             value=1,
             permissions=[ContainerPermission.Read, ContainerPermission.List],
         ),
         ContainerDefinition(
             type=ContainerType.coverage,
             compare=Compare.Equal,
             value=1,
             permissions=[
                 ContainerPermission.List,
                 ContainerPermission.Read,
                 ContainerPermission.Write,
             ],
         ),
     ],
     monitor_queue=ContainerType.readonly_inputs,
 ),
コード例 #4
0
 def test_definitions(self) -> None:
     for entry in TASK_DEFINITIONS.values():
         self.assertIsInstance(entry, TaskDefinition)
         TaskDefinition.validate(entry)