Skip to content

Latest commit

 

History

History
40 lines (33 loc) · 23.2 KB

psa_storage_testlist.md

File metadata and controls

40 lines (33 loc) · 23.2 KB

PSA Storage (Internal Trusted Storage and Protected Storage) Testcase checklist

Requirements for Storage Test Suite

Following are the requirements of the Storage Test Suite.

  1. Unless described in this document, any behaviour that is defined as IMPLEMENTATION_DEFINED in PSA Storage API document is not verified in this document.
  2. Storage Test Cases use UID value starting from 1 onwards. These UID needs to be free for successfull test execution.
  3. UID values 1 and 2 are reserved as WRITE_ONCE UID. These UID can't be free from testcase. Make sure these are free.
Test Test Scenario API Verified Return Value Test Algorithm UID Usage
test_s001 get_info and remove API's call for
non-existent and removed assest
psa_its(ps)_get
psa_its(ps)_get_info
psa_its(ps)_remove
PSA_ERROR_DOES_NOT_EXIST 1. Call get API with UID for which no UID/Data pair is created
2. Call get_info API for which no UID/Data pair is created
3. Call remove API for which no UID/Data pair is created
4. Set valid UID/Data pair with uid1
5. Set one more set of UID/Data pair, with different uid, than previous
6. Remove the uid of step 4.
7. Call get API for removed UID/data pair
8. Call get_info API for removed UID/Data pair
9. Call remove API for removed UID/Data pair
10. Set valid UID/Data pair
11. Call get API for different uid , then created
12. Call get_info API for different uid, then created
13. Call remove API for different uid, then created
14. Remove the created UID/Data pair.
15. Remove the stray uid.
UID value used are 5,6,7
test_s002 Overwriting data for asset created with
WRITE_ONCE flag
psa_its(ps)_set
psa_its(ps)_remove
PSA_ERROR_NOT_PERMITTED 1. Set valid UID/data value pair , with create flag value none.
2. Call get and get_info API to validate the data, attributes associated with data
3. Call set API again with same uid and create flag PSA_STORAGE_WRITE_ONCE_FLAG
4. Call get and get_info API to validate the data, attributes associated with data
is not changed after second set operation
5. try to remove the UID/data pair.
6. Create new UID/data value pair, with create flag PSA_STORAGE_WRITE_ONCE_FLAG
7. Try to remove the created UID.
8. Call get and get_info API to validate the data, attributes associated with data
9. Again call SET with same UID , create flag PSA_STORAGE_WRITE_ONCE_FLAG but
different data length
10. Try to remove the UID, PSA_ERROR_NOT_PERMITTED error should be returned
11. Call get and get_info API to validate the data, attributes associated with data
UID value used are 1 and 2
test_s003 Exhaust storage space psa_its(ps)_set
PSA_ERROR_INSUFFICIENT_STORAGE 1. Create UID/data pairs, with data_len of ARCH_TEST_STORAGE_UID_MAX_SIZE bytes. Do this with incrementing
uid values till we have INSUFFICENT_SPACE.
2. Remove all the UID/data pairs created.
3. Repeat the steps once more, to check all previous uid are removed successfully
UID value starts from 5 and keep on incrementing till all space is exhausted
test_s004 Overwriting data for asset created without WRITE_ONCE flag psa_its(ps)_set
psa_its(ps)_get
psa_its(ps)_get_info
psa_its(ps)_remove
PSA_SUCCESS 1. Set a valid uid/data pair
2. Validate the data using get api
3. Change the data length to half of previous.
4. Call GET api with original data length , expect the success result and the read buffer to match for half of original length
5. Call REMOVE api to delete the UID/data pair
UID value used is 5
test_s005 Get, get_info and remove API call for valid assest psa_its(ps)_set
psa_its(ps)_get
psa_its(ps)_get_info
psa_its(ps)_remove
PSA_SUCCESS 1. Set valid UID/data pair with varying uid and data_len
2. Call GET api and validate the set data
3. Call GET info api and validate the data attributes
4. Call REMOVE api to delete the UID/data pair
UID value used are 4
test_s006 Storage asset creation with supported create flag values psa_its(ps)_set
PSA_ERROR_NOT_SUPPORTED 1. Call the SET API with available create flag values
2. Call GET_INFO api and validate the flag value
3. Remove the uid/data pair
UID value used is 5
test_s007 Get API call with length different than asset
data length
psa_its(ps)_set
psa_its(ps)_get
PSA_SUCCESS 1. Create valid uid/data pair.
2. Increase the length of storage.
3. Try to access the old length using get api.
4. Try to access with valid length less than stored size.
5. Decrease the length of storage.
6. Try to access the old length.
7. Remove the uid
UID value used is 5
test_s008 Get API call with invalid offset psa_its(ps)_get
PSA_ERROR_INVALID_ARGUMENT 1. Set valid UID/data pair
2. Call GET api with valid offset and offset + data_len equal to stored data size.
3. Call GET api with valid offset and offset + data_len less than stored data size.
4. Call get api with invalid offset.
5. Call get api with zero offset , but data len greater than data size.
6. Remove the uid.
UID value used is 5
test_s009 API call with NULL pointer and zero length psa_its(ps)_get
psa_its(ps)_set
psa_its(ps)_get_info
PSA_ERROR_DOES_NOT_EXIST 1. Call the SET API with NULL pointer and data_len zero
2. Validate using get_info api storage should be present.
3. Call get API with NULL pointer.
4. Remove the UID.
5. Call get_info API to validate storage is removed.
6. Set storage entity with valid write_buffer , but length zero.
7. Call get_info API to validate storage attributes.
8. Call get_info api with NULL pointer and valid uid.
9. Remove the uid
UID value used is 5
test_s010 Storage assest creation with UID value 0 psa_its(ps)_set
PSA_ERROR_INVALID_ARGUMENT 1. Call the SET API with UID value 0.
2. Check that storage creation fails.
UID value used is 0
NA Storage Failure NA PSA_ERROR_STORAGE_FAILURE 1. The failure cause will depend on the underlying
platform and vary for each implementation.
It is skipped in current suite
NA
test_s011 Set_extended API's call for
non-existent and removed assest
psa_ps_set_extended
PSA_ERROR_DOES_NOT_EXIST Below Steps will be run only if optional API are not supported.
1. Call the SET Extended API when no uid present.
2. Create a valid storage using set.
3. Call create api with different length for existing uid.
4. Call create api to set WRITE_ONCE flag.
5. Validate data attributes are maintained.
6. Remove the uid.
7. Create valid storage using create api.
8. Try to change length using create api.
9. Validate storage is empty.
10. Again call create api with original parameters.
11. Remove the uid.
12. Check no duplicate entry present.
UID value used is 5
test_s012 Set_extended API's call
with invalid offset
psa_ps_set_extended
PSA_ERROR_INVALID_ARGUMENT Below Steps will be run only if optional API are not supported.
1. Create a valid storage using create.
2. Set data on first half of buffer.
3. Try to set data at incorrect offset +length.
4. Try to set data at incorrect offset.
5. Try to set at correct offset but zero length buffer.
6. Try to set data at incorrect length and valid offset.
7. Overwrite the storage using set api.
8. Validate data is correctly written.
10. Remove the uid.
UID value used is 6
test_s013 Create and set_extended API call for valid assest psa_ps_set_extended
psa_ps_create
PSA_SUCCESS Below Steps will be run only if optional API are not supported.
1. Create Storage of zero length using create.
2. Try to set some data in the storage created.
3. Validate the storage attributes.
4. Remove the storage.
5. Create a valid storage with non-zero length.
6. Set data in the buffer.
7. Validate the data attributes.
8. Overwrite data using set api.
9. Validate the data.
10. Call create api for existing uid with same parameters.
11. Remove the uid.
12. Check with set_extended no duplicate uid exists.
UID value used is 4
test_s014 Create and set_extended API call
when API's not supported
psa_ps_create
psa_ps_set_extended
PSA_ERROR_NOT_SUPPORTED Below Steps will be run only if optional API are not supported.
1. Create API call should fail.
2. Check the UID should not exist.
3. Create storage using set API.
4. Try to partially write using set_extended API.
5. Validate data is not modified.
6. Remove the uid.
UID value used is 5
test_s015 Create API call with
WRITE_ONCE flag
psa_ps_create
PSA_ERROR_NOT_SUPPORTED Below Step will be run only if optional API are supported.
1. Create API call with WRITE_ONCE flag should fail.
UID value used is 5
test_s016 Create API call for capacity check psa_ps_create
psa_ps_set
psa_ps_get_info
psa_ps_set_extended
psa_ps_remove
PSA_ERROR_ALREADY_EXISTS
PSA_ERROR_STORAGE_FAILURE
Below Steps will be run only if optional API are supported.
1. Create storage with valid UID and capacity using create
2. Check create for existing UID fails
3. Check the attributes of storage are unchanged
4. Override the storage using SET API
5. Check the attributes of storage are changed
6. Accessing old capacity with set_extended API fails
7. Remove the storage
8. Create new storage with valid UID/data pair using set API
9. Check create API for existing UID fails
10. Remove the storage
UID value used is 5
test_s017 Partial write check with set extended API psa_ps_create
psa_ps_set_extended
psa_ps_get_info
psa_ps_remove
PSA_ERROR_STORAGE_FAILURE Below Steps will be run only if optional API are supported.
1. Create storage with valid UID and capacity using create
2. Set partial data using set extended API
3. Check set extended API fails for data with gaps
4. Set full length data using set extended API
5. Check the valid attributes of storage
6. Remove the storage
UID value used is 5
NA Fatal error
NA PSA_ERROR_STORAGE_FAILURE 1. The failure cause will depend on the underlying
platform and vary for each implementation.
It is skipped in current suite
NA
NA Data Corruption
NA PSA_ERROR_DATA_CORRUPT 1. The failure cause will depend on the underlying
platform and vary for each implementation.
It is skipped in current suite
NA
NA Invalid Signature
NA PSA_ERROR_INVALID_SIGNATURE 1. The failure cause will depend on the underlying
platform and vary for each implementation.
It is skipped in current suite
NA

License

Arm PSA test suite is distributed under Apache v2.0 License.


Copyright (c) 2019-2021, Arm Limited and Contributors. All rights reserved.