Lines Matching refs:handler
130 handler = Handler(mocked_instance, 'build', mock.Mock())
131 handler.suite_name_check = True
142 handler._final_handle_actions(harness, handler_time)
144 assert handler.instance.status == TwisterStatus.FAIL
145 assert handler.instance.execution_time == handler_time
146 assert handler.instance.reason == 'RunID mismatch'
148 testcase in handler.instance.testcases)
150 handler.instance.reason = 'This reason shan\'t be changed.'
151 handler._final_handle_actions(harness, handler_time)
155 assert handler.instance.reason == 'This reason shan\'t be changed.'
182 handler = Handler(instance, 'build', mock.Mock())
183 handler._verify_ztest_suite_name(
199 handler = Handler(mocked_instance, 'build', mock.Mock())
200 handler.suite_name_check = True
206 handler._missing_suite_name(expected_suite_names, handler_time)
208 assert handler.instance.status == TwisterStatus.FAIL
209 assert handler.instance.execution_time == handler_time
210 assert handler.instance.reason == 'Testsuite mismatch'
212 testcase.status == TwisterStatus.FAIL for testcase in handler.instance.testcases
223 handler = Handler(instance, 'build', mock.Mock())
239 handler.terminate(mock_proc)
241 assert handler.terminated
252 handler.terminated = False
255 handler.terminate(mock_proc)
269 handler = BinaryHandler(instance, 'build', mock.Mock())
270 handler.pid_fn = os.path.join('dummy', 'path', 'to', 'pid.pid')
278 handler.try_kill_process_by_pid()
287 handler.pid_fn = os.path.join('dummy', 'path', 'to', 'pid.pid')
290 handler.try_kill_process_by_pid()
391 handler = BinaryHandler(mocked_instance, 'build', mock.Mock(timeout_multiplier=1))
392 handler.terminate = mock.Mock()
401 handler._output_handler(proc, harness)
403 mock_file.assert_called_with(handler.log, 'w')
415 handler.terminate.assert_called_once_with(proc)
447 handler = BinaryHandler(mocked_instance, 'build', options, 'generator', False)
448 handler.binary = 'bin'
449 handler.call_make_run = call_make_run
450 handler.seed = seed
451 handler.extra_test_args = extra_args
452 handler.build_dir = 'build_dir'
453 handler.instance.sysbuild = False
454 handler.platform = SimpleNamespace()
455 handler.platform.resc = "file.resc"
456 handler.platform.uart = "uart"
458 command = handler._create_command(robot_test)
481 handler = BinaryHandler(mocked_instance, 'build', mock.Mock(
494 res = handler._create_env()
535 handler = BinaryHandler(mocked_instance, 'build', mock.Mock(
539 handler.terminated = terminated
540 handler.returncode = returncode
542 handler.instance.add_missing_case_status = missing_mock
545 handler._update_instance_info(mocked_harness, handler_time)
547 assert handler.instance.execution_time == handler_time
549 assert handler.instance.status == expected_status
550 assert handler.instance.reason == expected_reason
585 handler = BinaryHandler(mocked_instance, 'build', mock.Mock(coverage=coverage))
586 handler.sourcedir = 'source_dir'
587 handler.build_dir = 'build_dir'
588 handler.name= 'Dummy Name'
589 handler._create_command = mock.Mock(return_value=['dummy' , 'command'])
590 handler._create_env = mock.Mock(return_value=[])
591 handler._update_instance_info = mock.Mock()
592 handler._final_handle_actions = mock.Mock()
593 handler.terminate = mock.Mock()
594 handler.try_kill_process_by_pid = mock.Mock()
607 handler.handle(harness)
616 handler._update_instance_info.assert_called_once()
617 handler._final_handle_actions.assert_called_once()
642 handler = SimulationHandler(mocked_instance, type_str, mock.Mock())
644 assert handler.call_make_run == expected_call_make_run
645 assert handler.ready == expected_ready
648 assert handler.pid_fn == os.path.join(mocked_instance.build_dir,
651 assert handler.pid_fn == os.path.join(mocked_instance.build_dir,
718 handler = DeviceHandler(mocked_instance, 'build', mock.Mock(enable_coverage=not end_by_status))
721 handler.monitor_serial(ser, halt_event, harness)
742 handler = DeviceHandler(mocked_instance, 'build', mock.Mock(enable_coverage=False))
745 handler.monitor_serial(ser, halt_event, harness)
917 handler = DeviceHandler(mocked_instance, 'build', mock.Mock())
918 handler.duts = duts
921 device = handler.device_is_available(mocked_instance)
927 device = handler.device_is_available(mocked_instance)
932 device = handler.device_is_available(mocked_instance)
949 handler = DeviceHandler(mocked_instance, 'build', mock.Mock())
950 handler.duts = duts
952 handler.make_dut_available(duts[1])
954 assert len([None for d in handler.duts if d.available == 1]) == 1
955 assert handler.duts[0].available == 0
956 assert handler.duts[2].available == 0
958 handler.make_dut_available(duts[0])
960 assert len([None for d in handler.duts if d.available == 1]) == 2
961 assert handler.duts[2].available == 0
1033 def mock_availability(handler, instance, no=num_of_failures): argument
1036 if handler.no:
1037 handler.no -= 1
1041 handler = DeviceHandler(mocked_instance, 'build', mock.Mock())
1042 handler.no = num_of_failures
1049 hardware = handler.get_hardware()
1172 handler = DeviceHandler(mocked_instance, 'build', mock.Mock())
1173 handler.options = mock.Mock(west_flash=self_west_flash)
1174 handler.generator_cmd = 'generator_cmd'
1176 expected = [handler.build_dir if val == '$build_dir' else \
1186 command = handler._create_command(runner, hardware)
1213 handler = DeviceHandler(mocked_instance, 'build', mock.Mock())
1216 handler.instance.add_missing_case_status = missing_mock
1219 handler._update_instance_info(mocked_harness, handler_time, flash_error)
1221 assert handler.instance.execution_time == handler_time
1223 assert handler.instance.status == expected_status
1224 assert handler.instance.reason == expected_reason
1273 handler = DeviceHandler(mocked_instance, 'build', mock.Mock(timeout_multiplier=1))
1275 handler.instance.add_missing_case_status = missing_mock
1281 handler.duts = [dut]
1290 result = handler._create_serial_connection(dut, serial_device, hardware_baud,
1299 assert handler.instance.status == TwisterStatus.FAIL
1300 assert handler.instance.reason == 'Serial Device Error'
1333 handler = DeviceHandler(mocked_instance, 'build', mock.Mock())
1343 result = handler._get_serial_device(serial_pty, hardware_serial)
1446 handler = DeviceHandler(mocked_instance, 'build', mock.Mock())
1447 handler.get_hardware = mock.Mock(return_value=hardware)
1448 handler.options = mock.Mock(
1453 handler._get_serial_device = mock.Mock(side_effect=mock_get_serial)
1454 handler._create_command = mock.Mock(return_value=['dummy', 'command'])
1455 handler.run_custom_script = mock.Mock()
1456 handler._create_serial_connection = mock.Mock(
1459 handler.monitor_serial = mock.Mock()
1460 handler.terminate = mock.Mock(side_effect=mock_terminate)
1461 handler._update_instance_info = mock.Mock()
1462 handler._final_handle_actions = mock.Mock()
1463 handler.make_dut_available = mock.Mock()
1465 handler.instance.platform.name = 'IPName'
1473 handler.handle(harness)
1475 handler.get_hardware.assert_called_once()
1483 handler.run_custom_script.assert_has_calls([
1490 handler.run_custom_script.assert_has_calls([
1497 assert handler.instance.reason == expected_reason
1499 assert handler.instance.status == expected_status
1501 handler.make_dut_available.assert_called_once_with(hardware)
1522 handler = QEMUHandler(mocked_instance, 'build', mock.Mock())
1524 assert handler.ignore_qemu_crash == expected_ignore_crash
1525 assert handler.ignore_unexpected_eof == expected_ignore_unexpected_eof
1577 handler = QEMUHandler(mocked_instance, 'build', mock.Mock())
1578 handler.instance.sysbuild = self_sysbuild
1579 handler.build_dir = self_build_dir
1582 result = handler.get_default_domain_build_dir()
1617 handler = QEMUHandler(mocked_instance, 'build', mock.Mock())
1618 handler.log = self_log
1619 handler.pid_fn = self_pid_fn
1623 handler._set_qemu_filenames(sysbuild_build_dir)
1625 assert handler.fifo_fn == mocked_instance.build_dir + \
1628 assert handler.pid_fn == sysbuild_build_dir + os.path.sep + 'qemu.pid'
1630 assert handler.log_fn == self_log
1640 handler = QEMUHandler(mocked_instance, 'build', mock.Mock(), 'dummy_cmd', False)
1642 result = handler._create_command(sysbuild_build_dir)
1723 handler = QEMUHandler(mocked_instance, 'build', mock.Mock())
1724 handler.returncode = self_returncode
1725 handler.ignore_qemu_crash = self_ignore_qemu_crash
1727 handler._update_instance_info(mocked_harness, is_timeout)
1729 assert handler.instance.status == expected_status
1730 assert handler.instance.reason == expected_reason
1767 handler = QEMUHandler(mocked_instance, 'build', mock.Mock())
1770 QEMUHandler._thread_update_instance_info(handler, handler_time, _status, _reason)
1772 assert handler.instance.execution_time == handler_time
1774 assert handler.instance.status == expected_status
1775 assert handler.instance.reason == expected_reason
1892 handler = QEMUHandler(mocked_instance, 'build', mock.Mock(timeout_multiplier=1))
1893 handler.ignore_unexpected_eof = False
1894 handler.pid_fn = 'pid_fn'
1895 handler.fifo_fn = 'fifo_fn'
1900 if filename == handler.pid_fn:
1902 elif filename == handler.fifo_fn + '.out':
1942 handler,
1943 handler.get_test_timeout(),
1944 handler.build_dir,
1945 handler.log,
1946 handler.fifo_fn,
1947 handler.pid_fn,
1949 handler.ignore_unexpected_eof
1953 handler,
1959 file_objs[handler.log].write.assert_has_calls(expected_log_calls)
1995 handler = QEMUHandler(mocked_instance, 'build', mock.Mock(timeout_multiplier=1))
2011 handler.fifo_fn = os.path.join('dummy', 'qemu-fifo')
2012 handler.pid_fn = os.path.join(sysbuild_build_dir, 'qemu.pid')
2013 handler.log_fn = os.path.join('dummy', 'log')
2021 handler.options = mock.Mock(
2026 handler.run_custom_script = mock.Mock(return_value=None)
2027 handler.make_device_available = mock.Mock(return_value=None)
2028 handler._final_handle_actions = mock.Mock(return_value=None)
2029 handler._create_command = mock.Mock(return_value=command)
2030 handler._set_qemu_filenames = mock.Mock(side_effect=mock_filenames)
2031 handler.get_default_domain_build_dir = mock.Mock(return_value=domain_build_dir)
2032 handler.terminate = mock.Mock()
2042 handler.handle(harness)
2048 handler = QEMUHandler(mocked_instance, 'build', mock.Mock(timeout_multiplier=1))
2049 handler.fifo_fn = 'fifo_fn'
2051 result = handler.get_fifo()