Skip to content

Commit 8ea7ae7

Browse files
committed
Merge branch 'fix/nvs_generator_test_fail_due_to_safer_write_namespace_function_v5.4' into 'release/v5.4'
fix(nvs): Fix the NVS generator test (write_namespace safer behavior change) (v5.4) See merge request espressif/esp-idf!34857
2 parents 2900301 + 67ab814 commit 8ea7ae7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

components/nvs_flash/nvs_partition_tool/test_nvs_gen_check.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,20 @@ def setup_bad_mixed_same_key_different_page(nvs_obj: NVS) -> None:
201201
data_type = prim_types[i % len(prim_types)]
202202
nvs_partition_gen.write_entry(nvs_obj, f'test_{i}', 'data', data_type, str(i)) # Conflicting keys under "abcd" namespace - 6 duplicates
203203
nvs_partition_gen.write_entry(nvs_obj, 'lorem_string_key', 'data', 'string', 'abc') # Conflicting key for string - 7th duplicate
204-
nvs_partition_gen.write_entry(nvs_obj, 'storage', 'namespace', '', '') # Conflicting namespace - 8th duplicate
204+
205+
# Create new duplicates of storage namespace with an unsafe version of write_namespace function
206+
nvs_obj.write_namespace_unsafe('storage') # Conflicting namespace - 8th duplicate (the function is only for testing)
207+
205208
nvs_partition_gen.write_entry(nvs_obj, 'storage2', 'namespace', '', '') # New namespace, ignored
206209
nvs_partition_gen.write_entry(nvs_obj, 'lorem_string_key', 'data', 'string', 'abc') # Should be ignored as is under different "storage2" namespace
207210
nvs_partition_gen.write_entry(nvs_obj, 'lorem_string', 'data', 'string', 'abc') # 3 conflicting keys under "storage2" namespace - 9th duplicate
208211
nvs_partition_gen.write_entry(nvs_obj, 'lorem_string', 'data', 'string', 'def')
209212
nvs_partition_gen.write_entry(nvs_obj, 'lorem_string', 'data', 'string', '123')
210213

214+
# This no longer (nvs generator version >= 0.1.5) creates a duplicate namespace entry, only changes
215+
# the current used namespace index
216+
nvs_partition_gen.write_entry(nvs_obj, 'storage', 'namespace', '', '')
217+
211218

212219
def setup_bad_same_key_primitive(nvs_obj: NVS) -> None:
213220
nvs_partition_gen.write_entry(nvs_obj, 'storage', 'namespace', '', '')

0 commit comments

Comments
 (0)