mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
dm: Add tests for the sandbox host driver
Add some unit tests for this. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
2851cc94f3
commit
499503e157
4 changed files with 206 additions and 2 deletions
|
@ -9,7 +9,7 @@ import re
|
|||
import os
|
||||
from subprocess import call, check_call, check_output, CalledProcessError
|
||||
|
||||
def mk_fs(config, fs_type, size, prefix):
|
||||
def mk_fs(config, fs_type, size, prefix, use_src_dir=False):
|
||||
"""Create a file system volume
|
||||
|
||||
Args:
|
||||
|
@ -17,12 +17,14 @@ def mk_fs(config, fs_type, size, prefix):
|
|||
fs_type (str): File system type, e.g. 'ext4'
|
||||
size (int): Size of file system in bytes
|
||||
prefix (str): Prefix string of volume's file name
|
||||
use_src_dir (bool): true to put the file in the source directory
|
||||
|
||||
Raises:
|
||||
CalledProcessError: if any error occurs when creating the filesystem
|
||||
"""
|
||||
fs_img = f'{prefix}.{fs_type}.img'
|
||||
fs_img = os.path.join(config.persistent_data_dir, fs_img)
|
||||
fs_img = os.path.join(config.source_dir if use_src_dir
|
||||
else config.persistent_data_dir, fs_img)
|
||||
|
||||
if fs_type == 'fat16':
|
||||
mkfs_opt = '-F 16'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue