Component testing method and system and tested unit

By switching to the target operating system in the server and executing test scripts, the problem of inefficient component testing under Suse OS is solved, and efficient component testing is achieved.

CN120336096APending Publication Date: 2025-07-18XFUSION DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510323278.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

In the prior art, server components require a lot of manpower, material resources and financial resources when testing under Suse OS, and the testing efficiency is low, so it is impossible to directly use existing tools for testing.

Method used

By obtaining the target operating system information and test script information of the component to be tested, the server's current operating system is switched to the target operating system, and the test script is executed in the target operating system, adapting to the target testing tool, and directly conducting component testing.

Benefits of technology

This reduces manpower, material resources and financial investment in hardware testing, shortens testing time, and improves testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120336096A_ABST
    Figure CN120336096A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a component testing method, which is applied to the technical field of computers, and comprises the following steps: acquiring test information corresponding to a to-be-tested component, the test information comprising target operating system information and target test script information, then, according to the target operating system information, switching an operating system which does not support the test of the to-be-tested component at present to a target operating system which supports the test of the to-be-tested component, namely, adapting to the operating system of the to-be-tested component; and executing the target test script to test the to-be-tested component according to the target test script information. Therefore, after the system switching is carried out, the to-be-tested component can be directly tested, so that the to-be-tested component does not need to be adapted, manpower, material resources and financial resources input in the hardware testing process are reduced, the testing time is shortened, and the hardware testing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technologies, and in particular, to a component testing method, system, and unit under test. Background Art

[0002] Testing various components in a server (such as a CPU, a motherboard, and a solid-state drive, etc.) (for example, it can include functional testing, stress testing, and function testing, etc.) is an important step to ensure that the server can operate stably and efficiently in various usage scenarios.

[0003] Currently, most components are tested under Suse OS, but there are individual components that cannot be tested under Suse OS. If you want to complete the testing of this component, you need to adapt it for this component under Suse OS. In this case, a large amount of manpower, material resources, and financial resources need to be invested, and it takes a long time, thus resulting in low testing efficiency. Summary of the Invention

[0004] Embodiments of this application provide a component testing method, system, and unit under test, which can reduce the manpower, material resources, and financial resources invested in the hardware testing process, shorten the testing time, and thus improve the efficiency of hardware testing.

[0005] In a first aspect, embodiments of this application provide a component testing method, and the method includes:

[0006] Obtain first test information corresponding to a first component to be tested, where the first test information may include target operating system information and target test script information. Then, switch the current operating system of the unit under test to the target operating system according to the target operating system information. Finally, in the target operating system, execute a target test script according to the target test script information to test the first component to be tested, where the target operating system is adapted to the test tool called by the target test script. In this way, after the system switch in this application, the component to be tested can be directly tested, and thus there is no need to adapt the component to be tested anymore, which reduces the manpower, material resources, and financial resources invested in the hardware testing process, shortens the testing time, and thus improves the efficiency of hardware testing.

[0007] In some possible implementations, the first component to be tested may be an NPU module. Switch the current operating system of the unit under test to the target operating system required for testing the NPU module according to the target operating system information corresponding to the NPU module, and then test the NPU component.

[0008] In some possible implementations, embodiments of the present application may also obtain second test information corresponding to the next component to be tested (the second component to be tested is referred to as the second component to be tested here), and then switch the target operating system of the unit under test to the second operating system required for testing the second component to be tested according to the operating system information in the second test information, where the second component to be tested and the first component to be tested are adapted to different operating systems. Then, in the second operating system, execute the test script corresponding to the second component to be tested according to the test script information in the second test information to test the second component to be tested. That is, in embodiments of the present application, after this test, it is also possible to switch to other operating systems to test the second component to be tested.

[0009] In some possible implementations, embodiments of the present application may also upload the test data of the first component to be tested to the root server for storage when the test of the first component to be tested is completed. When the target operating system is switched to the second operating system required for testing the second component to be tested, obtain the stored test data from the root server. The second operating system of the second component to be tested is the Suse operating system. Then, determine the test result of testing the first component to be tested according to the test data. It should be noted that the Suse OS may provide a more complete integration environment, which is more convenient for further analysis and processing of the test data, thereby improving the processing efficiency of the test data. Furthermore, after the step of "executing the target test script to test the component to be tested according to the target test script information in the target operating system" in embodiments of the present application, the test data can be uploaded to the root server for storage to avoid data loss in the memory due to the restart of the unit under test when the target operating system is switched to the Suse OS, so as to process the test data under the Suse OS. Processing the test data in the Suse OS can improve the processing efficiency of the test data.

[0010] In some possible implementations, the first test information corresponding to the first component to be tested can specifically be: generating a 01-MAC file according to pre-stored code, where the 01-MAC file is used to indicate the target operating system to which a switch is required. For example, if the type of the target operating system that the unit under test needs to switch to indicated by the 01-MAC file is OpenEuler, and the kernel parameter is oe2203.X86_64 (i.e., the target version to be switched to is oe2203.X86_64), then the unit under test can obtain the corresponding target operating system information from the cloud server 110 according to the 01-MAC file, that is, obtain the installation data corresponding to OpenEuler, parameter information, and kernel information corresponding to oe2203.X86_64, etc. from the cloud server 110. Then, the first test information corresponding to the first component to be tested can be obtained from the cloud server according to the 01-MAC file. In this way, after obtaining the test information, the unit under test can store the test information in the generated 01-MAC file, upload the 01-MAC file to the root server 100 for storage, and when the relevant 01-MAC file is needed, it can be obtained from the root server 100, thus ensuring that the file will not be lost.

[0011] In some possible implementations, switching the current operating system of the unit under test to the target operating system according to the target operating system information can specifically be: using a preset installation script or an automated deployment tool, downloading and installing the corresponding version of the target operating system according to the installation data and kernel information of the target operating system, and configuring the network and drivers according to the parameter information, so as to achieve the system switch.

[0012] In a second aspect, an embodiment of the present application provides a component test system, and the system includes:

[0013] The unit under test is used to obtain the test information corresponding to the first component to be tested from the cloud server, where the test information includes target operating system information and target test script information, switch the current operating system of the unit under test to the target operating system according to the target operating system information, and in the target operating system, execute the target test script according to the target test script information to test the first component to be tested, and the target operating system is adapted to the test tool called by the target test script;

[0014] The cloud server is used to provide the test information of the first component to be tested for the unit under test through the network.

[0015] In some possible implementations, the first component to be tested is an NPU module, and the current operating system of the unit under test is switched to the target operating system required for testing the NPU module according to the target operating system information corresponding to the NPU module.

[0016] In some possible implementations, the unit under test is further configured to obtain second test information corresponding to a second component to be tested;

[0017] According to the operating system information in the second test information, switch the target operating system of the unit under test to a second operating system required for testing the second component to be tested, where the second component to be tested is adapted to a different operating system from the first component to be tested;

[0018] In the second operating system, execute a test script corresponding to the second component to be tested according to the test script information in the second test information to test the second component to be tested.

[0019] In some possible implementations, the unit under test is further configured to, when the test of the first component to be tested is completed, upload the test data of the first component to be tested to a root server for storage;

[0020] When the target operating system is switched to the second operating system required for testing the second component to be tested, obtain the stored test data from the root server, where the second operating system of the second component to be tested is the Suse operating system;

[0021] Determine a test result of testing the first component to be tested according to the test data.

[0022] In some possible implementations, the unit under test is specifically configured to generate a 01-MAC file according to pre-stored code, where the 01-MAC file is used to indicate a target operating system to which a switch is required;

[0023] Obtain first test information corresponding to the first component to be tested from a cloud server according to the 01-MAC file.

[0024] In some possible implementations, the system further includes a root server, and the root server is configured to store data uploaded by the unit under test;

[0025] The unit under test is specifically configured to:

[0026] Generate a 01-MAC file according to pre-stored code, where the 01-MAC file is used to indicate a target operating system to which a switch is required, obtain test information corresponding to the first component to be tested from a cloud server according to the 01-MAC file, store the test information in the 01-MAC file, and upload it to the root server for storage;

[0027] When the current operating system of the unit under test is switched to the target operating system, obtain the stored 01-MAC file from the root server, and execute a target test script according to the target test script information in the 01-MAC file to test the first component to be tested.

[0028] In some possible implementations, the unit under test is specifically configured to use a preset installation script or an automated deployment tool to download and install the target operating system of the corresponding version according to the installation data and kernel information of the target operating system;

[0029] Configure the network and drivers according to the parameter information.

[0030] In a third aspect, an embodiment of the present application provides a unit under test, including: a memory and a server;

[0031] The memory is coupled to the processor; the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device is caused to execute any implementation manner in the first aspect.

[0032] It can be seen from the above technical solutions that the present application has the following beneficial effects:

[0033] The present application can obtain the test information corresponding to the component to be tested, where the test information may include the target operating system information and the target test script information. Then, the current operating system of the server can be switched to the target operating system according to the target operating system information. Finally, in the target operating system, the target test script is executed according to the target test script information to test the component to be tested, where the target operating system operation is adapted to the test tool called by the target test script. In this way, the present application can switch the operating system that currently does not support testing the component to be tested to the target operating system that supports testing the component to be tested, that is, the operating system adapted to the component to be tested, so that the component to be tested can be directly tested, and thus there is no need to adapt the component to be tested any more, which reduces the manpower, material resources, and financial resources invested in the hardware testing process, shortens the testing time, and thus improves the efficiency of hardware testing. Description of the Drawings

[0034] Figure 1 A schematic diagram of a test scenario provided by an embodiment of the present application;

[0035] Figure 2 A schematic structural diagram of a component test system provided by an embodiment of the present application;

[0036] Figure 3A A flowchart of a component test method provided by an embodiment of the present application;

[0037] Figure 3B A schematic diagram of a 01-MAC file and a 02-MAC file provided by an embodiment of the present application;

[0038] Figure 4Flow chart of another component testing method provided by an embodiment of the present application;

[0039] Figure 5 Flow chart of another component testing method provided by an embodiment of the present application;

[0040] Figure 6 Interaction diagram of a component testing method provided by an embodiment of the present application;

[0041] Figure 7 Flow chart of a method for determining files to be loaded provided by an embodiment of the present application;

[0042] Figure 8 Hardware structure diagram of a unit under test provided by an embodiment of the present application. Detailed implementation manners

[0043] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.

[0044] The term "and / or" in this document is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone.

[0045] The terms "first", "second", etc. in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order of the objects. For example, the first target object and the second target object are used to distinguish different target objects, rather than to describe the specific order of the target objects.

[0046] In the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific manner.

[0047] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "a plurality" refers to two or more. For example, a plurality of processing units refers to two or more processing units; a plurality of systems refers to two or more systems.

[0048] Next, the application scenarios of the solution of the present application will be introduced.

[0049] Testing each component in the server (such as CPU, motherboard, and solid-state drive, etc.) (for example, it can include functional testing, stress testing, and functional testing, etc.) is an important step to ensure the stable and efficient operation of the server in various usage scenarios.

[0050] Currently, most components (such as CPU, motherboard, and solid-state drive, etc.) are tested under Suse OS, but there are individual components that cannot be tested under Suse OS.

[0051] Exemplarily, here the NPU component is taken as an example for introduction. Since its testing process requires using NPU in-network tools (such as Geekbench AI, RKNN-Toolkit, or AXCL NPU Benchmark, etc.) for testing, and the NPU in-network tools only support testing under a specific system (the specific system can be, for example, OpenEuler, CentOS, or Ubuntu, etc.). As Figure 1 shown, it cannot be tested under Suse OS. That is to say, Suse OS cannot adapt to the in-network tools, which in turn leads to the failure of testing the NPU using the NPU in-network tools under Suse OS. If you want to complete the testing of this NPU component, it is necessary to adapt it for this NPU component under Suse OS. In this case, a large amount of manpower, material resources, and financial resources need to be invested, and it takes a long time, thus resulting in low testing efficiency.

[0052] This application proposes a component testing method, which can include obtaining the test information corresponding to the component to be tested. Among them, the test information can include the target operating system information and the target test script information. Then, the current operating system of the server can be switched to the target operating system according to the target operating system information. Finally, in the target operating system, the target test script is executed according to the target test script information to test the component to be tested, where the target operating system operation adapts to the test tool called by the target test script. In this way, this application can switch the operating system that currently does not support testing the component to be tested to the target operating system that supports testing the component to be tested, that is, the operating system that adapts to the component to be tested, so that the component to be tested can be directly tested, and thus there is no need to adapt the component to be tested anymore, which also reduces the manpower, material resources, and financial resources invested in the hardware testing process, shortens the testing time, and thus improves the efficiency of hardware testing.

[0053] The component testing method provided in the embodiments of this application will be introduced in detail below. Before introducing the method, the framework of the component testing system provided by this application can be introduced first, specifically as Figure 2As shown in the figure, it includes: a root server 100, a cloud server 110, a switch 150, and a unit under test (in the embodiments of the present application, three units under test are taken as examples, namely unit under test UUT1 120, unit under test UUT2 130, and unit under test UUT3 140).

[0054] Among them, the root server 100 can also be called a PXE server. The root server 100 is, for example, a Dynamic Host Configuration Protocol (DHCP) server, a Trivial File Transfer Protocol (tftp) server, a File Transfer Protocol (FTP) server, etc. The root server 100 is used to allocate IP addresses for PXE clients (the units under test in this application), store the boot files uploaded by the PXE clients (referred to as 01-MAC files in the embodiments of the present application), and store the test data or logs uploaded by the PXE clients.

[0055] The cloud server 110 can be, for example, a Time Series Database (TSD) server, a Manufacturing Execution System (MES) server, or a TExpert server, etc. The cloud server 100 is used to provide test information of components to be tested for the unit under test through the network. The test information here can include target operating system information and target test script information.

[0056] The switch 150 is used to transfer data between the root server 100 and the unit under test. During the PXE test process, the unit under test can obtain an IP address from the root server 100 through the switch, upload data to the root server 100 through the switch, and subsequently download the stored data from the root server 100.

[0057] The unit under test refers to a device that tests components through PXE technology. The unit under test can be a computer or a server.

[0058] Specifically, the unit under test can obtain the test information corresponding to the component to be tested from the cloud server 110. The test information may include target operating system information and target test script information. Then, the operating system that currently does not support testing the component to be tested can be switched to an operating system adapted to the component to be tested according to the target operating system information. Finally, in the target operating system, the target test script is executed according to the target test script information to test the component to be tested. In this way, there is no need to adapt the component to be tested that is not adapted to the current operating system, thereby shortening the test time and improving the efficiency of hardware testing.

[0059] It should be noted that the system architecture and application scenarios described in the embodiments of the present application are for more clearly explaining the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those of ordinary skill in the art can know that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.

[0060] For ease of understanding, the component testing method provided by the present application is introduced exemplarily below in conjunction with the accompanying drawings. This can be referred to as Embodiment 1 here. This method can be applied to Figure 2 the component testing system shown. The component testing method provided in Embodiment 1 of the present application is introduced in detail below. Specifically, as Figure 3A shown, the component testing method includes:

[0061] S31: Obtain the test information corresponding to the component to be tested.

[0062] The unit under test (taking the unit under test UUT1 120 as an example here) can obtain the test information corresponding to the component to be tested from the cloud server 110. The component to be tested here refers to the component that needs to be tested, that is, the component whose function, performance, or model conversion needs to be verified whether it meets the expectations. The component to be tested here can also be called the first component to be tested, and the test information corresponding to the component to be tested can be called the first test information.

[0063] The test information may include target operating system information and target test script information. Among them, the target operating system information may include the target operating system type (the target operating system type may be, for example, Suse OS, OpenEuler, CentOS, or Ubuntu, etc.), the installation data corresponding to the target operating system, the kernel information of the target operating system (the kernel information refers to the version number of the target operating system, such as Ubuntu 22.04 or CentOS10, etc.), and the parameter information of the target operating system (the parameter information refers to the adjustable variables used to configure the system, program, or kernel. It can be command-line parameters or values in configuration files), etc. The target test script information refers to the script content related to the test of the component to be tested. Here, the target test script information may include: the type of the target test script and the corresponding target test script.

[0064] It should be noted that the test information corresponding to different components to be tested may be different. That is to say, for testing different components to be tested, the target operating systems and target test scripts that support testing these components may be different, and there may be some components to be tested for which there are multiple operating systems that support testing them, that is, there are multiple operating systems adapted to test these components.

[0065] Exemplarily, for example, if the component to be tested is an NPU, the target operating systems that support NPU testing may be systems such as OpenEuler, CentOS, or Ubuntu, etc. The target test script executed for NPU testing may be an in-network tool. That is, the target operating system type corresponding to the NPU is systems such as OpenEuler, CentOS, or Ubuntu, etc., and the corresponding target test script may be an in-network tool.

[0066] For another example, if the component to be tested is a CPU, the target operating system that supports CPU testing may be the Suse OS system, and the target test script executed for CPU testing may be the CPU-Z tool. That is, the target operating system type corresponding to the CPU is the Suse OS system, and the corresponding target test script may be the CPU-Z tool.

[0067] Further, taking the component to be tested as an NPU as an example for introduction, since there can be multiple operating systems that support NPU testing, such as OpenEuler, CentOS, or Ubuntu, etc., the unit under test needs to determine the specific target operating system to be switched to, so as to obtain the target operating system information.

[0068] In some possible implementations, the unit under test can generate a 01-Media Access Control Address (MAC) file according to pre-stored code. The 01-MAC file can be used to indicate that the unit under test needs to switch to the target operating system of the target version. For example, as Figure 3B shown, Figure 3B if the type of the target operating system that the 01-MAC file indicates the unit under test needs to switch to is OpenEuler, and the kernel parameter is oe2203.X86_64 (that is, the target version to be switched to is oe2203.X86_64), then the unit under test can obtain the corresponding target operating system information according to the 01-MAC file, that is, obtain the installation data, parameter information corresponding to OpenEuler, and kernel information corresponding to oe2203.X86_64, etc. from the cloud server 110.

[0069] S32: Switch the current operating system of the unit under test to the target operating system according to the target operating system information.

[0070] The unit under test can switch the current operating system of the unit under test to the target operating system according to the target operating system information. Exemplarily, for example, if the current operating system is Suse OS and the target operating system is Ubuntu, then the unit under test can switch Suse OS to the Ubuntu operating system.

[0071] Specifically, the unit under test can read the installation data of the target operating system, the kernel information of the target operating system, the parameter information of the target operating system, etc., and then automatically execute the switching process: for example, first, it can back up the necessary data and configurations of the current system, and then use a preset installation script or automated deployment tool (such as a PXE network boot script, unattended installation image, or virtualization management tool, etc.) to directly download and install the corresponding version of the target operating system according to the installation data and kernel information of the target operating system, and at the same time, configure the network and drivers, etc. according to the parameter information to ensure that the switched system can start seamlessly and meet the requirements of the test environment. The whole process does not require manual intervention and can achieve efficient and accurate operating system switching.

[0072] S33: In the target operating system, execute the target test script according to the target test script information to test the component to be tested.

[0073] After step 32 is completed, that is, after the current operating system is switched to the target operating system, the unit under test can automatically execute the target test script in the target operating system according to the target test script information to test the component under test, and then obtain test data. Then, the test data can be processed, and the test result can be determined according to the test data. The test result can be used to characterize whether the function, performance, or model conversion of the component under test meets the expectations.

[0074] Exemplarily, for example, if the component under test is an NPU, the target test script executed for testing the NPU can be an in-network tool. If the component under test is a CPU, the target test script executed for testing the CPU can be a CPU-Z tool, etc. Of course, this is only an example here and is not limited.

[0075] In this embodiment, the unit under test can obtain the test information corresponding to the component under test. The test information can include the target operating system information and the target test script information. Then, the current operating system of the server can be switched to the target operating system according to the target operating system information. Finally, in the target operating system, the target test script is executed according to the target test script information to test the component under test. The target operating system operation adapts to the test tool called by the target test script. In this way, the present application can switch the operating system that currently does not support testing the component under test to the target operating system that supports testing the component under test, that is, the operating system that adapts to the component under test, so that the component under test can be directly tested, and thus there is no need to adapt the component under test again, which reduces the manpower, material resources, and financial resources invested in the hardware testing process, shortens the testing time, and improves the efficiency of hardware testing.

[0076] In some possible implementation manners, Suse OS may provide a more complete integration environment, which is more convenient for further analysis and processing of test data, thereby improving the processing efficiency of test data. On the basis of the above embodiment, that is, after the step of "executing the target test script in the target operating system according to the target test script information to test the component under test", the embodiment of the present application can also switch the target operating system to Suse OS to process the test data under Suse OS. This can be called Embodiment 2, as Figure 4 shown, including:

[0077] S41. Obtain the operating system information of Suse OS.

[0078] The device under test can obtain the 02-MAC file from the root server 100. The 02-MAC file can include the operating system information of Suse OS, such as Figure 3BAs shown, the operating system information of Suse OS may include the installation data of Suse OS, kernel information, and parameter information.

[0079] S42. Switch the target operating system to Suse OS according to the operating system information of Suse OS.

[0080] S43. In Suse OS, process the test data generated by testing the component to be tested to determine the test result.

[0081] The implementation principles of steps S41 - S43 are similar to those of steps S31 - S33 in the first embodiment. Specifically, reference can be made to the description in the first embodiment, and no redundant description will be given here.

[0082] In this embodiment, the target operating system can be switched back to Suse OS, and then processing the test data in Suse OS can improve the processing efficiency of the test data.

[0083] In some possible implementation manners, based on the above - mentioned first or second embodiment, that is, after the step of "in the target operating system, execute the target test script according to the target test script information to test the component to be tested", or after the step of "in Suse OS, process the test data generated by testing the component to be tested to determine the test result", there may still be a need to test other components in the embodiments of the present application. When the next component to be tested can be tested using the current operating system, then the next component to be tested can be directly tested in the current operating system.

[0084] When the next component to be tested cannot be tested using the current operating system, the present application also provides an embodiment, which can be referred to as the third embodiment here. In the third embodiment, the current operating system of the unit under test can be switched to the operating system required to test the next component, as Figure 5 shown, including:

[0085] S51. Obtain the test information corresponding to the next component to be tested.

[0086] The unit under test can obtain the test information corresponding to the next component to be tested. It should be noted that the component to be tested can also be called the first component to be tested, the test information corresponding to the component to be tested can be called the first test information, the next component to be tested (i.e., the next component that needs to be tested) can be called the second component to be tested, the test information corresponding to the second component to be tested can be called the second test information, and the system required to test the second component to be tested can be called the second operating system. The first component to be tested and the second component to be tested are adapted to different operating systems in the component test scenario.

[0087] S52. Switch the current operating system of the unit under test to the operating system required for testing the next component to be tested according to the operating system information in the second test information.

[0088] The unit under test can switch the current operating system of the unit under test to the operating system required for testing the next component to be tested according to the operating system information in the second test information. It should be noted that if this embodiment is implemented on the basis of the first embodiment and the first component to be tested in the first embodiment is the NPU component, the current operating system is the operating system used for the last test of the NPU component, such as OpenEuler, CentOS or Ubuntu, etc. If this embodiment is implemented on the basis of the second embodiment, the current operating system is the Suse OS system.

[0089] S53. In the switched operating system, execute the corresponding test script according to the test script information in the test information of the next component to be tested to test the next component to be tested.

[0090] The implementation principles of steps S51 - S53 are similar to those of steps S31 - S33 in the first embodiment. For specific details, reference can be made to the description in the first embodiment and no redundant description will be given here.

[0091] In this embodiment, the unit under test can switch to the adapted operating system according to the test requirements of different components, ensuring that each component can be tested in the best environment, seamlessly switching from the test of one component to the test of the next component, and improving the test efficiency.

[0092] In some possible implementation manners, the overall machine test of the server is a Preboot Execution Environment (PXE) test. In the PXE test scenario, after the unit under test obtains the test information, it can be stored in the memory. Once the unit under test loses power, the data stored in the memory will disappear instantly. Based on this, the present application provides another embodiment, which can be called Embodiment 4 here. In Embodiment 4, after the unit under test obtains the test information or other data, it can be uploaded to the root server 100 for storage. When it is necessary to use the relevant data for subsequent processing, the stored data can be obtained from the root server 100, thereby ensuring that the data will not be lost. This embodiment can also be applied to Figure 1 the system shown in Figure 6 as shown in

[0093] S61. The unit under test obtains the test information corresponding to the component to be tested from the cloud server.

[0094] The unit under test obtains the test information corresponding to the component to be tested from the cloud server 110.

[0095] Step S61 is similar to Step S31 in the first embodiment in terms of implementation principle. For specific details, reference can be made to the description in the first embodiment, and no redundant description will be given here.

[0096] S62. The unit under test generates a 01-MAC file, stores the test information in the 01-MAC file, and uploads it to the root server.

[0097] The unit under test can generate a 01-MAC file according to the pre-stored code, store the test information in the 01-MAC file, and upload it to the root server 100. After the unit under test is powered off and restarted, the data stored in the memory of the unit under test disappears. Then, the unit under test can obtain the 01-MAC file from the root server 100. In the embodiment of the present application, the unit under test uploads and stores the 01-MAC file to the root server 100, and then can obtain the 01-MAC file from the root server 100 after the unit under test is powered off, so as to prevent data loss.

[0098] The specific principle of generating the 01-MAC file in Step S62 is similar to the implementation principle of Step S31 in the first embodiment. For specific details, reference can be made to the description in the first embodiment, and no redundant description will be given here.

[0099] S63. The unit under test switches the current operating system of the unit under test to the target operating system according to the target operating system information in the 01-MAC file, and performs a restart operation when the system switching is completed.

[0100] The unit under test can switch the current operating system of the unit under test to the target operating system according to the target operating system information in the test information. After the system switching is completed, in order to ensure that the newly switched target operating system can normally load the driver and run stably, and in order to re-initialize the hardware devices to ensure their compatibility with the newly switched target operating system and to clean up the residual resources of the old system, the unit under test can perform a restart operation.

[0101] In some possible implementation manners, since the 01-MAC file includes the target operating system information of the component to be tested, when there is a 01-MAC file, the execution priority of the 01-MAC file needs to be higher than that of the 02-MAC file. That is, when there is a 01-MAC file in the root server 100, the unit under test needs to preferentially load the target operating system information in the 01-MAC file to ensure that the unit under test can successfully switch the current operating system to the target operating system and test the component to be tested. Therefore, before switching the system, the embodiment of the present application can also first execute a judgment step, such as Figure 7As shown, the unit under test can determine whether there is a board name file in the root server 100 (referring to a file related to component design or production, used to record the name, model, version, or other identification information of the component). If it is determined that there is a board name file, the unit can load the operating system information (such as the installation data of the operating system), kernel information, and parameter information, etc. in the board name file. If it is determined that there is no board name file, it can determine whether there is a 01-MAC file. If there is a 01-MAC file, the unit under test can load the operating system information (such as the installation data of the target operating system), kernel information, and parameter information, etc. in the 01-MAC file. If it is determined that there is no 01-MAC file, it can determine whether there is a 02-MAC file. If there is a 02-MAC file, the unit under test can load the operating system information, kernel information, and parameter information, etc. in the 0-2MAC file.

[0102] After the above judgment steps, if the unit under test determines that there is no board name file in the memory and there is a 01-MAC file, it can load the 01MAC file, and switch the current operating system of the unit under test to the target operating system according to the target operating system information in the 01MAC file, so as to execute step S64 and test the component under test in the target operating system.

[0103] S64. The unit under test obtains the 01-MAC file from the root server, and in the target operating system, executes the target test script according to the target test script information in the 01-MAC file to test the component under test.

[0104] After the restart operation is completed, the unit under test can obtain the 01-MAC file from the root server 100, and in the target operating system, execute the target test script according to the target test script information in the 01-MAC file to test the component under test.

[0105] The implementation principle of step S64 is similar to that of step S33 in the first embodiment, and specific reference can be made to the description in the first embodiment, and no redundant description will be given here.

[0106] S65. The unit under test uploads the test result to the root server for storage.

[0107] As can be seen from the description in Embodiment 2, Suse OS may provide a more complete integration environment, which is more convenient for further analysis and processing of test data, thereby improving the processing efficiency of test data. Furthermore, after the component under test is tested in the target operating system in this embodiment, the unit under test can also switch the target operating system to Suse OS, and then process the test data under Suse OS. Since the data stored in the memory will disappear instantly once the unit under test loses power, the unit under test can upload the test results to the root server 100 for storage for subsequent use.

[0108] In some possible implementations, in order to save the storage space of the root server 100 and avoid interference of the 01-MAC file on subsequent tests, the device under test can delete the 01-MAC file generated by this test stored in the root server 100.

[0109] S66. The unit under test obtains the 02-MAC file from the root server.

[0110] The unit under test obtains the 02-MAC file from the root server 100, and the 02-MAC file includes the operating system information of Suse OS.

[0111] The implementation principle of step S66 is similar to that of step S41, and the specific description can refer to the description in step S41, and no redundant description will be given here.

[0112] S67. The unit under test switches the target operating system to Suse OS according to the operating system information of Suse OS in the 02-MAC file, and performs a restart operation after the system switch is completed.

[0113] The implementation principle of step S67 is similar to that of step S63, and the specific description can refer to the description in step S63, and no redundant description will be given here.

[0114] S68. The unit under test obtains the test data from the root server.

[0115] S69. The unit under test processes the test data in Suse OS to determine the test results.

[0116] In this embodiment, after obtaining the test information, the unit under test can store the test information in the generated 01-MAC file, upload the 01-MAC file to the root server 100 for storage. Moreover, after the unit under test completes the test of the component under test, it can also upload the test data to the root server 100 for storage. When relevant data needs to be used, the stored data can be obtained from the root server 100, thereby ensuring that the data will not be lost.

[0117] The following introduces the hardware structure of the unit under test provided by the embodiments of the present application. Refer to Figure 8 , Figure 8 which is a schematic diagram of the hardware structure of a unit under test provided by the embodiments of the present application.

[0118] As Figure 8 shown, the unit under test 1000 includes a processor 1010 and a memory 1020; wherein, the memory 1020 stores computer instructions, and the processor 1010 is configured to execute the computer instructions, so that the unit under test 1000 executes the component test method shown above.

[0119] In some embodiments, the processor 1010 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.

[0120] In some embodiments, the memory 1020 may be a volatile memory or a non-volatile memory, such as a register, etc. Specifically, a volatile memory refers to a memory in which the data stored internally is lost when the power supply is interrupted. Among them, the volatile memory is mainly a random access memory (RAM), including a static random access memory (SRAM) and a dynamic random access memory (DRAM). A non-volatile memory refers to a memory in which the data stored internally will not be lost even when the power supply is interrupted. Common non-volatile memories include read only memory (ROM), optical discs, magnetic disks, solid state drives, and various memory cards based on flash memory technology.

[0121] In some embodiments, the memory 1020 has executable code, and the memory 1010 executes the code to implement component testing.

[0122] The communication interface 1030 is used for external communication. For example, the communication interface 1030 serves as a first interface to implement communication with a real device.

[0123] The bus can be a Peripheral Component Interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of understanding, Figure 8 it is represented by only one thick line, but it does not mean that there is only one bus or one type of bus.

[0124] The embodiments of the present application also provide a computer program product containing instructions. The computer program product can be software or a program product containing instructions that can run on the unit under test or be stored in any available medium. When the computer program product runs on the unit under test, the unit under test is caused to execute the above-mentioned component testing method. The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium can be any available medium that the unit under test can store or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid-state drive), etc. The computer-readable storage medium includes instructions that instruct the unit under test to execute the above-mentioned component testing method.

[0125] In some possible implementation manners, the unit under test can be a server. Of course, this is only an example here and is not subject to any limitation.

[0126] The descriptions of the processes or structures corresponding to the above-mentioned respective drawings each have their own focuses. For parts not detailed in a certain process or structure, reference can be made to the relevant descriptions of other processes or structures.

[0127] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A component testing method, characterized in that, The method includes: Obtaining first test information corresponding to a first component to be tested, where the first test information includes target operating system information and target test script information; Switching the current operating system of the unit under test to the target operating system according to the target operating system information; In the target operating system, executing the target test script according to the target test script information to test the first component to be tested, where the target operating system is adapted to the test tool called by the target test script.

2. The method according to claim 1, wherein The first component to be tested is an NPU module, and the current operating system of the unit under test is switched to the target operating system required for testing the NPU module according to the target operating system information corresponding to the NPU module.

3. The method according to claim 1, wherein The method further includes: Obtaining second test information corresponding to a second component to be tested; Switching the target operating system of the unit under test to a second operating system required for testing the second component to be tested according to the operating system information in the second test information, where the second component to be tested is adapted to a different operating system from the first component to be tested; In the second operating system, executing the test script corresponding to the second component to be tested according to the test script information in the second test information to test the second component to be tested.

4. The method according to claim 3, wherein The method further includes: When the test of the first component to be tested is completed, uploading the test data of the first component to be tested to a root server for storage; When switching the target operating system to the second operating system required for testing the second component to be tested, obtaining the stored test data from the root server, where the second operating system for the second component to be tested is the Suse operating system; Determining the test result of testing the first component to be tested according to the test data.

5. The method according to claim 2, wherein The obtaining of the first test information corresponding to the first component to be tested includes: Generating a 01-MAC file according to pre-stored code, where the 01-MAC file is used to indicate the target operating system to which the target version needs to be switched; Obtaining the first test information corresponding to the first component to be tested from a cloud server according to the 01-MAC file.

6. The method according to claim 5, wherein The method further includes: Storing the test information in the 01-MAC file and uploading the 01-MAC file to a root server for storage; When switching the current operating system of the unit under test to the target operating system, the executing of the target test script according to the target test script information to test the first component to be tested includes: Obtaining the stored 01-MAC file from the root server; Executing the target test script according to the target test script information in the 01-MAC file to test the first component to be tested.

7. The method according to claim 1, characterized in that The switching of the current operating system of the unit under test to the target operating system according to the target operating system information includes: Using a preset installation script or an automated deployment tool, downloading and installing the corresponding version of the target operating system according to the installation data and kernel information of the target operating system; Configuring the network and drivers according to parameter information.

8. A component testing system, comprising a unit under test and a cloud server; The unit under test is configured to obtain test information corresponding to a first component to be tested from the cloud server, where the test information includes target operating system information and target test script information, switch the current operating system of the unit under test to the target operating system according to the target operating system information, and in the target operating system, execute the target test script according to the target test script information to test the first component to be tested, and the target operating system is adapted to the test tool called by the target test script; The cloud server is configured to provide test information of the first component to be tested for the unit under test through a network.

9. The system according to claim 8, further comprising a root server, where the root server is configured to store data uploaded by the unit under test; The unit under test is specifically configured to: Generate a 01-MAC file according to pre-stored code, where the 01-MAC file is used to indicate the target operating system that needs to be switched to the target version, obtain test information corresponding to the first component to be tested from the cloud server according to the 01-MAC file, and store the test information in the 01-MAC file and upload it to the root server for storage; When the current operating system of the unit under test is switched to the target operating system, obtain the stored 01-MAC file from the root server, and execute the target test script according to the target test script information in the 01-MAC file to test the first component to be tested.

10. A unit under test, characterized in that, Comprising a memory and a processor; A memory and a processor, where the memory is coupled to the processor; The memory stores program instructions, and when the program instructions are executed by the processor, the electronic device is caused to execute the method according to any one of claims 1-7.