blob: 8a081b5c49492e21181f09cb8b75c20e967d710f [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
10import u_boot_utils as util
11
12@pytest.mark.buildconfigspec('cmd_optee_rpmb')
13def test_optee_rpmb_read_write(u_boot_console):
14 """Test OP-TEE RPMB cmd read/write
15 """
16 response = u_boot_console.run_command('optee_rpmb write_pvalue test_variable test_value')
17 assert response == 'Wrote 11 bytes'
18
19 response = u_boot_console.run_command('optee_rpmb read_pvalue test_variable 11')
20 assert response == 'Read 11 bytes, value = test_value'