xtest: add --clear-storage option
When unexpected errors occur in the secure storage tests
(regression_6xxx) some persistent objects might be left over, causing
errors in further tests which expect to start from a clean state.
This situation cannot be addressed fully by error handling in xtest or
in the storage TA, because there are unrecoverable conditions (data
abort, kill -9...). Instead, implement a new --clear-storage option
which invokes the storage TA to enumerate and delete any objects it may
own. The TA is invoked twice (because the same code is exposed via two
UUIDS), and each invocation iterates on the two possible filesystems
(TEE_STORAGE_PRIVATE_REE, TEE_STORAGE_PRIVATE_RPMB).
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
diff --git a/ta/include/ta_storage.h b/ta/include/ta_storage.h
index 96bc560..f494f5c 100644
--- a/ta/include/ta_storage.h
+++ b/ta/include/ta_storage.h
@@ -50,5 +50,6 @@
#define TA_STORAGE_CMD_CREATE_ID_IN_SHM 23
#define TA_STORAGE_CMD_CREATEOVER_ID_IN_SHM 24
#define TA_STORAGE_CMD_RENAME_ID_IN_SHM 25
+#define TA_STORAGE_CMD_CLEAR_STORAGE 26
#endif /*__TA_STORAGE_H*/