Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions loadable_apps/loadable_sample/wifiapp/binary_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,31 @@ void binary_update_test(void)
{
binary_update_execute_ntimes(1);
}

/****************************************************************************
* binary_update_test_with_type
****************************************************************************/
void binary_update_test_with_type(const char *test_type)
{
if (test_type == NULL) {
/* Default: run all tests */
binary_update_run_tests();
return;
}

if (strcmp(test_type, "same_version") == 0) {
binary_update_same_version_test(APP1_NAME);
} else if (strcmp(test_type, "new_version") == 0) {
binary_update_new_version_test(APP1_NAME);
} else if (strcmp(test_type, "invalid_binary") == 0) {
binary_update_invalid_binary_test(APP1_NAME);
} else if (strcmp(test_type, "all_tests") == 0) {
binary_update_run_tests();
} else {
printf("Unknown test type: %s\n", test_type);
printf("Available test types: same_version, new_version, invalid_binary, all_tests\n");
}
}
#endif

#ifdef CONFIG_EXAMPLES_UPDATE_AGING_TEST
Expand Down
19 changes: 17 additions & 2 deletions loadable_apps/loadable_sample/wifiapp/wifiapp.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ static void display_test_scenario(void)
printf("\t-Press R or r : Recovery Test\n");
#endif
#ifdef CONFIG_EXAMPLES_BINARY_UPDATE_TEST
printf("\t-Press U or u : Binary Update Test\n");
printf("\t-Press U or u : Binary Update Test (All Tests)\n");
printf("\t-Press S or s : Same Version Test\n");
printf("\t-Press N or n : New Version Test\n");
printf("\t-Press I or i : Invalid Binary Test\n");
#endif
printf("\t-Press X or x : Terminate Tests.\n");
}
Expand Down Expand Up @@ -103,7 +106,19 @@ int wifiapp_main(int argc, char **argv)
#ifdef CONFIG_EXAMPLES_BINARY_UPDATE_TEST
case 'U':
case 'u':
binary_update_test();
binary_update_test_with_type("all_tests");
break;
case 'S':
case 's':
binary_update_test_with_type("same_version");
break;
case 'N':
case 'n':
binary_update_test_with_type("new_version");
break;
case 'I':
case 'i':
binary_update_test_with_type("invalid_binary");
break;
#endif
case 'X':
Expand Down