testing:add MTD Fail-safe config-data tests
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
This commit is contained in:
parent
1c7839c28c
commit
c427f408cb
50
testing/mtd_config_fs/Kconfig
Normal file
50
testing/mtd_config_fs/Kconfig
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
#
|
||||||
|
# For a description of the syntax of this configuration file,
|
||||||
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||||
|
#
|
||||||
|
|
||||||
|
config TESTING_MTD_CONFIG_FAIL_SAFE
|
||||||
|
tristate "MTD Config fail-safe storage test"
|
||||||
|
default n
|
||||||
|
depends on MTD_CONFIG_FAIL_SAFE
|
||||||
|
---help---
|
||||||
|
Enable the fail-safe storage test
|
||||||
|
|
||||||
|
if TESTING_MTD_CONFIG_FAIL_SAFE
|
||||||
|
|
||||||
|
config TESTING_MTD_CONFIG_FAIL_SAFE_PROGNAME
|
||||||
|
string "Program name"
|
||||||
|
default "mtdconfig_fs_test"
|
||||||
|
---help---
|
||||||
|
This is the name of the program that will be used when the NSH ELF
|
||||||
|
program is installed.
|
||||||
|
|
||||||
|
config TESTING_MTD_CONFIG_FAIL_SAFE_MOUNTPT_NAME
|
||||||
|
string "MTD driver mount pt"
|
||||||
|
default "/dev/mtdnvs_flash"
|
||||||
|
|
||||||
|
config TESTING_MTD_CONFIG_FAIL_SAFE_MOUNTPT_MAXNAME
|
||||||
|
int "MTD driver mount pt path len"
|
||||||
|
default 64
|
||||||
|
|
||||||
|
config TESTING_MTD_CONFIG_FAIL_SAFE_FLASH_SECTION_SIZE
|
||||||
|
int "MTD flash section size"
|
||||||
|
default 4096
|
||||||
|
|
||||||
|
config TESTING_MTD_CONFIG_FAIL_SAFE_FLASH_SECTION_COUNT
|
||||||
|
int "MTD flash section count"
|
||||||
|
default 3
|
||||||
|
|
||||||
|
config TESTING_MTD_CONFIG_FAIL_SAFE_PRIORITY
|
||||||
|
int "MTD nvs test task priority"
|
||||||
|
default 100
|
||||||
|
|
||||||
|
config TESTING_MTD_CONFIG_FAIL_SAFE_STACKSIZE
|
||||||
|
int "MTD nvs test stack size"
|
||||||
|
default 4096
|
||||||
|
|
||||||
|
config TESTING_MTD_CONFIG_FAIL_SAFE_VERBOSE
|
||||||
|
bool "Verbose output"
|
||||||
|
default n
|
||||||
|
|
||||||
|
endif
|
23
testing/mtd_config_fs/Make.defs
Normal file
23
testing/mtd_config_fs/Make.defs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
############################################################################
|
||||||
|
# apps/testing/mtd_config_fs/Make.defs
|
||||||
|
#
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
# contributor license agreements. See the NOTICE file distributed with
|
||||||
|
# this work for additional information regarding copyright ownership. The
|
||||||
|
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance with the
|
||||||
|
# License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_TESTING_MTD_CONFIG_FAIL_SAFE),)
|
||||||
|
CONFIGURED_APPS += $(APPDIR)/testing/mtd_config_fs
|
||||||
|
endif
|
34
testing/mtd_config_fs/Makefile
Normal file
34
testing/mtd_config_fs/Makefile
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
############################################################################
|
||||||
|
# apps/testing/mtd_nvs/Makefile
|
||||||
|
#
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
# contributor license agreements. See the NOTICE file distributed with
|
||||||
|
# this work for additional information regarding copyright ownership. The
|
||||||
|
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance with the
|
||||||
|
# License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
include $(APPDIR)/Make.defs
|
||||||
|
|
||||||
|
# MTD nvs test application info
|
||||||
|
|
||||||
|
PROGNAME = $(CONFIG_TESTING_MTD_CONFIG_FAIL_SAFE_PROGNAME)
|
||||||
|
PRIORITY = $(CONFIG_TESTING_MTD_CONFIG_FAIL_SAFE_PRIORITY)
|
||||||
|
STACKSIZE = $(CONFIG_TESTING_MTD_CONFIG_FAIL_SAFE_STACKSIZE)
|
||||||
|
MODULE = $(CONFIG_TESTING_MTD_CONFIG_FAIL_SAFE)
|
||||||
|
|
||||||
|
# MTD nvs test
|
||||||
|
|
||||||
|
MAINSRC = mtd_config_fs_test_main.c
|
||||||
|
|
||||||
|
include $(APPDIR)/Application.mk
|
16
testing/mtd_config_fs/README.md
Normal file
16
testing/mtd_config_fs/README.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Testing / `mtd_nvs` MTD non-volatile storage Test
|
||||||
|
|
||||||
|
This is a test for MTD non-volatile storage. MTD non-volatile storage was originally
|
||||||
|
implemented in Zephyr by Laczen. We made several modification to the original design.
|
||||||
|
The main purpose of those modification was:
|
||||||
|
1. support C-string key in nvs API(Original design only support uint16_t as key)
|
||||||
|
2. Meanwhile achieve better performance by limiting flash read times(Theoratically
|
||||||
|
better than Zephyr subsys/settings, which is based on original NVS).
|
||||||
|
|
||||||
|
|
||||||
|
- `CONFIG_TESTING_FAILSAFE_MTD_CONFIG` – Enable the test.
|
||||||
|
- `CONFIG_TESTING_FAILSAFE_MTD_CONFIG_VERBOSE` – Verbose output.
|
||||||
|
|
||||||
|
EXAMPLE
|
||||||
|
mtdconfig_fs_test -m /dev/config – Test MTD NVS on /dev/config
|
||||||
|
mtdconfig_fs_test -h – Get help message
|
2039
testing/mtd_config_fs/mtd_config_fs_test_main.c
Normal file
2039
testing/mtd_config_fs/mtd_config_fs_test_main.c
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user