def test_reproduce_with_echo(self): """Ensure that the tool can run a job configured to execute "echo".""" self.mock.get.return_value = None self.mock._get_testcase.side_effect = _fake_get_echo_testcase binary_path = os.path.join(self.build_directory, 'echo') with open(binary_path, 'w') as f: f.write('test') crash_retries = 3 disable_xvfb = False verbose = False disable_android_setup = False reproduce._reproduce_crash('https://localhost/testcase-detail/1', self.build_directory, crash_retries, disable_xvfb, verbose, disable_android_setup) reproduce._cleanup() self.mock.run_process.assert_called_with( binary_path + ' -n /tmp/testcase', current_working_directory=self.build_directory, gestures=[], timeout=10) # The tool does an initial run before running |crash_retries| times. self.assertEqual(self.mock.run_process.call_count, crash_retries + 1)
def test_reproduce_with_libfuzzer(self): """Ensure that the tool can run on a libFuzzer target.""" self.mock.get.return_value = "fake engine object" self.mock._get_testcase.side_effect = _fake_get_libfuzzer_testcase crash_retries = 3 disable_xvfb = False verbose = False disable_android_setup = False reproduce._reproduce_crash( "https://localhost/testcase-detail/1", self.build_directory, crash_retries, disable_xvfb, verbose, disable_android_setup, ) reproduce._cleanup() self.mock.engine_reproduce.assert_called_with("fake engine object", "test_fuzzer", "/tmp/testcase", [], 10) # The tool does an initial run before running |crash_retries| times. self.assertEqual(self.mock.engine_reproduce.call_count, crash_retries + 1)
def test_reproduce_with_echo(self): """See if the reproduce tool can run a job configured to execute "echo".""" reproduce._reproduce_crash('https://localhost/testcase-detail/1', '/path/to/binary') reproduce._cleanup() self.mock.run_process.assert_called_with( '/path/to/binary/echo -n /tmp/testcase', current_working_directory='/path/to/binary', gestures=[], timeout=10)
def test_reproduce_with_echo(self): """See if the reproduce tool can run a job configured to execute "echo".""" crash_retries = 3 disable_xvfb = False reproduce._reproduce_crash('https://localhost/testcase-detail/1', self.build_directory, crash_retries, disable_xvfb) reproduce._cleanup() self.mock.run_process.assert_called_with( self.binary_path + ' -n /tmp/testcase', current_working_directory=self.build_directory, gestures=[], timeout=10) self.assertEqual(self.mock.run_process.call_count, crash_retries)
def test_reproduce_with_echo(self): """See if the reproduce tool can run a job configured to execute "echo".""" crash_retries = 3 disable_xvfb = False verbose = False disable_android_setup = False reproduce._reproduce_crash('https://localhost/testcase-detail/1', self.build_directory, crash_retries, disable_xvfb, verbose, disable_android_setup) reproduce._cleanup() self.mock.run_process.assert_called_with( self.binary_path + ' -n /tmp/testcase', current_working_directory=self.build_directory, gestures=[], timeout=10) # The tool does an initial run before running |crash_retries| times. self.assertEqual(self.mock.run_process.call_count, crash_retries + 1)