blob: 04b3b5e41ef3d2f835970605b889112fc67d8052 [file] [log] [blame]
Igor Opaniukb87e16c2024-04-04 15:19:50 +02001# SPDX-License-Identifier: GPL-2.0+
2#
3# Tests for OP-TEE RPMB read/write support
4
5"""
6This tests optee_rpmb cmd in U-Boot
7"""
8
9import pytest
Simon Glassdb0e4532025-02-09 09:07:16 -070010import utils
Igor Opaniukb87e16c2024-04-04 15:19:50 +020011
12@pytest.mark.buildconfigspec('cmd_optee_rpmb')
Simon Glassddba5202025-02-09 09:07:14 -070013def test_optee_rpmb_read_write(ubman):
Igor Opaniukb87e16c2024-04-04 15:19:50 +020014 """Test OP-TEE RPMB cmd read/write
15 """
Simon Glassddba5202025-02-09 09:07:14 -070016 response = ubman.run_command('optee_rpmb write_pvalue test_variable test_value')
Igor Opaniukb87e16c2024-04-04 15:19:50 +020017 assert response == 'Wrote 11 bytes'
18
Simon Glassddba5202025-02-09 09:07:14 -070019 response = ubman.run_command('optee_rpmb read_pvalue test_variable 11')
20 assert response == 'Read 11 bytes, value = test_value'