Skip to content

Conversation

@zhaoxingyu12
Copy link
Contributor

Note: Please adhere to Contributing Guidelines.

Summary

  1. The original test cases were designed based on struct nvs_ate, but now the struct nvs_ate has been changed. The expired field is dynamically adjusted according to the size of the page size, and the test cases also need to be changed accordingly
  2. The special_id of NVS should be changed from fixed ffff to dynamically adjusted based on erase value, and the test cases should also be adjusted accordingly

Impact

testcases for nvs module

Testing

This has been tested and passed in qemu

test_nvs_mount: test begin
test_nvs_mount: success
test_nvs_write: test begin
test_nvs_write: success
test_nvs_corrupt_expire: test begin
test_nvs_corrupt_expire: success
test_nvs_corrupted_write: test begin
test_nvs_corrupted_write: success
test_nvs_gc: test begin
test_nvs_gc: success
test_nvs_gc_3sectors: test begin
test_nvs_gc_3sectors: success
test_nvs_corrupted_sector_close: test begin
test_nvs_corrupted_sector_close: success
test_nvs_full_sector: test begin
test_nvs_full_sector: success
test_nvs_gc_corrupt_close_ate: test begin
test_nvs_gc_corrupt_close_ate: success
test_nvs_gc_corrupt_ate: test begin
test_nvs_gc_corrupt_ate: success
test_nvs_gc_touched_deleted_ate: test begin
test_nvs_gc_touched_deleted_ate: success
test_nvs_gc_touched_expired_ate: test begin
test_nvs_gc_touched_expired_ate: success
test_nvs_gc_not_touched_expired_ate: test begin
test_nvs_gc_not_touched_expired_ate: success

Final memory usage:
VARIABLE BEFORE AFTER DELTA
arena 4294 4294 0
ordblks 1 1 0
mxordblk eb0 eb0 0
uordblks 33e4 33e4 0
fordblks eb0 eb0 0
nsh>

mtd/nvs removes CONFIG_MTD_WRITE_ALIGN_SIZE,
testcases need to be modified meanwhile

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
@xiaoxiang781216
Copy link
Contributor

@zhaoxingyu12 please fix typo error:

/home/runner/work/nuttx-apps/nuttx-apps/apps/testing/fs/mtd_config_fs/mtd_config_fs_test_main.c:1296: 2st ==> 2nd
/home/runner/work/nuttx-apps/nuttx-apps/apps/testing/fs/mtd_config_fs/mtd_config_fs_test_main.c:1303: 2st ==> 2nd
/home/runner/work/nuttx-apps/nuttx-apps/apps/testing/fs/mtd_config_fs/mtd_config_fs_test_main.c:1310: 2st ==> 2nd
/home/runner/work/nuttx-apps/nuttx-apps/apps/testing/fs/mtd_config_fs/mtd_config_fs_test_main.c:1317: 2st ==> 2nd
/home/runner/work/nuttx-apps/nuttx-apps/apps/testing/fs/mtd_config_fs/mtd_config_fs_test_main.c:1324: 2st ==> 2nd
/home/runner/work/nuttx-apps/nuttx-apps/apps/testing/fs/mtd_config_fs/mtd_config_fs_test_main.c:1333: 3st ==> 3rd
/home/runner/work/nuttx-apps/nuttx-apps/apps/testing/fs/mtd_config_fs/mtd_config_fs_test_main.c:1340: 3st ==> 3rd
/home/runner/work/nuttx-apps/nuttx-apps/apps/testing/fs/mtd_config_fs/mtd_config_fs_test_main.c:1347: 3st ==> 3rd
/home/runner/work/nuttx-apps/nuttx-apps/apps/testing/fs/mtd_config_fs/mtd_config_fs_test_main.c:1354: 3st ==> 3rd
/home/runner/work/nuttx-apps/nuttx-apps/apps/testing/fs/mtd_config_fs/mtd_config_fs_test_main.c:1361: 3st ==> 3rd
/home/runner/work/nuttx-apps/nuttx-apps/apps/testing/fs/mtd_config_fs/mtd_config_fs_test_main.c:2474: udpate ==> update
/home/runner/work/nuttx-apps/nuttx-apps/apps/testing/fs/mtd_config_fs/mtd_config_fs_test_main.c:2579: feild ==> field

Special_id dynamically adjusts based on erase value

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
@jerpelea jerpelea changed the title update nvs testcases for struct nvs_ate changed apps/testing: update nvs testcases for struct nvs_ate changed Jan 12, 2026
@cederom
Copy link
Contributor

cederom commented Jan 12, 2026

TODO: Typos :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants