summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Massey <aaronmassey@google.com>2022-09-30 14:49:07 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-09-30 22:35:42 +0000
commite0f2f0c0b00c7ae3dc6412a05ecceff47205e669 (patch)
tree1a13ba2734523a372f55e02c25ff32a0e23c0d86
parentec7d5de5856ed6189f5f7e1fd13abb97ebf1716c (diff)
downloadchrome-ec-e0f2f0c0b00c7ae3dc6412a05ecceff47205e669.tar.gz
test: shim/system.c chip_save/read_reset_flags()
Verify that chip_save_reset_flags() saves some arbitrary flags and that chip_read_reset_flags() can then subsequently read the saved flags. BRANCH=none BUG=b:236074898 TEST=twister --clobber -i -s zephyr/test/system_shim/system_shim.default TEST=twister --clobber -i -t system Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I9bfe83afb6feb7ff1ab0cccfc5552321d8e72493 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3931170 Reviewed-by: Sam Hurst <shurst@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
-rw-r--r--zephyr/test/system_shim/test_system.c9
-rw-r--r--zephyr/test/system_shim/testcase.yaml4
2 files changed, 12 insertions, 1 deletions
diff --git a/zephyr/test/system_shim/test_system.c b/zephyr/test/system_shim/test_system.c
index d8b92e9504..a8a45b2223 100644
--- a/zephyr/test/system_shim/test_system.c
+++ b/zephyr/test/system_shim/test_system.c
@@ -54,3 +54,12 @@ ZTEST(system, test_bbram_get)
zassert_mem_equal(output, mock_data + BBRAM_REGION_OFF(try_slot),
BBRAM_REGION_SIZE(try_slot), NULL);
}
+
+ZTEST(system, test_save_read_chip_reset_flags)
+{
+ uint32_t arbitrary_flags = 0x1234;
+
+ chip_save_reset_flags(0);
+ chip_save_reset_flags(arbitrary_flags);
+ zassert_equal(chip_read_reset_flags(), arbitrary_flags);
+}
diff --git a/zephyr/test/system_shim/testcase.yaml b/zephyr/test/system_shim/testcase.yaml
index 85df1de33a..1dfdd982be 100644
--- a/zephyr/test/system_shim/testcase.yaml
+++ b/zephyr/test/system_shim/testcase.yaml
@@ -1,4 +1,6 @@
common:
platform_allow: native_posix
tests:
- system_shim.default: {}
+ system_shim.default:
+ tags:
+ system