From d7a4b634f2b01dae9ff977b6b2e09043eaafb714 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Mon, 8 Apr 2024 16:13:28 +0200 Subject: [PATCH] tests/flash_disk: Expand scenarios to cover no erase device The commit adds overlay for native_posix and modifies testcase.yaml to allow testing CONFIG_DISK_DRIVER_FLASH with device that do not have erase requirement. Signed-off-by: Dominik Ermel --- .../native_posix_no_explicit_erase.overlay | 32 +++++++++++++++++++ tests/drivers/disk/disk_access/testcase.yaml | 8 +++++ 2 files changed, 40 insertions(+) create mode 100644 tests/drivers/disk/disk_access/boards/native_posix_no_explicit_erase.overlay diff --git a/tests/drivers/disk/disk_access/boards/native_posix_no_explicit_erase.overlay b/tests/drivers/disk/disk_access/boards/native_posix_no_explicit_erase.overlay new file mode 100644 index 00000000000..1d4edb73e97 --- /dev/null +++ b/tests/drivers/disk/disk_access/boards/native_posix_no_explicit_erase.overlay @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&flashcontroller0 { + reg = <0x00000000 DT_SIZE_K(1024)>; +}; + +&flash0 { + reg = <0x00000000 DT_SIZE_K(1024)>; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + flashdisk_partition: partition@0 { + label = "flashdisk"; + reg = <0x00000000 0x00100000>; + }; + }; +}; + +/ { + test_disk: storage_disk { + compatible = "zephyr,flash-disk"; + partition = <&flashdisk_partition>; + disk-name = "NAND"; + cache-size = <512>; + }; +}; diff --git a/tests/drivers/disk/disk_access/testcase.yaml b/tests/drivers/disk/disk_access/testcase.yaml index 9fc566158bc..94f25c00703 100644 --- a/tests/drivers/disk/disk_access/testcase.yaml +++ b/tests/drivers/disk/disk_access/testcase.yaml @@ -36,3 +36,11 @@ tests: - native_sim drivers.disk.stm32_sdhc: filter: dt_compat_enabled("st,stm32-sdmmc") + drivers.disk.simulator.no_explicit_erase: + extra_args: DTC_OVERLAY_FILE=boards/native_posix_no_explicit_erase.overlay + extra_configs: + - CONFIG_DISK_DRIVER_FLASH=y + - CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE=n + platform_allow: + - native_posix/native/64 + - native_posix