Mistake on this page?
Report an issue in GitHub or email us
test_s002/test_its_data.h
Go to the documentation of this file.
1 /** @file
2  * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
3  * SPDX-License-Identifier : Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16 **/
17 #ifndef _TEST_S002_ITS_DATA_TESTS_H_
18 #define _TEST_S002_ITS_DATA_TESTS_H_
19 
21 
22 #define SST_FUNCTION val->its_function
23 #define PSA_SST_FLAG_WRITE_ONCE PSA_ITS_FLAG_WRITE_ONCE
24 #define psa_sst_uid_t psa_its_uid_t
25 
26 typedef struct {
27  enum its_function_code api;
28  psa_its_status_t status;
29 } test_data;
30 
31 static struct psa_its_info_t orig_info;
32 static struct psa_its_info_t new_info;
33 static const test_data s002_data[] = {
34 {
35  0, 0 /* This is dummy for index0 */
36 },
37 {
38  VAL_ITS_SET, PSA_ITS_SUCCESS /* Create a valid storage with create flag value 0 */
39 },
40 {
41  VAL_ITS_GET_INFO, PSA_ITS_SUCCESS /* Call the get_info API to validate the attributes */
42 },
43 {
44  0, 0 /* Index not used as check for get info size */
45 },
46 {
47  0, 0 /* Index not used as check for get info flag */
48 },
49 {
50  VAL_ITS_GET, PSA_ITS_SUCCESS /* Validate the data using get API */
51 },
52 {
53  0, 0 /* Index not used */
54 },
55 {
56  VAL_ITS_SET, PSA_ITS_SUCCESS /* Change the flag to WRITE_ONCE using set API */
57 },
58 {
59  VAL_ITS_GET_INFO, PSA_ITS_SUCCESS /* Call the get_info API to validate the flag change */
60 },
61 {
62  0, 0 /* Index not used as check for get info size */
63 },
64 {
65  0, 0 /* Index not used as check for get info flag */
66 },
67 {
68  VAL_ITS_GET, PSA_ITS_SUCCESS /* Validate the data using get API after flag change */
69 },
70 {
71  0, 0 /* Index not used */
72 },
73 {
74  VAL_ITS_REMOVE, PSA_ITS_ERROR_WRITE_ONCE /* Storage should not be removed after WRITE_ONCE flag */
75 },
76 {
77  VAL_ITS_SET, PSA_ITS_SUCCESS /* Create a storage with different UID and flag value WRITE_ONCE */
78 },
79 {
80  VAL_ITS_REMOVE, PSA_ITS_ERROR_WRITE_ONCE /* Storage should not be removed */
81 },
82 {
83  VAL_ITS_GET, PSA_ITS_SUCCESS /* Validate the data using get API after flag change */
84 },
85 {
86  0, 0 /* Index not used */
87 },
88 {
89  VAL_ITS_GET_INFO, PSA_ITS_SUCCESS /* Call the get_info API to validate the flag change */
90 },
91 {
92  0, 0 /* Index not used as check for get info size */
93 },
94 {
95  0, 0 /* Index not used as check for get info flag */
96 },
97 {
98  VAL_ITS_SET, PSA_ITS_ERROR_WRITE_ONCE /* Try to set different size for same UID and flag value */
99 },
100 {
101  VAL_ITS_REMOVE, PSA_ITS_ERROR_WRITE_ONCE /* Storage should not be removed */
102 },
103 {
104  VAL_ITS_GET_INFO, PSA_ITS_SUCCESS /* Call the get_info API to validate the flag change */
105 },
106 {
107  0, 0 /* Index not used as check for get info size */
108 },
109 {
110  0, 0 /* Index not used as check for get info flag */
111 },
112 {
113  VAL_ITS_GET, PSA_ITS_SUCCESS /* Validate the data using get API after flag change */
114 },
115 {
116  0, 0 /* Index not used */
117 },
118 {
119  VAL_ITS_SET, PSA_ITS_ERROR_WRITE_ONCE /* Setting flag to zero for UID should fail */
120 },
121 {
122  VAL_ITS_REMOVE, PSA_ITS_ERROR_WRITE_ONCE /* Storage should not be removed */
123 },
124 {
125  VAL_ITS_GET_INFO, PSA_ITS_SUCCESS /* Check that the WRITE_ONCE flag is preserved */
126 },
127 {
128  0, 0 /* Index not used as check for get info size */
129 },
130 {
131  0, 0 /* Index not used as check for get info flag */
132 },
133 };
134 #endif /* _TEST_S002_ITS_DATA_TESTS_H_ */
Copyright (c) 2019, Arm Limited or its affiliates.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.