Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
a0ecfa56
U
U-Boot.Mirror
项目概览
OS
/
U-Boot.Mirror
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
U-Boot.Mirror
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a0ecfa56
编写于
5月 27, 2021
作者:
T
Tom Rini
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '2021-05-26-assorted-bugfixes'
上级
f4b2786b
cb6c9c83
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
88 addition
and
60 deletion
+88
-60
.gitlab-ci.yml
.gitlab-ci.yml
+0
-1
arch/powerpc/lib/traps.c
arch/powerpc/lib/traps.c
+1
-0
common/spl/Kconfig
common/spl/Kconfig
+12
-12
disk/part.c
disk/part.c
+5
-1
drivers/pinctrl/pinctrl-single.c
drivers/pinctrl/pinctrl-single.c
+2
-8
fs/btrfs/disk-io.c
fs/btrfs/disk-io.c
+1
-1
fs/squashfs/sqfs.c
fs/squashfs/sqfs.c
+1
-1
include/test/ut.h
include/test/ut.h
+0
-17
test/dm/part.c
test/dm/part.c
+30
-7
test/py/tests/test_fs/conftest.py
test/py/tests/test_fs/conftest.py
+36
-12
未找到文件。
.gitlab-ci.yml
浏览文件 @
a0ecfa56
...
@@ -189,7 +189,6 @@ sandbox_spl test.py:
...
@@ -189,7 +189,6 @@ sandbox_spl test.py:
<<
:
*buildman_and_testpy_dfn
<<
:
*buildman_and_testpy_dfn
sandbox_noinst_test.py
:
sandbox_noinst_test.py
:
tags
:
[
'
all'
]
variables
:
variables
:
TEST_PY_BD
:
"
sandbox_noinst"
TEST_PY_BD
:
"
sandbox_noinst"
TEST_PY_TEST_SPEC
:
"
test_ofplatdata
or
test_handoff
or
test_spl"
TEST_PY_TEST_SPEC
:
"
test_ofplatdata
or
test_handoff
or
test_spl"
...
...
arch/powerpc/lib/traps.c
浏览文件 @
a0ecfa56
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*/
*/
#include <common.h>
#include <init.h>
#include <init.h>
#include <asm/global_data.h>
#include <asm/global_data.h>
...
...
common/spl/Kconfig
浏览文件 @
a0ecfa56
...
@@ -165,7 +165,7 @@ config SPL_BOARD_INIT
...
@@ -165,7 +165,7 @@ config SPL_BOARD_INIT
provided by the board.
provided by the board.
config SPL_BOOTROM_SUPPORT
config SPL_BOOTROM_SUPPORT
bool "Support returning to the BOOTROM"
bool "Support returning to the BOOTROM"
help
help
Some platforms (e.g. the Rockchip RK3368) provide support in their
Some platforms (e.g. the Rockchip RK3368) provide support in their
ROM for loading the next boot-stage after performing basic setup
ROM for loading the next boot-stage after performing basic setup
...
@@ -707,7 +707,7 @@ config SYS_MMCSD_FS_BOOT_PARTITION
...
@@ -707,7 +707,7 @@ config SYS_MMCSD_FS_BOOT_PARTITION
default 1
default 1
help
help
Partition on the MMC to load U-Boot from when the MMC is being
Partition on the MMC to load U-Boot from when the MMC is being
used in fs mode
used in fs mode
config SPL_MMC_TINY
config SPL_MMC_TINY
bool "Tiny MMC framework in SPL"
bool "Tiny MMC framework in SPL"
...
@@ -784,8 +784,8 @@ config SPL_NAND_SIMPLE
...
@@ -784,8 +784,8 @@ config SPL_NAND_SIMPLE
config SPL_NAND_BASE
config SPL_NAND_BASE
depends on SPL_NAND_DRIVERS
depends on SPL_NAND_DRIVERS
bool "Use Base NAND Driver"
bool "Use Base NAND Driver"
help
help
Include nand_base.c in the SPL.
Include nand_base.c in the SPL.
config SPL_NAND_IDENT
config SPL_NAND_IDENT
depends on SPL_NAND_BASE
depends on SPL_NAND_BASE
...
@@ -1301,7 +1301,7 @@ config SPL_ATF_LOAD_IMAGE_V2
...
@@ -1301,7 +1301,7 @@ config SPL_ATF_LOAD_IMAGE_V2
method, say Y.
method, say Y.
config SPL_ATF_NO_PLATFORM_PARAM
config SPL_ATF_NO_PLATFORM_PARAM
bool "Pass no platform parameter"
bool "Pass no platform parameter"
depends on SPL_ATF
depends on SPL_ATF
help
help
While we expect to call a pointer to a valid FDT (or NULL)
While we expect to call a pointer to a valid FDT (or NULL)
...
@@ -1395,7 +1395,7 @@ config TPL_BOOTCOUNT_LIMIT
...
@@ -1395,7 +1395,7 @@ config TPL_BOOTCOUNT_LIMIT
For example, it may be useful to choose the device to boot.
For example, it may be useful to choose the device to boot.
config TPL_LDSCRIPT
config TPL_LDSCRIPT
string "Linker script for the TPL stage"
string "Linker script for the TPL stage"
depends on TPL
depends on TPL
default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARM64
default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARM64
default "arch/\$(ARCH)/cpu/u-boot-spl.lds"
default "arch/\$(ARCH)/cpu/u-boot-spl.lds"
...
@@ -1409,7 +1409,7 @@ config TPL_LDSCRIPT
...
@@ -1409,7 +1409,7 @@ config TPL_LDSCRIPT
fall back to the linker-script used for the SPL stage.
fall back to the linker-script used for the SPL stage.
config TPL_NEEDS_SEPARATE_TEXT_BASE
config TPL_NEEDS_SEPARATE_TEXT_BASE
bool "TPL needs a separate text-base"
bool "TPL needs a separate text-base"
default n
default n
depends on TPL
depends on TPL
help
help
...
@@ -1418,7 +1418,7 @@ config TPL_NEEDS_SEPARATE_TEXT_BASE
...
@@ -1418,7 +1418,7 @@ config TPL_NEEDS_SEPARATE_TEXT_BASE
.text sections of the TPL stage has to be set below.
.text sections of the TPL stage has to be set below.
config TPL_NEEDS_SEPARATE_STACK
config TPL_NEEDS_SEPARATE_STACK
bool "TPL needs a separate initial stack-pointer"
bool "TPL needs a separate initial stack-pointer"
default n
default n
depends on TPL
depends on TPL
help
help
...
@@ -1426,20 +1426,20 @@ config TPL_NEEDS_SEPARATE_STACK
...
@@ -1426,20 +1426,20 @@ config TPL_NEEDS_SEPARATE_STACK
stack-pointer from the settings for the SPL stage.
stack-pointer from the settings for the SPL stage.
config TPL_TEXT_BASE
config TPL_TEXT_BASE
hex "Base address for the .text section of the TPL stage"
hex "Base address for the .text section of the TPL stage"
depends on TPL_NEEDS_SEPARATE_TEXT_BASE
depends on TPL_NEEDS_SEPARATE_TEXT_BASE
help
help
The base address for the .text section of the TPL stage.
The base address for the .text section of the TPL stage.
config TPL_MAX_SIZE
config TPL_MAX_SIZE
int "Maximum size (in bytes) for the TPL stage"
int "Maximum size (in bytes) for the TPL stage"
default 0
default 0
depends on TPL
depends on TPL
help
help
The maximum size (in bytes) of the TPL stage.
The maximum size (in bytes) of the TPL stage.
config TPL_STACK
config TPL_STACK
hex "Address of the initial stack-pointer for the TPL stage"
hex "Address of the initial stack-pointer for the TPL stage"
depends on TPL_NEEDS_SEPARATE_STACK
depends on TPL_NEEDS_SEPARATE_STACK
help
help
The address of the initial stack-pointer for the TPL stage.
The address of the initial stack-pointer for the TPL stage.
...
@@ -1457,7 +1457,7 @@ config TPL_READ_ONLY
...
@@ -1457,7 +1457,7 @@ config TPL_READ_ONLY
device-private data.
device-private data.
config TPL_BOOTROM_SUPPORT
config TPL_BOOTROM_SUPPORT
bool "Support returning to the BOOTROM (from TPL)"
bool "Support returning to the BOOTROM (from TPL)"
help
help
Some platforms (e.g. the Rockchip RK3368) provide support in their
Some platforms (e.g. the Rockchip RK3368) provide support in their
ROM for loading the next boot-stage after performing basic setup
ROM for loading the next boot-stage after performing basic setup
...
...
disk/part.c
浏览文件 @
a0ecfa56
...
@@ -714,7 +714,11 @@ static int part_get_info_by_dev_and_name(const char *dev_iface,
...
@@ -714,7 +714,11 @@ static int part_get_info_by_dev_and_name(const char *dev_iface,
int
ret
;
int
ret
;
/* Separate device and partition name specification */
/* Separate device and partition name specification */
part_str
=
strchr
(
dev_part_str
,
'#'
);
if
(
dev_part_str
)
part_str
=
strchr
(
dev_part_str
,
'#'
);
else
part_str
=
NULL
;
if
(
part_str
)
{
if
(
part_str
)
{
dup_str
=
strdup
(
dev_part_str
);
dup_str
=
strdup
(
dev_part_str
);
dup_str
[
part_str
-
dev_part_str
]
=
0
;
dup_str
[
part_str
-
dev_part_str
]
=
0
;
...
...
drivers/pinctrl/pinctrl-single.c
浏览文件 @
a0ecfa56
...
@@ -509,19 +509,13 @@ static int single_of_to_plat(struct udevice *dev)
...
@@ -509,19 +509,13 @@ static int single_of_to_plat(struct udevice *dev)
return
-
EINVAL
;
return
-
EINVAL
;
}
}
addr
=
dev_read_addr_size
(
dev
,
"reg"
,
&
size
);
addr
=
dev_read_addr_size
_index
(
dev
,
0
,
&
size
);
if
(
addr
==
FDT_ADDR_T_NONE
)
{
if
(
addr
==
FDT_ADDR_T_NONE
)
{
dev_err
(
dev
,
"failed to get base register
size
\n
"
);
dev_err
(
dev
,
"failed to get base register
address
\n
"
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
pdata
->
offset
=
size
-
pdata
->
width
/
BITS_PER_BYTE
;
pdata
->
offset
=
size
-
pdata
->
width
/
BITS_PER_BYTE
;
addr
=
dev_read_addr
(
dev
);
if
(
addr
==
FDT_ADDR_T_NONE
)
{
dev_dbg
(
dev
,
"no valid base register address
\n
"
);
return
-
EINVAL
;
}
pdata
->
base
=
addr
;
pdata
->
base
=
addr
;
ret
=
dev_read_u32
(
dev
,
"pinctrl-single,function-mask"
,
&
pdata
->
mask
);
ret
=
dev_read_u32
(
dev
,
"pinctrl-single,function-mask"
,
&
pdata
->
mask
);
...
...
fs/btrfs/disk-io.c
浏览文件 @
a0ecfa56
...
@@ -291,7 +291,7 @@ error_out:
...
@@ -291,7 +291,7 @@ error_out:
int
btrfs_read_dev_super
(
struct
blk_desc
*
desc
,
struct
disk_partition
*
part
,
int
btrfs_read_dev_super
(
struct
blk_desc
*
desc
,
struct
disk_partition
*
part
,
struct
btrfs_super_block
*
sb
)
struct
btrfs_super_block
*
sb
)
{
{
char
tmp
[
BTRFS_SUPER_INFO_SIZE
]
;
ALLOC_CACHE_ALIGN_BUFFER
(
char
,
tmp
,
BTRFS_SUPER_INFO_SIZE
)
;
struct
btrfs_super_block
*
buf
=
(
struct
btrfs_super_block
*
)
tmp
;
struct
btrfs_super_block
*
buf
=
(
struct
btrfs_super_block
*
)
tmp
;
int
ret
;
int
ret
;
...
...
fs/squashfs/sqfs.c
浏览文件 @
a0ecfa56
...
@@ -876,7 +876,7 @@ int sqfs_opendir(const char *filename, struct fs_dir_stream **dirsp)
...
@@ -876,7 +876,7 @@ int sqfs_opendir(const char *filename, struct fs_dir_stream **dirsp)
char
**
token_list
=
NULL
,
*
path
=
NULL
;
char
**
token_list
=
NULL
,
*
path
=
NULL
;
u32
*
pos_list
=
NULL
;
u32
*
pos_list
=
NULL
;
dirs
=
malloc
(
sizeof
(
*
dirs
));
dirs
=
calloc
(
1
,
sizeof
(
*
dirs
));
if
(
!
dirs
)
if
(
!
dirs
)
return
-
EINVAL
;
return
-
EINVAL
;
...
...
include/test/ut.h
浏览文件 @
a0ecfa56
...
@@ -177,23 +177,6 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
...
@@ -177,23 +177,6 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
} \
} \
}
}
/*
* Assert that two string expressions are equal, up to length of the
* first
*/
#define ut_asserteq_strn(expr1, expr2) { \
const char *_val1 = (expr1), *_val2 = (expr2); \
int _len = strlen(_val1); \
\
if (memcmp(_val1, _val2, _len)) { \
ut_failf(uts, __FILE__, __LINE__, __func__, \
#expr1 " = " #expr2, \
"Expected \"%.*s\", got \"%.*s\"", \
_len, _val1, _len, _val2); \
return CMD_RET_FAILURE; \
} \
}
/* Assert that two memory areas are equal */
/* Assert that two memory areas are equal */
#define ut_asserteq_mem(expr1, expr2, len) { \
#define ut_asserteq_mem(expr1, expr2, len) { \
const u8 *_val1 = (u8 *)(expr1), *_val2 = (u8 *)(expr2); \
const u8 *_val1 = (u8 *)(expr1), *_val2 = (u8 *)(expr2); \
...
...
test/dm/part.c
浏览文件 @
a0ecfa56
...
@@ -11,11 +11,25 @@
...
@@ -11,11 +11,25 @@
#include <dm/test.h>
#include <dm/test.h>
#include <test/ut.h>
#include <test/ut.h>
static
inline
int
do_test
(
struct
unit_test_state
*
uts
,
int
expected
,
const
char
*
part_str
,
bool
whole
)
{
struct
blk_desc
*
mmc_dev_desc
;
struct
disk_partition
part_info
;
ut_asserteq
(
expected
,
part_get_info_by_dev_and_name_or_num
(
"mmc"
,
part_str
,
&
mmc_dev_desc
,
&
part_info
,
whole
));
return
0
;
}
static
int
dm_test_part
(
struct
unit_test_state
*
uts
)
static
int
dm_test_part
(
struct
unit_test_state
*
uts
)
{
{
char
*
oldbootdevice
;
char
str_disk_guid
[
UUID_STR_LEN
+
1
];
char
str_disk_guid
[
UUID_STR_LEN
+
1
];
int
ret
;
struct
blk_desc
*
mmc_dev_desc
;
struct
blk_desc
*
mmc_dev_desc
;
struct
disk_partition
part_info
;
struct
disk_partition
parts
[
2
]
=
{
struct
disk_partition
parts
[
2
]
=
{
{
{
.
start
=
48
,
/* GPT data takes up the first 34 blocks or so */
.
start
=
48
,
/* GPT data takes up the first 34 blocks or so */
...
@@ -38,16 +52,22 @@ static int dm_test_part(struct unit_test_state *uts)
...
@@ -38,16 +52,22 @@ static int dm_test_part(struct unit_test_state *uts)
ut_assertok
(
gpt_restore
(
mmc_dev_desc
,
str_disk_guid
,
parts
,
ut_assertok
(
gpt_restore
(
mmc_dev_desc
,
str_disk_guid
,
parts
,
ARRAY_SIZE
(
parts
)));
ARRAY_SIZE
(
parts
)));
#define test(expected, part_str, whole) \
oldbootdevice
=
env_get
(
"bootdevice"
);
ut_asserteq(expected, \
part_get_info_by_dev_and_name_or_num("mmc", part_str, \
&mmc_dev_desc, \
&part_info, whole))
#define test(expected, part_str, whole) do { \
ret = do_test(uts, expected, part_str, whole); \
if (ret) \
goto out; \
} while (0)
env_set
(
"bootdevice"
,
NULL
);
test
(
-
ENODEV
,
NULL
,
true
);
test
(
-
ENODEV
,
""
,
true
);
test
(
-
ENODEV
,
""
,
true
);
env_set
(
"bootdevice"
,
"0"
);
env_set
(
"bootdevice"
,
"0"
);
test
(
0
,
NULL
,
true
);
test
(
0
,
""
,
true
);
test
(
0
,
""
,
true
);
env_set
(
"bootdevice"
,
"1"
);
env_set
(
"bootdevice"
,
"1"
);
test
(
1
,
NULL
,
false
);
test
(
1
,
""
,
false
);
test
(
1
,
""
,
false
);
test
(
1
,
"-"
,
false
);
test
(
1
,
"-"
,
false
);
env_set
(
"bootdevice"
,
""
);
env_set
(
"bootdevice"
,
""
);
...
@@ -70,7 +90,10 @@ static int dm_test_part(struct unit_test_state *uts)
...
@@ -70,7 +90,10 @@ static int dm_test_part(struct unit_test_state *uts)
test
(
-
EINVAL
,
"1#bogus"
,
false
);
test
(
-
EINVAL
,
"1#bogus"
,
false
);
test
(
1
,
"1#test1"
,
false
);
test
(
1
,
"1#test1"
,
false
);
test
(
2
,
"1#test2"
,
false
);
test
(
2
,
"1#test2"
,
false
);
ret
=
0
;
return
0
;
out:
env_set
(
"bootdevice"
,
oldbootdevice
);
return
ret
;
}
}
DM_TEST
(
dm_test_part
,
UT_TESTF_SCAN_PDATA
|
UT_TESTF_SCAN_FDT
);
DM_TEST
(
dm_test_part
,
UT_TESTF_SCAN_PDATA
|
UT_TESTF_SCAN_FDT
);
test/py/tests/test_fs/conftest.py
浏览文件 @
a0ecfa56
...
@@ -278,14 +278,19 @@ def fs_obj_basic(request, u_boot_config):
...
@@ -278,14 +278,19 @@ def fs_obj_basic(request, u_boot_config):
check_call
(
'mkdir -p %s'
%
mount_dir
,
shell
=
True
)
check_call
(
'mkdir -p %s'
%
mount_dir
,
shell
=
True
)
except
CalledProcessError
as
err
:
except
CalledProcessError
as
err
:
pytest
.
skip
(
'Preparing mount folder failed for filesystem: '
+
fs_type
+
'. {}'
.
format
(
err
))
pytest
.
skip
(
'Preparing mount folder failed for filesystem: '
+
fs_type
+
'. {}'
.
format
(
err
))
return
finally
:
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
return
try
:
try
:
# Mount the image so we can populate it.
# Mount the image so we can populate it.
mount_fs
(
fs_type
,
fs_img
,
mount_dir
)
mount_fs
(
fs_type
,
fs_img
,
mount_dir
)
except
CalledProcessError
as
err
:
pytest
.
skip
(
'Mounting to folder failed for filesystem: '
+
fs_type
+
'. {}'
.
format
(
err
))
call
(
'rmdir %s'
%
mount_dir
,
shell
=
True
)
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
return
try
:
# Create a subdirectory.
# Create a subdirectory.
check_call
(
'mkdir %s/SUBDIR'
%
mount_dir
,
shell
=
True
)
check_call
(
'mkdir %s/SUBDIR'
%
mount_dir
,
shell
=
True
)
...
@@ -348,11 +353,12 @@ def fs_obj_basic(request, u_boot_config):
...
@@ -348,11 +353,12 @@ def fs_obj_basic(request, u_boot_config):
except
CalledProcessError
as
err
:
except
CalledProcessError
as
err
:
pytest
.
skip
(
'Setup failed for filesystem: '
+
fs_type
+
'. {}'
.
format
(
err
))
pytest
.
skip
(
'Setup failed for filesystem: '
+
fs_type
+
'. {}'
.
format
(
err
))
umount_fs
(
mount_dir
)
return
return
else
:
else
:
umount_fs
(
mount_dir
)
yield
[
fs_ubtype
,
fs_img
,
md5val
]
yield
[
fs_ubtype
,
fs_img
,
md5val
]
finally
:
finally
:
umount_fs
(
mount_dir
)
call
(
'rmdir %s'
%
mount_dir
,
shell
=
True
)
call
(
'rmdir %s'
%
mount_dir
,
shell
=
True
)
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
...
@@ -394,14 +400,19 @@ def fs_obj_ext(request, u_boot_config):
...
@@ -394,14 +400,19 @@ def fs_obj_ext(request, u_boot_config):
check_call
(
'mkdir -p %s'
%
mount_dir
,
shell
=
True
)
check_call
(
'mkdir -p %s'
%
mount_dir
,
shell
=
True
)
except
CalledProcessError
as
err
:
except
CalledProcessError
as
err
:
pytest
.
skip
(
'Preparing mount folder failed for filesystem: '
+
fs_type
+
'. {}'
.
format
(
err
))
pytest
.
skip
(
'Preparing mount folder failed for filesystem: '
+
fs_type
+
'. {}'
.
format
(
err
))
return
finally
:
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
return
try
:
try
:
# Mount the image so we can populate it.
# Mount the image so we can populate it.
mount_fs
(
fs_type
,
fs_img
,
mount_dir
)
mount_fs
(
fs_type
,
fs_img
,
mount_dir
)
except
CalledProcessError
as
err
:
pytest
.
skip
(
'Mounting to folder failed for filesystem: '
+
fs_type
+
'. {}'
.
format
(
err
))
call
(
'rmdir %s'
%
mount_dir
,
shell
=
True
)
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
return
try
:
# Create a test directory
# Create a test directory
check_call
(
'mkdir %s/dir1'
%
mount_dir
,
shell
=
True
)
check_call
(
'mkdir %s/dir1'
%
mount_dir
,
shell
=
True
)
...
@@ -443,11 +454,12 @@ def fs_obj_ext(request, u_boot_config):
...
@@ -443,11 +454,12 @@ def fs_obj_ext(request, u_boot_config):
check_call
(
'rm %s'
%
tmp_file
,
shell
=
True
)
check_call
(
'rm %s'
%
tmp_file
,
shell
=
True
)
except
CalledProcessError
:
except
CalledProcessError
:
pytest
.
skip
(
'Setup failed for filesystem: '
+
fs_type
)
pytest
.
skip
(
'Setup failed for filesystem: '
+
fs_type
)
umount_fs
(
mount_dir
)
return
return
else
:
else
:
umount_fs
(
mount_dir
)
yield
[
fs_ubtype
,
fs_img
,
md5val
]
yield
[
fs_ubtype
,
fs_img
,
md5val
]
finally
:
finally
:
umount_fs
(
mount_dir
)
call
(
'rmdir %s'
%
mount_dir
,
shell
=
True
)
call
(
'rmdir %s'
%
mount_dir
,
shell
=
True
)
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
...
@@ -517,14 +529,19 @@ def fs_obj_unlink(request, u_boot_config):
...
@@ -517,14 +529,19 @@ def fs_obj_unlink(request, u_boot_config):
check_call
(
'mkdir -p %s'
%
mount_dir
,
shell
=
True
)
check_call
(
'mkdir -p %s'
%
mount_dir
,
shell
=
True
)
except
CalledProcessError
as
err
:
except
CalledProcessError
as
err
:
pytest
.
skip
(
'Preparing mount folder failed for filesystem: '
+
fs_type
+
'. {}'
.
format
(
err
))
pytest
.
skip
(
'Preparing mount folder failed for filesystem: '
+
fs_type
+
'. {}'
.
format
(
err
))
return
finally
:
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
return
try
:
try
:
# Mount the image so we can populate it.
# Mount the image so we can populate it.
mount_fs
(
fs_type
,
fs_img
,
mount_dir
)
mount_fs
(
fs_type
,
fs_img
,
mount_dir
)
except
CalledProcessError
as
err
:
pytest
.
skip
(
'Mounting to folder failed for filesystem: '
+
fs_type
+
'. {}'
.
format
(
err
))
call
(
'rmdir %s'
%
mount_dir
,
shell
=
True
)
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
return
try
:
# Test Case 1 & 3
# Test Case 1 & 3
check_call
(
'mkdir %s/dir1'
%
mount_dir
,
shell
=
True
)
check_call
(
'mkdir %s/dir1'
%
mount_dir
,
shell
=
True
)
check_call
(
'dd if=/dev/urandom of=%s/dir1/file1 bs=1K count=1'
check_call
(
'dd if=/dev/urandom of=%s/dir1/file1 bs=1K count=1'
...
@@ -548,11 +565,12 @@ def fs_obj_unlink(request, u_boot_config):
...
@@ -548,11 +565,12 @@ def fs_obj_unlink(request, u_boot_config):
except
CalledProcessError
:
except
CalledProcessError
:
pytest
.
skip
(
'Setup failed for filesystem: '
+
fs_type
)
pytest
.
skip
(
'Setup failed for filesystem: '
+
fs_type
)
umount_fs
(
mount_dir
)
return
return
else
:
else
:
umount_fs
(
mount_dir
)
yield
[
fs_ubtype
,
fs_img
]
yield
[
fs_ubtype
,
fs_img
]
finally
:
finally
:
umount_fs
(
mount_dir
)
call
(
'rmdir %s'
%
mount_dir
,
shell
=
True
)
call
(
'rmdir %s'
%
mount_dir
,
shell
=
True
)
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
...
@@ -594,14 +612,19 @@ def fs_obj_symlink(request, u_boot_config):
...
@@ -594,14 +612,19 @@ def fs_obj_symlink(request, u_boot_config):
check_call
(
'mkdir -p %s'
%
mount_dir
,
shell
=
True
)
check_call
(
'mkdir -p %s'
%
mount_dir
,
shell
=
True
)
except
CalledProcessError
as
err
:
except
CalledProcessError
as
err
:
pytest
.
skip
(
'Preparing mount folder failed for filesystem: '
+
fs_type
+
'. {}'
.
format
(
err
))
pytest
.
skip
(
'Preparing mount folder failed for filesystem: '
+
fs_type
+
'. {}'
.
format
(
err
))
return
finally
:
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
return
try
:
try
:
# Mount the image so we can populate it.
# Mount the image so we can populate it.
mount_fs
(
fs_type
,
fs_img
,
mount_dir
)
mount_fs
(
fs_type
,
fs_img
,
mount_dir
)
except
CalledProcessError
as
err
:
pytest
.
skip
(
'Mounting to folder failed for filesystem: '
+
fs_type
+
'. {}'
.
format
(
err
))
call
(
'rmdir %s'
%
mount_dir
,
shell
=
True
)
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
return
try
:
# Create a subdirectory.
# Create a subdirectory.
check_call
(
'mkdir %s/SUBDIR'
%
mount_dir
,
shell
=
True
)
check_call
(
'mkdir %s/SUBDIR'
%
mount_dir
,
shell
=
True
)
...
@@ -625,10 +648,11 @@ def fs_obj_symlink(request, u_boot_config):
...
@@ -625,10 +648,11 @@ def fs_obj_symlink(request, u_boot_config):
except
CalledProcessError
:
except
CalledProcessError
:
pytest
.
skip
(
'Setup failed for filesystem: '
+
fs_type
)
pytest
.
skip
(
'Setup failed for filesystem: '
+
fs_type
)
umount_fs
(
mount_dir
)
return
return
else
:
else
:
umount_fs
(
mount_dir
)
yield
[
fs_ubtype
,
fs_img
,
md5val
]
yield
[
fs_ubtype
,
fs_img
,
md5val
]
finally
:
finally
:
umount_fs
(
mount_dir
)
call
(
'rmdir %s'
%
mount_dir
,
shell
=
True
)
call
(
'rmdir %s'
%
mount_dir
,
shell
=
True
)
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
call
(
'rm -f %s'
%
fs_img
,
shell
=
True
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录