Commit Graph

69 Commits (refactor_mbed_host_tests)

Author SHA1 Message Date
Rajkumar Kanagaraj 50fc85dc44 CMake: Remove all unittest.cmake script from test suite
- Remove redundant cmake script as already added the CMake configuration file
- Remove redundant empty_baseline as it is no longer needed with the help of CMake configuration file
2021-05-26 07:09:14 -07:00
Anna Bridge 4e586a93d3
Merge pull request #14426 from ARMmbed/feature_unittest_refactor
CMake: Refactor UNITTESTS CMake
2021-05-24 13:04:22 +01:00
harmut01 468ee97bdd Deprecate TDB_EXTERNAL_NO_RBP and FILESYSTEM_NO_RBP in kv_config
NO_RBP (no rollback protection) is intended to not require an internal
TDB, however, DeviceKey, which we use to derive SecureStore's
encryption key, still does. Currently, no internal TDB is created with
these two configurations, meaning there's no way to store the DeviceKey
and SecureStore doesn't work.
2021-05-11 17:19:10 +01:00
Rajkumar Kanagaraj c0a8fe62f5 CMake: Refactor storage TDBstore and FileSystemStore unittest cmake
- Add CMake configuration file in TDBstore and FileSystemStore unittest.
2021-05-11 02:29:56 -07:00
Rajkumar Kanagaraj ba04c1cf76 CMake: Add add_subdirectory of unittests
- add every libraries unittest directory into respective CMake
  which allows to include unittest source into build based on
  MBED_BUILD_UNITTESTS flag
2021-05-11 02:29:56 -07:00
Lingkai Dong 7b763be0e3 TDBStore Whitebox tests: fix memory check
Each block of HeapBlockDevice is only allocated from the heap when
that block is programmed. And erasing a block frees the associated
buffer.

To decide if there is enough heap to run the TDBStore Whitebox tests,
we need to perform a trial program() instead of erase().
2021-04-14 17:19:38 +01:00
Lingkai Dong aedc6009ea TDBStore: call `BlockDevice::erase()` regarless of erase value
From the documentations of `BlockDevice::get_erase_value()`:

    -1 if you can't rely on the value of the erased storage

and `BlockDevice::program()`:

    The blocks must have been erased prior to being programmed

So, `BlockDevice::erase()` should always be called regardless of
erase value.
2021-04-14 17:19:38 +01:00
Lingkai Dong fb4e5e80b4 TDBStore: optimize erase algorithms
Currently `TDBStore::offset_in_erase_unit()` and
`TDBStore::check_erase_before_write()` loop through erase units
one-by-one, until the entire range is covered. This is very inefficient
when the erase size is tiny, e.g. one-byte on a non-flash device for
which we use program as erase.

This commit reworks the algorithms, based on the fact that a block
device can erase or program as many units as needed in one go.
2021-04-14 17:19:38 +01:00
Lingkai Dong e8070514b1 FileSystemStore unit test: remove erased_set_get test
The "erased_set_get" test case deinits `FileSystemStore`, erases the
block device, and reinits `FileSystemStore`. This of course fails,
because `BlockDevice::erase()` removes all stored data including the
format of the `FileSystem` (middle layer), unless the particular type
of block device has a no-op erase implementation.

Note: Previously `HeapBlockDevice::erase()` was essentially a no-op
so this test case did not fail. We recently added the freeing of heap
memory and it uncovered the problem.
2021-04-14 17:16:54 +01:00
Vikas Katariya 8648e4f4d6 Remove: ARM_MUSCA_A1 support
ARM_MUSCA_A1 is not supported since Mbed OS 6.0
Refer: https://github.com/ARMmbed/mbed-os/pull/13165

Therefore remove files from kv_config and TF-M post binary hook script.
2021-02-25 14:02:56 +00:00
Martin Kojtal e6565a4486
Merge pull request #14031 from arduino/blockdevices_namespaces
BlockDevices: specify mbed namespace where needed
2021-02-04 20:08:07 +00:00
Rajkumar Kanagaraj 6824b14e48 CMake: rename greentea test macro 2021-02-02 07:43:40 -08:00
Oliver Wildtgrube 6b0215c687 fix namespaces for MBED_NO_GLOBAL_USING_DIRECTIVE feature
added namespaces in various files
2021-02-02 12:49:11 +01:00
Martin Kojtal 8effecdf29
Merge pull request #14063 from dustin-crossman/pr/wifi_reserved_region
Support arbitrary storage alongside WiFi firmware in external storage on Cypress targets
2021-01-20 08:34:23 +00:00
Martin Kojtal 5021c01852
Merge pull request #14088 from hugueskamba/hk_cmake_greentea_kvstore
CMake: Add support for KVstore Greentea tests
2021-01-11 11:46:34 +00:00
Hugues Kamba 377fba47e2 CMake: Add support for KVstore Greentea tests
The KVstore Greentea tests can now be built with CMake
2020-12-24 14:16:07 +00:00
Hugues Kamba 69b4c13761 CMake: Add Blockdevice dependency to KVstore library
As KVstore relies on BlockDevice add the dependency
in Mbed OS so applications do not have to specify it
2020-12-21 13:57:52 +00:00
Hugues Kamba eedd0b3258 CMake: streamline kvstore support
Link KVStore dependency in Mbed OS so application projects do not have to.
2020-12-17 13:09:38 +00:00
Matthew Macovsky 8c60ce3e32 Create non-public target for Cypress boards with externally-stored WiFi firmware
Targets that inherit from this target will have the defines necessary to
place the WiFi firmware in external storage and enable use of the
external WiFi firmware reserved region block device.
Currently, the only target inheriting from this new target is
CY8CPROTO-062S3-4343W.
2020-12-16 15:31:05 -08:00
Lingkai Dong bfbc18860b KVStore general_tests_phase_1/2: flash simulation no longer required 2020-12-11 14:56:40 +00:00
Lingkai Dong 2064adee7c TDBStore Doxygen: flash characteristics no longer required 2020-12-11 14:56:39 +00:00
Lingkai Dong cfedf1b027 TDBStore whitebox test: flash simulation no longer required 2020-12-11 14:56:39 +00:00
Lingkai Dong 2d8a566718 SecureStore whitebox test: flash simulation no longer required 2020-12-11 14:56:39 +00:00
Lingkai Dong 15e582fc27 TDBStore unit test: flash simulation no longer required 2020-12-11 14:56:36 +00:00
Lingkai Dong 3786d3958d kv_config: TDBStore doesn't require flash simulation anymore 2020-12-11 14:55:16 +00:00
Lingkai Dong 479b704542 "kvstore_global_api" requires "kvstore" for backward compatibility
PR #13908 replaces the umbrella library for all KVStore from
"kvstore_global_api" to "kvstore". Now "kvstore_global_api"
still exists but is restricted to the global API part only.

By adding "kvstore" as a dependency of "kvstore_global_api",
existing bare metal projects (e.g. mbed-bootloader) that use
the latter library name to pull in the KVStore prototype class
will continue to work.
2020-12-09 17:26:32 +00:00
Lingkai Dong 170c07ccdf KVStore: drop './' from CMake paths 2020-12-09 17:26:32 +00:00
Lingkai Dong 34bbcbff92 Fix astyle in KVStore unit tests 2020-12-09 17:26:32 +00:00
Lingkai Dong 0c33db04d5 KVStore: componentize CMake definitions into sub-components 2020-12-09 17:20:43 +00:00
Lingkai Dong 26acbd141a Relocate kvstore Greentea tests into each store type's path 2020-12-09 17:20:43 +00:00
Lingkai Dong 8c1dd01066 Relocate kvstore unit tests into each store type's path 2020-12-09 17:20:42 +00:00
Lingkai Dong b3c13bbea9 Update UNITTEST for kvstore 2020-12-09 17:20:42 +00:00
Lingkai Dong 8ba64c4139 Update include paths 2020-12-09 17:20:42 +00:00
Lingkai Dong e27a6e0fa6 Create a kvstore_global_api for the global API and KVMap 2020-12-09 17:20:42 +00:00
Lingkai Dong c2d6e9146c Turn TDBStore and FileSystemStore into standalone libraries 2020-12-09 17:20:42 +00:00
Lingkai Dong a4907e89df Bring in TDBStore UNITTESTS improvements from PR #13731
Co-authored-by: Seppo Takalo <seppo.takalo@arm.com>
2020-12-02 14:57:43 +00:00
Lingkai Dong fd5b2c569d Avoid force-casting inputs when calling std::min() 2020-12-02 14:57:43 +00:00
Lingkai Dong cf977b7aae TDBStore: the work buffer is at least the program size or 64 bytes
Previously, we always set the work buffer to 64 bytes, without
checking it was no less the actual program size. But we can't
simply switch to use the program size for the work buffer,
because if it's too small (e.g. 1 byte in some cases), we
will not be able to read the status header (24 bytes), and
small buffers means more underlying write operations and
lower efficiency.

This PR changes the work buffer size to be the program size,
or 64 bytes as an absolute minimum like before.
2020-12-02 14:57:43 +00:00
Lingkai Dong ece756c0c4 TDBStore: pad record header to whole program size before storing it
Previously, when writing a record header into a TDBStore, we
took the pointer to the record_header_t variable as the input,
but used a program-aligned chunk size which is larger.
As a result, garbage from the stack memory gets written.

This commit fixes that by buffering the record header.

Co-authored-by: Seppo Takalo <seppo.takalo@arm.com>
2020-12-02 14:57:22 +00:00
Lingkai Dong 13c5b64e16 general_tests_phase_2: SecureStore's underlying TDBStore must be large enough
The test case set_add_data_set_key_value_five_Kbytes stores
5KB of value, and to allow for overheads, we allocate at least
8KB per area of TDBStore (so 16KB for two areas of a whole
TDBStore).
2020-11-12 16:46:03 +00:00
Hugues Kamba bf84a5b329 CMake: Rename CMake targets
* mbed-os renamed mbed-core
* mbed-os-<COMPONENT> renamed mbed-<COMPONENT>
2020-11-06 17:25:22 +00:00
Hugues Kamba fa98689639 CMake: Componentize Mbed OS into multiple CMake targets (#13732)
Aside from the core mbed-os CMake target, a number of targets have been created so they can optionally be included by application executables that require them using `target_link_libraries()`.

Co-authored-by: Martin Kojtal <martin.kojtal@arm.com>
Co-authored-by: Rajkumar Kanagaraj <rajkumar.kanagaraj@arm.com>
2020-11-06 17:25:21 +00:00
Hugues Kamba bd45acba8c CMake: Fix failure due to kvstore and cellular dirs changes 2020-11-06 17:25:16 +00:00
Hugues Kamba a08be8c8a0 CMake: Add support for storage dir 2020-11-06 17:25:15 +00:00
Martin Kojtal 21652971a5
Merge pull request #12644 from macronix/macronix_ospi
Add OSPI driver to support the Octa mode of Macronix octaflash MX25LM51245G
2020-09-30 16:07:20 +01:00
Martin Kojtal 33a538ab6c
Merge pull request #13593 from LDong-Arm/platform_storage_default_requirements
STM32F: skip LittleFileSystem default instance and TDBStore tests
2020-09-17 15:21:40 +01:00
rogeryou 48524f25ae add opsi driver 2020-09-16 11:27:23 +08:00
Lingkai Dong 8910ec6db2 kvstore general_tests_phase_1/2 tests: Skip TDBStore if FlashIAP sector size is non-uniform
By default TDBStore requires blocks to have the same size.
2020-09-11 10:12:58 +01:00
Martin Kojtal 6bfd89e656
Merge pull request #13196 from gbrtth/musca_s1_support_mbed6
Add ARM_MUSCA_S1 as a new target platform
2020-09-10 16:53:14 +01:00
Gabor Toth bdf2306f16 Add platform support to Musca S1
Change-Id: Iebdd4bc402446caba6b7bd894eddb0a85ed884d8
Signed-off-by: Mark Horvath <mark.horvath@arm.com>
Signed-off-by: Gabor Toth <gabor.toth@arm.com>
2020-09-10 14:53:41 +02:00