示例#1
0
 def testTurbiniaTaskRunWrapperBadResult(self, _):
   """Test that the run wrapper recovers from run returning bad result."""
   self.unregisterMetrics()
   bad_result = 'Not a TurbiniaTaskResult'
   checked_result = TurbiniaTaskResult(base_output_dir=self.base_output_dir)
   checked_result.setup(self.task)
   checked_result.status = 'CheckedResult'
   self.setResults(run=bad_result, validate_result=checked_result)
   new_result = self.task.run_wrapper(self.evidence.__dict__)
   new_result = TurbiniaTaskResult.deserialize(new_result)
   self.task.validate_result.assert_any_call(bad_result)
   self.assertEqual(type(new_result), TurbiniaTaskResult)
   self.assertIn('CheckedResult', new_result.status)
示例#2
0
    def testTurbiniaTaskRunWrapperBadResult(self):
        """Test that the run wrapper recovers from run returning bad result."""
        bad_result = 'Not a TurbiniaTaskResult'
        checked_result = TurbiniaTaskResult(
            task=self.task, base_output_dir=self.base_output_dir)
        checked_result.status = 'CheckedResult'
        self.setResults(run=bad_result, validate_result=checked_result)

        new_result = self.task.run_wrapper(self.evidence)

        self.task.validate_result.assert_any_call(bad_result)
        self.assertEqual(type(new_result), TurbiniaTaskResult)
        self.assertIn('CheckedResult', new_result.status)