test: Use arguments to determine which rollback region to test
BRANCH=none BUG=b:155229277, b:151105339 TEST=With dragonclaw v0.2 connected to Segger J-Trace and servo micro: ./test/run_device_tests.py -t rollback_region0 rollback_region1 => PASS Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ibb0512d9ea3fa84334b5ba080243f6eef7031c4d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2231724 Commit-Queue: Craig Hesling <hesling@chromium.org> Reviewed-by: Craig Hesling <hesling@chromium.org>
This commit is contained in:
parent
64ec4195a9
commit
ac4562e9be
|
@ -6,6 +6,7 @@
|
|||
#include <stdbool.h>
|
||||
#include "flash.h"
|
||||
#include "mpu.h"
|
||||
#include "string.h"
|
||||
#include "test_util.h"
|
||||
|
||||
struct rollback_info {
|
||||
|
@ -93,32 +94,33 @@ test_static int _test_lock_rollback(const struct rollback_info *info,
|
|||
|
||||
test_static int test_lock_rollback_region_0(void)
|
||||
{
|
||||
/* This call should never return due to panic. */
|
||||
return _test_lock_rollback(&rollback_info, 0);
|
||||
}
|
||||
|
||||
test_static int test_lock_rollback_region_1(void)
|
||||
{
|
||||
/* This call should never return due to panic. */
|
||||
return _test_lock_rollback(&rollback_info, 1);
|
||||
}
|
||||
|
||||
test_static int test_lock_rollback(void)
|
||||
{
|
||||
/* This call should never return due to panic.
|
||||
* TODO(b/156112448): For now you have to manually test each region
|
||||
* by itself.
|
||||
*/
|
||||
test_lock_rollback_region_0();
|
||||
|
||||
#if 0
|
||||
test_lock_rollback_region_1();
|
||||
#endif
|
||||
|
||||
return EC_ERROR_UNKNOWN;
|
||||
}
|
||||
|
||||
void run_test(int argc, char **argv)
|
||||
{
|
||||
if (argc < 2) {
|
||||
ccprintf("usage: runtest [region0|region1]\n");
|
||||
return;
|
||||
}
|
||||
|
||||
ccprintf("Running rollback test\n");
|
||||
RUN_TEST(test_lock_rollback);
|
||||
|
||||
/*
|
||||
* TODO(b/156112448): For now you have to run the test separately for
|
||||
* each region.
|
||||
*/
|
||||
if (strncmp(argv[1], "region0", 7) == 0)
|
||||
RUN_TEST(test_lock_rollback_region_0);
|
||||
else if (strncmp(argv[1], "region1", 7) == 0)
|
||||
RUN_TEST(test_lock_rollback_region_1);
|
||||
|
||||
test_print_result();
|
||||
}
|
||||
|
|
|
@ -36,6 +36,8 @@ SINGLE_CHECK_FAILED_REGEX = re.compile(r'.*failed:.*')
|
|||
|
||||
DATA_ACCESS_VIOLATION_8020000_REGEX = re.compile(
|
||||
r'Data access violation, mfar = 8020000\r\n')
|
||||
DATA_ACCESS_VIOLATION_8040000_REGEX = re.compile(
|
||||
r'Data access violation, mfar = 8040000\r\n')
|
||||
DATA_ACCESS_VIOLATION_20000000_REGEX = re.compile(
|
||||
r'Data access violation, mfar = 20000000\r\n')
|
||||
|
||||
|
@ -98,9 +100,14 @@ ALL_TESTS = {
|
|||
TestConfig(name='mutex'),
|
||||
'pingpong':
|
||||
TestConfig(name='pingpong'),
|
||||
'rollback':
|
||||
'rollback_region0':
|
||||
TestConfig(name='rollback', finish_regexes=[
|
||||
DATA_ACCESS_VIOLATION_8020000_REGEX]),
|
||||
DATA_ACCESS_VIOLATION_8020000_REGEX],
|
||||
test_args=['region0']),
|
||||
'rollback_region1':
|
||||
TestConfig(name='rollback', finish_regexes=[
|
||||
DATA_ACCESS_VIOLATION_8040000_REGEX],
|
||||
test_args=['region1']),
|
||||
'rollback_entropy':
|
||||
TestConfig(name='rollback_entropy', image_to_use=ImageType.RO),
|
||||
'rtc':
|
||||
|
|
Loading…
Reference in New Issue