Automatic testing method, device and system based on trusted platform module
By introducing automated testing methods into the trusted platform module, and utilizing the instruction control of the general computing platform, the device motherboard, and the trusted security chip, automated program burning and testing of the storage module is achieved. This solves the problem of high manpower and time costs in existing testing methods and improves testing efficiency and accuracy.
Patent Information
- Application Number
- CN202510967784.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-14
- Publication Date
- 2025-11-28
AI Technical Summary
Existing proactive measurement function testing methods based on trusted platform modules suffer from high manpower and time costs, cumbersome testing processes, and susceptibility to human error.
By controlling the automated instructions between the general computing platform and the device motherboard and trusted security chip, the program burning and automated testing of the storage module are realized, reducing manual operation. The automated test instructions include one-way communication, program burning, and measurement function testing, to complete the automated test of trusted boot.
It saves manpower and time costs, improves testing efficiency, reduces errors caused by human operation, can quickly execute a large number of test cases, and improves the accuracy and comprehensiveness of testing.
Smart Images

Figure CN121030747A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more specifically to an automated testing method based on a trusted platform module, an automated testing device based on a trusted platform module, an automated testing system based on a trusted platform module, a machine-readable storage medium, and a computer program product. Background Technology
[0002] Trusted measurement refers to measuring and recording the state of a platform step by step using a specific method. Measurement is required at every step from system power-on to the final execution of the application; the entire startup sequence follows the principle of measuring before execution.
[0003] Please refer to Figure 2 In a trusted system, a root of trust must first be established, followed by a chain of trust. Terminal device systems based on a Trusted Platform Control Module (TPCM) integrate a trusted security chip as the root of trust onto the device's motherboard. When the trusted security chip is issued, a baseline metric for U-Boot is written into the chip's file system. This value is unreadable. After the terminal boots, only the root of trust can access the memory storing the boot program. The root of trust reads the boot program from memory, calculates the metric, and compares it with the baseline metric stored in the root of trust. If the comparison is successful, the measurement passes, and only then can the U-Boot program boot normally. The U-Boot program then begins measuring the integrity of the kernel and saves its baseline metric. Control is then transferred to the kernel, which begins measuring the integrity of the system software and saves its baseline metric. Control is then transferred to the system software, which begins measuring the integrity of the application and saves its baseline metric. Control is then transferred to the application, which begins execution. This chain of trust is passed step by step, fundamentally ensuring the security of the trusted device terminal system.
[0004] Please refer to Figure 3 In general, the testing of the active measurement function of a trusted platform module is done manually. It mainly consists of two modules: the non-volatile storage module read / write module and the TPCM active measurement function testing module.
[0005] The testing steps are as follows: 1. Correctly install the non-volatile memory module into the adapter socket of the FLASH / EEPROM programmer device. 2. Run the accompanying programming software on the general computing platform, select the pre-compiled U-Boot firmware, and perform the data writing operation. After the programming is completed, verify the firmware integrity through the verification program (implemented by the non-volatile memory module read / write module). 3. Remove the programmed non-volatile memory module from the programmer and install it onto the target device's motherboard. 4. Perform the Trusted Active Measurement Function test (implemented by the TPCM active measurement function test module).
[0006] Actual testing of the trusted active measurement function requires simulating various test cases. For example: the main U-Boot data in memory is the same as the baseline value in the root of trust; the main U-Boot data in memory is different from the baseline value in the root of trust, but the backup U-Boot data in memory is the same as the baseline value in the root of trust; both the main and backup U-Boot data in memory are different from the baseline value in the root of trust, and so on. The U-Boot data of the non-volatile memory module may be different in each test case, so steps 1 to 4 must be repeated for each test case. After erasing and writing the memory module on the programmer device, it is placed on the motherboard for a test case flow test. If the expected initial U-Boot data for the next test case does not match the current value of the memory module, it must be erased and written again on the programmer device. This repetitive operation means that the tester cannot leave the test site and must constantly manually operate the test equipment throughout the functional testing process, making the testing steps cumbersome and the testing cycle long. Furthermore, instability in the test environment (such as the memory module not being properly inserted, poor programmer contact, etc.) may cause abnormalities in memory burning, which will also lead to repeated memory erasing and writing. Meanwhile, frequent manual operations can also lead to omissions and false positives in testing. In other words, existing testing methods for proactive measurement functions based on trusted platform modules suffer from high manpower and time costs. Summary of the Invention
[0007] The purpose of this invention is to provide an automated testing method, an automated testing device, an automated testing system, a machine-readable storage medium, and a computer program product based on a trusted platform module, in order to solve the problem that existing testing methods for active measurement functions based on trusted platform modules have high manpower and time costs.
[0008] To achieve the above objectives, embodiments of the present invention provide an automated testing method based on a trusted platform module, comprising: The system controls the general-purpose computing platform to send a first one-way communication command to the device motherboard, and controls the storage module read / write control unit of the device motherboard to respond to the first one-way communication command and control the storage module of the device motherboard to communicate with the emulator. The general-purpose computing platform is controlled to send a program burning instruction to the emulator, the program burning instruction including a startup program; The simulator is controlled to respond to the program burning command and write the startup program into the storage module on the device motherboard; The system controls the general-purpose computing platform to send automated test commands to the trusted security chip on the device motherboard, and the trusted security chip responds to the automated test commands by performing automated tests on the startup program.
[0009] Optionally, the automated test instructions include a second one-way communication instruction and a measurement function test instruction; controlling the general-purpose computing platform to send automated test instructions to the trusted security chip on the device motherboard, and the trusted security chip responding to the automated test instructions to perform automated testing on the startup program, including: Control the general-purpose computing platform to send a second one-way communication command to the device motherboard; The storage module read / write control unit on the device motherboard responds to the second one-way communication command and controls the storage module of the device motherboard to communicate with the trusted security chip; The system controls the general computing platform to send a measurement function test command to the trusted security chip, and the trusted security chip responds to the measurement function test command by performing automated testing on the boot program in the storage module.
[0010] Optionally, the measurement function test instructions include a baseline value writing instruction, a power-on instruction, a power-off instruction, and an audit information acquisition instruction; controlling the general-purpose computing platform to send automated test instructions to the trusted security chip on the device motherboard, and the trusted security chip responding to the automated test instructions to perform automated testing on the startup program, including: The general-purpose computing platform is controlled to send a reference value write instruction to the trusted security chip; the reference value write instruction carries multiple reference values; The system controls the general-purpose computing platform to send a power-down command to the trusted security chip, and controls the trusted security chip to perform a power-down operation in response to the power-down command. The general-purpose computing platform is controlled to send a power-on command to the trusted security chip. The trusted security chip is controlled to respond to the power-on command and perform metric function tests from the startup program to the target test object based on the multiple benchmark values. The system controls the general-purpose computing platform to send an audit information acquisition instruction to the trusted security chip, and controls the trusted security chip to respond to the audit information acquisition instruction by sending the measurement function test results to the general-purpose computing platform. If the test results of the metric function are consistent with the expected values, the general computing platform is controlled to execute subsequent test cases.
[0011] Optionally, the method further includes: If the test results of the measurement function are inconsistent with the expected values, the control general computing platform shall send a prompt message to the testers to indicate whether the testers need to proceed to the next step of the test.
[0012] On the other hand, embodiments of the present invention also provide an automated testing device based on a trusted platform module, comprising: The first control module is used to control the general computing platform to send a first one-way communication command to the device motherboard, and to control the storage module read / write control unit of the device motherboard to respond to the first one-way communication command and control the storage module of the device motherboard to communicate with the emulator. The second control module is used to control the general computing platform to send a program burning instruction to the emulator, the program burning instruction including a startup program; The third control module is used to control the emulator to respond to the program burning command and write the startup program into the storage module on the device motherboard. The fourth control module is used to control the general computing platform to send automated test commands to the trusted security chip on the device motherboard, and the trusted security chip to perform automated tests on the startup program in response to the automated test commands.
[0013] Optionally, the automated test instructions include a second one-way communication instruction and a measurement function test instruction; controlling the general-purpose computing platform to send automated test instructions to the trusted security chip on the device motherboard, and the trusted security chip responding to the automated test instructions to perform automated testing on the startup program, including: Control the general-purpose computing platform to send a second one-way communication command to the device motherboard; The storage module read / write control unit on the device motherboard responds to the second one-way communication command and controls the storage module of the device motherboard to communicate with the trusted security chip; The system controls the general computing platform to send a measurement function test command to the trusted security chip, and the trusted security chip responds to the measurement function test command by performing automated testing on the boot program in the storage module.
[0014] Optionally, the measurement function test instructions include a baseline value writing instruction, a power-on instruction, a power-off instruction, and an audit information acquisition instruction; controlling the general-purpose computing platform to send automated test instructions to the trusted security chip on the device motherboard, and the trusted security chip responding to the automated test instructions to perform automated testing on the startup program, including: The general-purpose computing platform is controlled to send a reference value write instruction to the trusted security chip; the reference value write instruction carries multiple reference values; The system controls the general-purpose computing platform to send a power-down command to the trusted security chip, and controls the trusted security chip to perform a power-down operation in response to the power-down command. The general-purpose computing platform is controlled to send a power-on command to the trusted security chip. The trusted security chip is controlled to respond to the power-on command and perform metric function tests from the startup program to the target test object based on the multiple benchmark values. The system controls the general-purpose computing platform to send an audit information acquisition instruction to the trusted security chip, and controls the trusted security chip to respond to the audit information acquisition instruction by sending the measurement function test results to the general-purpose computing platform. If the test results of the metric function are consistent with the expected values, the general computing platform is controlled to execute subsequent test cases.
[0015] Optionally, the device further includes: The fifth control module is used to control the general computing platform to send a prompt message to the tester when the test result of the measurement function is inconsistent with the expected value, so as to prompt the tester whether the next step of the test is required.
[0016] On the other hand, embodiments of the present invention also provide an automated testing system based on a trusted platform module, comprising: A general-purpose computing platform is used to send a first one-way communication instruction, a program burning instruction, and an automated test instruction to the device motherboard, wherein the program burning instruction includes a startup program. The emulator is used to write the boot program into the storage module on the device motherboard in response to the program burning command; The device motherboard is configured to control the non-volatile memory module read / write control unit to communicate with the emulator in response to the first one-way communication command; and to control the trusted security chip of the device motherboard to perform automated testing on the boot program in the memory module in response to the automated test command.
[0017] On the other hand, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described automated testing method based on a trusted platform module.
[0018] On the other hand, the present invention also provides a machine-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described automated testing method based on a trusted platform module.
[0019] On the other hand, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described automated testing method based on a trusted platform module.
[0020] Through the above technical solution, this embodiment of the invention first controls the communication between the storage module of the device motherboard and the emulator through the storage module read / write control unit on the device motherboard. Then, it sends instructions to the emulator via a general-purpose computing platform to complete the burning of the boot program to the storage module. Finally, it sends instructions to the trusted security chip on the device motherboard via the general-purpose computing platform to complete the functional testing based on the trusted platform module. This embodiment of the invention eliminates the need for manual insertion and removal of the storage module to the programmer to erase and write U-Boot data before installing it onto the device motherboard of the test system. This embodiment of the invention improves manual operation by replacing it with programmed command execution, saving manpower and time costs.
[0021] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description
[0022] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart illustrating the automated testing method based on a trusted platform module provided by the present invention. Figure 2 This is a flowchart illustrating the reliability measurement methods provided by existing technologies; Figure 3 This is a flowchart illustrating the testing method for proactive measurement functions based on trusted platform modules provided by existing technologies; Figure 4 This is a schematic diagram of the structure of the automated testing device based on the trusted platform module provided by the present invention; Figure 5 This is a schematic diagram of the structure of the automated testing system based on the trusted platform module provided by the present invention. Detailed Implementation
[0023] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the scope of the present invention.
[0024] Method Implementation Examples Please refer to Figure 1 This invention provides an automated testing method based on a trusted platform module, comprising: Step 100: Control the general computing platform to send a first one-way communication command to the device motherboard, and control the storage module read / write control unit of the device motherboard to respond to the first one-way communication command and control the storage module of the device motherboard to communicate with the emulator.
[0025] The storage module of the device motherboard can be a volatile storage module or a non-volatile storage module. This embodiment of the invention uses a non-volatile storage module as an example. Similarly, the storage module read / write control unit is described using a non-volatile storage module read / write control unit. The emulator can be various development boards, hardware debugging devices, etc., such as ARM development boards, FPGA development kits, ARM emulators, etc. In this embodiment of the invention, an ARM emulator can be used as the hardware debugging device.
[0026] To avoid errors such as omissions and mistests that may result from frequent manual operations, this embodiment of the invention develops a non-volatile memory module read / write control unit on the device motherboard. This non-volatile memory module read / write control unit can effectively control the memory module of the device motherboard to communicate with only one logic unit of either the emulator or the trusted security chip. Therefore, this embodiment of the invention first controls the general-purpose computing platform to send a first one-way communication command to the device motherboard, setting the current memory module read / write operation of the device motherboard to be controlled by the ARM emulator.
[0027] Step 200: Control the general computing platform to send a program burning instruction to the emulator, the program burning instruction including a startup program.
[0028] This invention embodiment controls a general-purpose computing platform to send a program writing instruction to the emulator. The program writing instruction includes the size of the non-volatile memory module to be written, its starting address, and valid data (the boot program). The boot program may include a bootloader, operating system kernel components, and a user-level self-starting program. This invention embodiment uses the U-Boot program as an example for explanation.
[0029] Step 300: Control the emulator to respond to the program burning command and write the startup program into the storage module on the device motherboard.
[0030] After receiving the program burning command from the general-purpose computing platform, the ARM emulator in this embodiment of the invention responds to the program burning command by writing the startup program to the storage module on the device's motherboard. After the non-volatile memory module write operation is successful, the ARM emulator sends a write operation success response message back to the general-purpose computing platform, informing the platform that it can proceed to the next step of automated testing based on the trusted platform module.
[0031] Step 400: Control the general computing platform to send an automated test command to the trusted security chip on the device motherboard, and the trusted security chip responds to the automated test command to perform automated testing on the startup program.
[0032] In this embodiment of the invention, the automated testing principle of the active measurement function is that after power-on, the root of trust reads the startup program in the memory, calculates the measurement value, and compares it with the benchmark measurement value stored in the root of trust.
[0033] The general-purpose computing platform of this invention can communicate with the trusted security chip via a trusted security chip reader. The general-purpose computing platform can send automated test commands to the trusted security chip. These automated test commands may include verifying measurement values, updating measurement values, obtaining audit information (measurement results), setting measurement flags and measurement modes, setting the U-Boot storage space size, and reading the U-Boot storage space size. When the device motherboard is configured to control the read and write operations of the non-volatile storage module via the trusted security chip, after the trusted security chip is powered on and reset, it reads the boot program in the non-volatile storage module to complete the trusted boot active measurement function. In one embodiment, the general-purpose computing platform is equipped with trusted chip trusted function testing software. This testing software can directly perform read and write control operations on the non-volatile storage module by implementing interface functions such as read operations, write operations, and returning the success or failure of write operations. This software can also achieve automated testing of the security chip. The general-purpose computing platform sends commands such as setting the U-Boot size, writing the baseline value, obtaining audit information, and powering on / off to the security chip to complete the active operation and status acquisition of the trusted security chip. Then, by analyzing and comparing the data with the expected data in the testing software, the automated testing of the Trusted Startup Active Measurement function is completed.
[0034] This invention first controls the communication between the storage module and the emulator via the storage module read / write control unit on the device motherboard. Then, a general-purpose computing platform sends instructions to the emulator to burn the boot program to the storage module. Finally, the general-purpose computing platform sends instructions to the trusted security chip on the device motherboard to complete the functional testing based on the trusted platform module. This invention eliminates the need for manual insertion and removal of the storage module to the programmer to write U-Boot data before installing it onto the test system's motherboard. This invention transforms manual operation into programmed command execution, saving manpower and time costs.
[0035] In other aspects of the embodiments of the present invention, the automated test instruction includes a second one-way communication instruction and a measurement function test instruction; step 400, controlling the general computing platform to send the automated test instruction to the trusted security chip of the device motherboard, and the trusted security chip responding to the automated test instruction to perform automated testing on the startup program, includes: Step 410: Control the general computing platform to send a second one-way communication command to the device motherboard.
[0036] Step 420: The storage module read / write control unit on the device motherboard responds to the second one-way communication command and controls the storage module of the device motherboard to communicate with the trusted security chip.
[0037] After receiving a successful write operation response from the ARM emulator, the general-purpose computing platform sends a second one-way communication command to the device motherboard. In response to this second one-way communication command, the non-volatile memory module read / write control unit on the device motherboard controls the memory module to communicate with the trusted security chip, thus setting the current read / write operations of the non-volatile memory module to be controlled by the trusted security chip.
[0038] Step 430: Control the general computing platform to send a measurement function test command to the trusted security chip, and the trusted security chip responds to the measurement function test command by performing automated testing on the boot program in the storage module.
[0039] In one embodiment, step 430, the measurement function test instruction, includes a baseline value writing instruction, a power-on instruction, a power-off instruction, and an audit information acquisition instruction; controlling the general-purpose computing platform to send an automated test instruction to the trusted security chip on the device motherboard, and the trusted security chip responding to the automated test instruction to perform automated testing on the startup program, including: controlling the general-purpose computing platform to send a baseline value writing instruction to the trusted security chip; the baseline value writing instruction carries multiple baseline values; controlling the general-purpose computing platform to send a power-off instruction to the trusted security chip, and controlling the trusted security chip to perform a power-off operation in response to the power-off instruction; controlling the general-purpose computing platform to send a power-on instruction to the trusted security chip; controlling the trusted security chip to perform measurement function testing from the startup program to the target test object based on the multiple baseline values in response to the power-on instruction; controlling the general-purpose computing platform to send an audit information acquisition instruction to the trusted security chip, and controlling the trusted security chip to send the measurement function test result to the general-purpose computing platform in response to the audit information acquisition instruction; controlling the general-purpose computing platform to execute subsequent test cases if the measurement function test result is consistent with the expected value.
[0040] Specifically, the general-purpose computing platform sends a command to the trusted security chip to set the U-Boot size. After the trusted security chip successfully executes the command, the general-purpose computing platform continues to send baseline value write instructions to the trusted security chip to write the U-Boot baseline value, kernel baseline value, and other baseline values (such as system software baseline values and application baseline values). After the trusted security chip successfully executes the command, the general-purpose computing platform sends a command to the trusted security chip to set the metric flag. The general-purpose computing platform controls the trusted security chip reader to power down the trusted security chip via a power-down command, and then power on the trusted security chip again via a power-on command. The trusted security chip responds to the power-on command and performs metric function tests from the boot program to the application based on the various baseline values. The trusted security chip reads the boot program from the non-volatile memory module and calculates the metric value. The trusted security chip compares the calculated metric value with the U-Boot baseline metric value stored in the trusted root and decides whether to continue or terminate the boot process based on the trusted boot metric mechanism. The general-purpose computing platform sends an audit information retrieval command to the trusted security chip. After receiving the instruction, the trusted security chip sends all measurement results (metric function test results) back to the general computing platform. If the test results match the expected values, the script automatically executes subsequent test cases.
[0041] In other embodiments, the method further includes: controlling the general computing platform to send a prompt message to the tester when the measurement function test result is inconsistent with the expected value, to prompt the tester whether to proceed to the next step of the test. Specifically, if the measurement function test result is inconsistent with the expected value, the testing device will prompt the tester whether to proceed to the next step of the test. For example, this can be done by displaying a video or image on a screen, or by emitting an audio prompt through a speaker. It should be noted that if there are no errors during the testing process, no human intervention is required to successfully complete all functional tests and save the test log.
[0042] In summary, this invention enables functional testing of trusted boot based on a trusted platform module by sending executable commands to the emulator, device motherboard, and trusted security chip reader via a general-purpose computing platform. This invention eliminates the need for manual insertion and removal of the non-volatile memory module to a programmer to write and erase U-Boot data before installation onto the test system's device motherboard. By transforming manual operation into programmed command execution, it saves manpower and time costs. Furthermore, this invention can rapidly execute a large number of test cases, making it more efficient than manual testing. It can complete a large number of repetitive testing tasks in a short period. Compared to manual testing, testing efficiency can be increased by several times or even tens of times. Automated testing can execute test tasks according to predetermined steps and rules, thereby improving the accuracy and comprehensiveness of the tests.
[0043] Device Examples Please refer to Figure 4 On the other hand, embodiments of the present invention also provide an automated testing device based on a trusted platform module, comprising: The first control module 401 is used to control the general computing platform to send a first one-way communication command to the device motherboard, and to control the storage module read / write control unit of the device motherboard to respond to the first one-way communication command and control the storage module of the device motherboard to communicate with the emulator. The second control module 402 is used to control the general computing platform to send a program burning instruction to the emulator, the program burning instruction including a startup program; The third control module 403 is used to control the emulator to respond to the program burning command and write the startup program into the storage module on the device motherboard. The fourth control module 404 is used to control the general computing platform to send automated test commands to the trusted security chip on the device motherboard, and the trusted security chip to perform automated tests on the startup program in response to the automated test commands.
[0044] Optionally, the automated test instructions include a second one-way communication instruction and a measurement function test instruction; controlling the general-purpose computing platform to send automated test instructions to the trusted security chip on the device motherboard, and the trusted security chip responding to the automated test instructions to perform automated testing on the startup program, including: Control the general-purpose computing platform to send a second one-way communication command to the device motherboard; The storage module read / write control unit on the device motherboard responds to the second one-way communication command and controls the storage module of the device motherboard to communicate with the trusted security chip; The system controls the general computing platform to send a measurement function test command to the trusted security chip, and the trusted security chip responds to the measurement function test command by performing automated testing on the boot program in the storage module.
[0045] Optionally, the measurement function test instructions include a baseline value writing instruction, a power-on instruction, a power-off instruction, and an audit information acquisition instruction; controlling the general-purpose computing platform to send automated test instructions to the trusted security chip on the device motherboard, and the trusted security chip responding to the automated test instructions to perform automated testing on the startup program, including: The general-purpose computing platform is controlled to send a reference value write instruction to the trusted security chip; the reference value write instruction carries multiple reference values; The system controls the general-purpose computing platform to send a power-down command to the trusted security chip, and controls the trusted security chip to perform a power-down operation in response to the power-down command. The general-purpose computing platform is controlled to send a power-on command to the trusted security chip. The trusted security chip is controlled to respond to the power-on command and perform metric function tests from the startup program to the target test object based on the multiple benchmark values. The system controls the general-purpose computing platform to send an audit information acquisition instruction to the trusted security chip, and controls the trusted security chip to respond to the audit information acquisition instruction by sending the measurement function test results to the general-purpose computing platform. If the test results of the metric function are consistent with the expected values, the general computing platform is controlled to execute subsequent test cases.
[0046] Optionally, the device further includes: The fifth control module is used to control the general computing platform to send a prompt message to the tester when the test result of the measurement function is inconsistent with the expected value, so as to prompt the tester whether the next step of the test is required.
[0047] The automated testing device based on the trusted platform module includes a processor and a memory. The first control module 401, the second control module 402, the third control module 403, the fourth control module 404, etc., are all stored in the memory as program units. The processor executes the program units stored in the memory to realize the corresponding functions.
[0048] A processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured.
[0049] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0050] On the other hand, please refer to Figure 5 In order to improve testing efficiency and reduce various errors that may be caused by manual operation, this embodiment of the invention also provides an automated testing system based on a trusted platform module, including: a general computing platform 10, an emulator, a device motherboard 30, and a trusted security chip reader 40.
[0051] The general-purpose computing platform 10 is used to send a first one-way communication command, a program burning command, and an automated test command to the device motherboard 30. The program burning command includes a startup program. The general-purpose computing platform 10 and the device motherboard 30 are directly connected. The general-purpose computing platform 10 sends the first one-way communication command to the non-volatile memory module read / write control unit of the device motherboard 30. This first one-way communication command determines whether the read / write operation of the memory module is controlled by the trusted security chip or the ARM emulator 20. A set of trusted function testing software for the security chip developed in this invention is installed on the general-purpose computing platform 10. This testing software realizes the automated testing functions of read / write control and trusted startup of the memory module and the security chip.
[0052] An emulator, in response to the program burning command, writes the boot program into the storage module on the device motherboard 30. In one embodiment, the emulator is an ARM emulator 20. The emulator is connected to the general-purpose computing platform 10 via a USB port and to the device motherboard 30 via a JTAG+SWD port. When the device motherboard 30 is currently configured to control the reading and writing of the non-volatile memory module by the ARM emulator 20, the general-purpose computing platform 10 can send storage module read / write commands to the ARM emulator 20 to control the ARM emulator 20 to complete the erasing, writing, and reading of the storage module.
[0053] The device motherboard 30 is used to control the non-volatile memory module read / write control unit to communicate with the emulator in response to the first one-way communication command; and to control the trusted security chip of the device motherboard 30 to perform automated testing on the boot program in the memory module in response to the automated test command. Specifically, the device motherboard 30 includes a non-volatile memory module, a non-volatile memory module read / write control unit, and a trusted security chip. In this embodiment of the invention, a non-volatile memory module read / write control unit is developed on the device motherboard 30, which can effectively control the non-volatile memory module to currently only communicate with one of the logic units of the ARM emulator 20 or the trusted security chip.
[0054] The trusted security chip reader 40 is directly connected to the general-purpose computing platform 10 and to the trusted security chip on the device motherboard 30 via a chip adapter board. The general-purpose computing platform 10 can send communication commands to the trusted security chip. Executable communication commands include verifying measurement values, updating measurement values, obtaining audit information (measurement results), setting measurement flags and measurement modes, setting the U-Boot storage space size, and reading the U-Boot storage space size. When the device motherboard 30 is configured to control the read and write operations of the non-volatile memory module using the trusted security chip, after the trusted security chip is powered on and reset, it reads the boot program from the non-volatile memory module to complete the trusted boot active measurement function.
[0055] In one embodiment, the automated testing process mainly consists of: S1. Based on the configuration of different terminal systems based on trusted platform modules, set the parameters of the trusted function test software for security chips.
[0056] S2. The general-purpose computing platform 10 sends a command to the device motherboard 30, setting the current non-volatile memory module read / write operations to be controlled by the ARM emulator 20. Then, the general-purpose computing platform 10 sends a write command to the ARM emulator 20. The input parameters include the size of the memory module to be written, the starting address, and the valid data. After the memory module write operation is successful, the ARM emulator 20 sends a write operation success acknowledgment message back to the general-purpose computing platform 10. Then, the general-purpose computing platform 10 sends a command to the device motherboard 30, setting the current non-volatile memory module read / write operations to be controlled by the trusted security chip.
[0057] S3. The general-purpose computing platform 10 sends a command to the trusted security chip to set the U-Boot size. After the trusted security chip executes the command successfully, the general-purpose computing platform 10 continues to send commands to the trusted security chip to write the U-Boot baseline value, kernel baseline value and other baseline values. After the trusted security chip executes the command successfully, the general-purpose computing platform 10 sends a command to the trusted security chip to set the metric flag.
[0058] S4. The general-purpose computing platform 10 controls the trusted security chip reader 40 to power down the trusted security chip and then power it back on. The trusted security chip reads the boot program from the non-volatile memory module and calculates a metric. The security chip compares the calculated metric with the U-Boot baseline metric stored in the trusted root and decides whether to continue or terminate the boot process based on the trusted boot metric mechanism.
[0059] S5. The general-purpose computing platform 10 sends a command to the trusted security chip to obtain trusted measurement audit information. After receiving the command, the trusted security chip sends all measurement results back to the general-purpose computing platform 10. If the test results are consistent with the expected values, the script automatically executes subsequent test cases; if the test results are inconsistent with the expected values, the testing device will prompt the tester whether to proceed with the next step of the test.
[0060] S6. If there are no errors during the test, the testing device can successfully complete all functional tests and save the test log without human intervention.
[0061] In summary, the automated testing system based on the trusted platform module of this invention has the following advantages: 1. This invention enables functional testing of trusted boot based on a trusted platform module by sending executable commands to the development board / hardware debugging device, the device motherboard, and the card reader via a general-purpose computing platform. The general-purpose computing platform directly sends a series of executable commands to the development board / hardware debugging device, the device motherboard, and the trusted chip card reader. Once the test cases are written, they can be executed with a single click. Testers only need to analyze the test results and do not need to understand the deeper testing principles.
[0062] 2. This embodiment of the invention eliminates the need for manual insertion and removal of the non-volatile memory module to the programmer to erase and write U-Boot data before installing it onto the motherboard of the test system. It transforms manual operation into programmed command execution, saving manpower and time costs.
[0063] 3. This invention can quickly execute a large number of test cases, making it more efficient than manual testing. It can complete a large number of repetitive testing tasks in a short period of time. Compared with manual testing, testing efficiency can be increased by several times or even tens of times. Automated testing is completed by modular testing components, avoiding errors that may be caused by human operation. Automated testing can execute test tasks according to predetermined steps and rules, thereby improving the accuracy and comprehensiveness of testing.
[0064] 4. This invention is applicable to different trusted platform module terminal systems. The testing device can be activated by configuring and adjusting the software parameters according to different terminal systems. That is, the configuration parameters can be set before using the automated testing software. This testing device has good maintainability, scalability, and reusability.
[0065] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program that can be stored on a machine-readable storage medium. When the computer program is executed by a processor, the computer is able to execute an automated testing method based on a trusted platform module. The method includes: controlling a general-purpose computing platform to send a first one-way communication instruction to a device motherboard; and controlling a storage module read / write control unit of the device motherboard to respond to the first one-way communication instruction and control the storage module of the device motherboard to communicate with an emulator; controlling the general-purpose computing platform to send a program burning instruction to the emulator, the program burning instruction including a boot program; controlling the emulator to respond to the program burning instruction and write the boot program into the storage module on the device motherboard; and controlling the general-purpose computing platform to send an automated testing instruction to a trusted security chip on the device motherboard, and the trusted security chip to respond to the automated testing instruction and perform automated testing on the boot program.
[0066] In another aspect, the present invention also provides a machine-readable storage medium storing a computer program thereon, which, when executed by a processor, implements an automated testing method based on a trusted platform module. The method includes: controlling a general-purpose computing platform to send a first one-way communication instruction to a device motherboard; and controlling a storage module read / write control unit of the device motherboard to respond to the first one-way communication instruction and control the storage module of the device motherboard to communicate with an emulator; controlling the general-purpose computing platform to send a program burning instruction to the emulator, the program burning instruction including a boot program; controlling the emulator to respond to the program burning instruction and write the boot program into the storage module on the device motherboard; and controlling the general-purpose computing platform to send an automated testing instruction to a trusted security chip on the device motherboard, and the trusted security chip to respond to the automated testing instruction and perform automated testing on the boot program.
[0067] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0068] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0069] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An automated testing method based on a trusted platform module, characterized in that, include: The system controls the general-purpose computing platform to send a first one-way communication command to the device motherboard, and controls the storage module read / write control unit of the device motherboard to respond to the first one-way communication command and control the storage module of the device motherboard to communicate with the emulator. The general-purpose computing platform is controlled to send a program burning instruction to the emulator, the program burning instruction including a startup program; The simulator is controlled to respond to the program burning command and write the startup program into the storage module on the device motherboard; The system controls the general-purpose computing platform to send automated test commands to the trusted security chip on the device motherboard, and the trusted security chip responds to the automated test commands by performing automated tests on the startup program.
2. The automated testing method based on a trusted platform module according to claim 1, characterized in that, The automated test instructions include a second one-way communication instruction and a measurement function test instruction; controlling the general-purpose computing platform to send automated test instructions to the trusted security chip on the device motherboard, and the trusted security chip responding to the automated test instructions to perform automated testing on the startup program, including: Control the general-purpose computing platform to send a second one-way communication command to the device motherboard; The storage module read / write control unit on the device motherboard responds to the second one-way communication command and controls the storage module of the device motherboard to communicate with the trusted security chip; The system controls the general computing platform to send a measurement function test command to the trusted security chip, and the trusted security chip responds to the measurement function test command by performing automated testing on the boot program in the storage module.
3. The automated testing method based on a trusted platform module according to claim 2, characterized in that, The measurement function test instructions include a baseline value writing instruction, a power-on instruction, a power-off instruction, and an audit information acquisition instruction; controlling the general computing platform to send automated test instructions to the trusted security chip on the device motherboard, and the trusted security chip responding to the automated test instructions to perform automated testing on the startup program, including: The general-purpose computing platform is controlled to send a reference value write instruction to the trusted security chip; the reference value write instruction carries multiple reference values; The system controls the general-purpose computing platform to send a power-down command to the trusted security chip, and controls the trusted security chip to perform a power-down operation in response to the power-down command. The general-purpose computing platform is controlled to send a power-on command to the trusted security chip. The trusted security chip is controlled to respond to the power-on command and perform metric function tests from the startup program to the target test object based on the multiple benchmark values. The system controls the general-purpose computing platform to send an audit information acquisition instruction to the trusted security chip, and controls the trusted security chip to respond to the audit information acquisition instruction by sending the measurement function test results to the general-purpose computing platform. If the test results of the metric function are consistent with the expected values, the general computing platform is controlled to execute subsequent test cases.
4. The automated testing method based on a trusted platform module according to claim 3, characterized in that, The method further includes: If the test results of the measurement function are inconsistent with the expected values, the control general computing platform shall send a prompt message to the testers to indicate whether the testers need to proceed to the next step of the test.
5. An automated testing device based on a trusted platform module, characterized in that, include: The first control module is used to control the general computing platform to send a first one-way communication command to the device motherboard, and to control the storage module read / write control unit of the device motherboard to respond to the first one-way communication command and control the storage module of the device motherboard to communicate with the emulator. The second control module is used to control the general computing platform to send a program burning instruction to the emulator, the program burning instruction including a startup program; The third control module is used to control the emulator to respond to the program burning command and write the startup program into the storage module on the device motherboard. The fourth control module is used to control the general computing platform to send automated test commands to the trusted security chip on the device motherboard, and the trusted security chip to perform automated tests on the startup program in response to the automated test commands.
6. The automated testing device based on a trusted platform module according to claim 5, characterized in that, The automated test instructions include a second one-way communication instruction and a measurement function test instruction; controlling the general-purpose computing platform to send automated test instructions to the trusted security chip on the device motherboard, and the trusted security chip responding to the automated test instructions to perform automated testing on the startup program, including: Control the general-purpose computing platform to send a second one-way communication command to the device motherboard; The storage module read / write control unit on the device motherboard responds to the second one-way communication command and controls the storage module of the device motherboard to communicate with the trusted security chip; The system controls the general computing platform to send a measurement function test command to the trusted security chip, and the trusted security chip responds to the measurement function test command by performing automated testing on the boot program in the storage module.
7. The automated testing device based on a trusted platform module according to claim 6, characterized in that, The measurement function test instructions include a baseline value writing instruction, a power-on instruction, a power-off instruction, and an audit information acquisition instruction; controlling the general computing platform to send automated test instructions to the trusted security chip on the device motherboard, and the trusted security chip responding to the automated test instructions to perform automated testing on the startup program, including: The general-purpose computing platform is controlled to send a reference value write instruction to the trusted security chip; the reference value write instruction carries multiple reference values; The system controls the general-purpose computing platform to send a power-down command to the trusted security chip, and controls the trusted security chip to perform a power-down operation in response to the power-down command. The general-purpose computing platform is controlled to send a power-on command to the trusted security chip. The trusted security chip is controlled to respond to the power-on command and perform metric function tests from the startup program to the target test object based on the multiple benchmark values. The system controls the general-purpose computing platform to send an audit information acquisition instruction to the trusted security chip, and controls the trusted security chip to respond to the audit information acquisition instruction by sending the measurement function test results to the general-purpose computing platform. If the test results of the metric function are consistent with the expected values, the general computing platform is controlled to execute subsequent test cases.
8. The automated testing device based on a trusted platform module according to claim 7, characterized in that, The device further includes: The fifth control module is used to control the general computing platform to send a prompt message to the tester when the test result of the measurement function is inconsistent with the expected value, so as to prompt the tester whether the next step of the test is required.
9. An automated testing system based on a trusted platform module, characterized in that, include: A general-purpose computing platform is used to send a first one-way communication instruction, a program burning instruction, and an automated test instruction to the device motherboard, wherein the program burning instruction includes a startup program. The emulator is used to write the boot program into the storage module on the device motherboard in response to the program burning command; The device motherboard is used to control the non-volatile memory module read / write control unit to respond to the first one-way communication command and control the memory module of the device motherboard to communicate with the emulator; And, in response to the automated test command, to control the trusted security chip on the device motherboard to perform automated testing on the boot program in the storage module.
10. A machine-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the automated testing method based on the trusted platform module as described in any one of claims 1 to 4.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the automated testing method based on the trusted platform module as described in any one of claims 1 to 4.