Lines Matching full:device
12 from twister_harness.device.qemu_adapter import QemuAdapter
17 @pytest.fixture(name='device')
21 device = QemuAdapter(DeviceConfig(build_dir=build_dir, type='qemu', base_timeout=5.0))
23 yield device
25 device.close() # to make sure all running processes are closed
29 def test_if_generate_command_creates_proper_command(patched_which, device: QemuAdapter):
30 device.device_config.app_build_dir = Path('build_dir')
31 device.generate_command()
32 assert device.command == ['west', 'build', '-d', 'build_dir', '-t', 'run']
35 def test_if_qemu_adapter_runs_without_errors(resources, device: QemuAdapter) -> None:
36 fifo_file_path = str(device.device_config.build_dir / 'qemu-fifo')
38 device.command = ['python', str(script_path), fifo_file_path]
39 device.launch()
40 lines = device.readlines_until(regex='Namespaces are one honking great idea')
41 device.close()
43 assert os.path.isfile(device.handler_log_path)
44 with open(device.handler_log_path, 'r') as file:
49 def test_if_qemu_adapter_raise_exception_due_to_no_fifo_connection(device: QemuAdapter) -> None:
50 device.base_timeout = 0.3
51 device.command = ['sleep', '1']
52 …h pytest.raises(TwisterHarnessException, match='Cannot establish communication with QEMU device.'):
53 device._flash_and_run()
54 device._close_device()
55 assert not os.path.exists(device._fifo_connection._fifo_out_path)
56 assert not os.path.exists(device._fifo_connection._fifo_in_path)