blob: 2f0a800152e3301c0d6885f8d6322e37eb148daa [file] [log] [blame]
Gabor Toth6df91b52023-05-15 14:17:16 +02001/*
2 * Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include "../psa_api_test_common.h"
Gabor Tothee2e7cb2024-10-07 17:02:56 +02008#include "libpsats.h"
Gabor Toth6df91b52023-05-15 14:17:16 +02009#include "trace.h"
10
11psa_status_t test_setup(const char *service_name_crypto, const char *service_name_iat,
12 const char *service_name_ps, const char *service_name_its)
13{
14 psa_status_t psa_status = PSA_ERROR_GENERIC_ERROR;
15
16 if (!service_name_ps)
17 service_name_ps = "sn:trustedfirmware.org:protected-storage:0";
18
Gabor Tothee2e7cb2024-10-07 17:02:56 +020019 psa_status = libpsats_init_ps_context(service_name_ps);
Gabor Toth6df91b52023-05-15 14:17:16 +020020 if (psa_status) {
Gabor Tothee2e7cb2024-10-07 17:02:56 +020021 EMSG("libpsats_init_ps_context failed: %d\n", psa_status);
Gabor Toth6df91b52023-05-15 14:17:16 +020022 return psa_status;
23 }
24
25 return psa_status;
26}
27
28void test_teardown(void)
29{
Gabor Tothee2e7cb2024-10-07 17:02:56 +020030 libpsats_deinit_ps_context();
Gabor Toth6df91b52023-05-15 14:17:16 +020031}