Some pytest modules exercising the dispatch added by
fs: dispatch null_dev_desc_ok filesystems before lookup
test_load_semihosting.py:
"load semihosting - <addr> <file>" and the optional
[bytes] [pos] variant. Runs on qemu_arm64 with
CONFIG_SEMIHOSTING=y; reuses test_hostfs.py's host-staged
fixture.
test_load_sandbox.py:
"load sandbox - <addr> <file>" and the optional [bytes] [pos]
variant. Runs on sandbox (boardspec('sandbox')); the sandbox
fstype is registered with name="sandbox" and
null_dev_desc_ok=true,
so the same fs_lookup_null_dev_info() helper that
routes semihosting also routes the "sandbox".
A "load ubifs - <addr> <file>" test is intentionally not provided.
UBIFS is built on UBI on MTD, which requires some additional works
that are not available with qemu/sandbox-ing.
Signed-off-by: Vincent Jardin <vjardin@free.fr>
Reviewed-by: Simon Glass <sjg@chromium.org>
24 lines
520 B
Python
24 lines
520 B
Python
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
"""Fixture for semihosting command test
|
|
"""
|
|
|
|
import os
|
|
import pytest
|
|
|
|
@pytest.fixture(scope='function')
|
|
def semihosting_data(u_boot_config):
|
|
"""Set up a new file for each semihosting test
|
|
|
|
Args:
|
|
u_boot_config -- U-Boot configuration.
|
|
"""
|
|
image_path = u_boot_config.persistent_data_dir + '/semihosting.txt'
|
|
|
|
with open(image_path, 'w', encoding = 'utf-8') as file:
|
|
file.write('Das U-Boot\n')
|
|
|
|
yield image_path
|
|
|
|
os.remove(image_path)
|