Skip to content

Commit 1838512

Browse files
57300cfriedt
authored andcommitted
tests: zms: Minor improvements
* Explicitly skip tests that depend on CONFIG_ZMS_LOOKUP_CACHE. * In `testcase.yaml`, use `extra_configs` instead of `extra_args` for setting Kconfigs. Signed-off-by: Grzegorz Swiderski <[email protected]>
1 parent 620bf58 commit 1838512

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

tests/subsys/fs/zms/src/main.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,8 @@ ZTEST_F(zms, test_zms_cache_init)
752752

753753
num = num_matching_cache_entries(ate_addr, false, &fixture->fs);
754754
zassert_equal(num, 1, "invalid cache entry after restart");
755+
#else
756+
ztest_test_skip();
755757
#endif
756758
}
757759

@@ -790,6 +792,8 @@ ZTEST_F(zms, test_zms_cache_collision)
790792
err = zms_read(&fixture->fs, id, &data, sizeof(data));
791793
zassert_equal(-ENOENT, err, "zms_delete failed: %d", err);
792794
}
795+
#else
796+
ztest_test_skip();
793797
#endif
794798
}
795799

@@ -839,6 +843,8 @@ ZTEST_F(zms, test_zms_cache_gc)
839843

840844
num = num_matching_cache_entries(2ULL << ADDR_SECT_SHIFT, true, &fixture->fs);
841845
zassert_equal(num, 2, "invalid cache content after gc");
846+
#else
847+
ztest_test_skip();
842848
#endif
843849
}
844850

@@ -896,7 +902,8 @@ ZTEST_F(zms, test_zms_cache_hash_quality)
896902
TC_PRINT("Cache occupancy: %u\n", (unsigned int)num);
897903
zassert_between_inclusive(num, MIN_CACHE_OCCUPANCY, CONFIG_ZMS_LOOKUP_CACHE_SIZE,
898904
"too low cache occupancy - poor hash quality");
899-
905+
#else
906+
ztest_test_skip();
900907
#endif
901908
}
902909

tests/subsys/fs/zms/testcase.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,33 @@ tests:
88
extra_args: DTC_OVERLAY_FILE=boards/qemu_x86_ev_0x00.overlay
99
platform_allow: qemu_x86
1010
filesystem.zms.sim.no_erase:
11-
extra_args: CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE=n
11+
extra_configs:
12+
- CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE=n
1213
platform_allow: qemu_x86
1314
filesystem.zms.sim.corrupt_close:
14-
extra_args:
15+
extra_configs:
1516
- CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE=y
1617
- CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y
1718
platform_allow: qemu_x86
1819
filesystem.zms.cache:
19-
extra_args:
20+
extra_configs:
2021
- CONFIG_ZMS_LOOKUP_CACHE=y
2122
- CONFIG_ZMS_LOOKUP_CACHE_SIZE=64
2223
platform_allow: native_sim
2324
filesystem.zms.data_crc:
24-
extra_args:
25+
extra_configs:
2526
- CONFIG_ZMS_DATA_CRC=y
2627
platform_allow:
2728
- native_sim
2829
- qemu_x86
2930
filesystem.zms.no_double_write:
30-
extra_args:
31+
extra_configs:
3132
- CONFIG_ZMS_NO_DOUBLE_WRITE=y
3233
platform_allow:
3334
- native_sim
3435
- qemu_x86
3536
filesystem.zms.no_double_write_cache:
36-
extra_args:
37+
extra_configs:
3738
- CONFIG_ZMS_NO_DOUBLE_WRITE=y
3839
- CONFIG_ZMS_LOOKUP_CACHE=y
3940
- CONFIG_ZMS_LOOKUP_CACHE_SIZE=64

0 commit comments

Comments
 (0)