Test method and device of board card equipment, storage medium and electronic equipment

By generating a set of target and reference test items and assembling them into a test script, the board devices can be controlled to execute test items simultaneously or sequentially, which solves the problem of low testing efficiency of board devices and realizes an efficient testing process.

CN119025347APending Publication Date: 2024-11-26INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411000891.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

Existing technologies for testing circuit boards have low efficiency and cannot meet the needs of server development.

Method used

By generating a set of target test items and a set of reference test items, and combining them into a test script, the test items can be executed simultaneously or sequentially by the control board devices, thus optimizing the test process.

Benefits of technology

It improves the testing efficiency of circuit board equipment, reduces testing time, and realizes an automated and efficient testing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025347A_ABST
    Figure CN119025347A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a board card equipment testing method and device, a storage medium and electronic device.The method comprises the steps that a testing request is obtained, and the testing request is used for requesting function testing of multiple to-be-tested board card equipment; in response to the test request, one or more target test item sets and a reference test item set are generated according to a board card configuration file of each board card device in the multiple board card devices, the board card configuration file is used for recording a to-be-executed test item of the corresponding board card device, and the to-be-executed test item of the corresponding board card device is stored in the reference test item set; each target test item set records target test items which are allowed to be executed at the same time on different board card devices; splicing the one or more target test item sets and the reference test item set into test scripts corresponding to a plurality of board card devices; and executing the test script. Through the method and the device, the problem of relatively low testing efficiency of the board card equipment is solved, so that the effect of improving the testing efficiency of the board card equipment is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computers, and more specifically, to a testing method, apparatus, storage medium and electronic device for a board device. Background Art

[0002] With the rapid development of computing power and the increase in server usage, server research and development and iterative updates have become particularly important. Every board device in the server must undergo power-on verification before leaving the factory. With the increase in factory output, the traditional testing method, that is, a test machine tests a single board device at a time, has failed to keep up with the needs of server development.

[0003] In view of the problems in related technologies such as low efficiency of board device testing, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiments of the present application provide a test method, apparatus, storage medium and electronic device for a board device, so as to at least solve the problem of low efficiency of board device testing in the related art.

[0005] According to an embodiment of the present application, a test method for a board device is provided, comprising:

[0006] Obtaining a test request, wherein the test request is used to request a functional test to be performed on a plurality of board devices to be tested;

[0007] In response to the test request, one or more target test item sets and a reference test item set are generated according to a board configuration file of each board device among the multiple board devices, wherein the board configuration file is used to record the test items to be executed by the corresponding board device, each of the target test item sets records the target test items that are allowed to be executed simultaneously on different board devices, and the reference test item set records the reference test items other than the target test items among the test items to be executed by the multiple board devices;

[0008] Splicing the one or more target test item sets and the reference test item set into a test script corresponding to the multiple board devices, wherein the test script is used to perform functional tests on the multiple board devices according to the arrangement order of the one or more target test item sets and the reference test item set;

[0009] Execute the test script.

[0010] In an exemplary embodiment, generating one or more target test item sets and a reference test item set based on a board configuration file of each board device among the multiple board devices includes: acquiring the board configuration file of each board device among the multiple board devices to obtain a configuration file set; extracting the target test items that are allowed to be executed simultaneously on different board devices from the configuration file set to obtain the one or more target test item sets, wherein each target test item set records the board devices and the target test items with a corresponding relationship; and adding the other test items except the target test items among the test items to be executed by the multiple board devices as the reference test items to the same test item set to obtain the reference test item set.

[0011] In an exemplary embodiment, the step of extracting the target test items that are allowed to be executed simultaneously on different board devices from a configuration file set to obtain the one or more target test item sets includes: extracting one of the board configuration files from the configuration file set as a candidate board configuration file, repeatedly performing the following steps until the configuration file set is empty, and obtaining the target test item sets corresponding to all the candidate board configuration files: extracting a test item from the candidate board configuration file as an initial candidate test item set, traversing each of the board configuration files except the candidate board configuration file in the configuration file set as an updated board configuration file, and repeatedly performing the following steps until the candidate board configuration file is empty: detecting, from the currently traversed updated board configuration file, test items that are in a parallel state with the current candidate test item set and are allowed to be executed simultaneously as updated test items; and when the updated test items are detected, using the updated test items as the target test items. The method comprises the steps of: adding the candidate test item to the current candidate test item set to obtain the next candidate test item set; deleting the candidate test item from the candidate board card configuration file and deleting the update test item from the currently traversed update board card configuration file; continuing to traverse the next update board card configuration file until all the board card configuration files except the candidate board card configuration file in the configuration file set are traversed, and determining the currently obtained candidate test item set as a target test item set; deleting the empty board card configuration file from the configuration file set; in the case where the update test item is not detected, continuing to traverse the next update board card configuration file until all the board card configuration files except the candidate board card configuration file in the configuration file set are traversed and the update test item is still not detected, deleting the candidate test item from the candidate board card configuration file and determining the candidate test item as the reference test item; deleting the empty board card configuration file from the configuration file set.

[0012] In an exemplary embodiment, the parallel state between the currently traversed update board configuration file and the current candidate test item set is detected as a test item that allows simultaneous execution as an update test item, including: extracting the candidate parallel identifier of the test item from the board configuration file corresponding to the test item in the current candidate test item set, and extracting the update parallel identifier of the test item from the currently traversed update board configuration file, wherein the parallel identifier of the test item is used to indicate the test item that allows parallel execution; determining the parallel state between the test item in the currently traversed update board configuration file and the current candidate test item set according to the candidate parallel identifier and the update parallel identifier; and determining the test items whose corresponding parallel states are all allowed to be executed simultaneously as the update test items.

[0013] In an exemplary embodiment, the splicing of the one or more target test item sets and the reference test item set into test scripts corresponding to the multiple board devices includes: generating a first test script according to the one or more target test item sets, wherein the first test script includes a plurality of parallel test instructions, and the parallel test instructions are used to control the multiple board devices to simultaneously execute the corresponding target test items according to the records in each target test item set, and the parallel test instructions include nohup sh testcard.sh N>test_N.log 2>&1&, nohup is used to run the process and control the process to ignore the hang-up signal, sh is used to control the board device to execute the corresponding test script, testcard.sh is the test script to be executed by the board device, the board device is used to execute the corresponding test script to complete the target test item, N is the location number of the test machine deployed by the board device, > is used to redirect the standard data output during the board device's execution of the test script to the specified file, test_N.log is the file where the standard data during the board device's execution of the test script is stored, 2>&1 is used to redirect the standard error data during the board device's execution of the test script to the specified file, & is used to execute the output file process during the board device's execution of the test script in the background; generate a second test script according to the reference test item set, wherein the second test script includes multiple serial test instructions, and the serial test instructions are used to control each board device to execute the corresponding candidate test item in sequence according to the records in the reference test item set; splice the first test script and the second test script into the test script corresponding to the multiple board devices.

[0014] In an exemplary embodiment, the method also includes: in the process of executing the test script, detecting the update time length of the monitoring record file and the failure record file, wherein the monitoring record file is used to record the test items that have been completed by the board device, and the failure record file is used to record the board device that failed the test, and the update time length is the distance between the time when the monitoring record file and the failure record file were last modified and the current time; when the update time length is greater than or equal to the time threshold, it is determined that the test script execution has timed out, and the timeout information is reported.

[0015] In an exemplary embodiment, before detecting the update time of the monitoring record file and the failure record file, the method also includes: starting a monitoring program; and detecting, through the monitoring program, the time when the board device starts to execute the test item as the time when the monitoring record file and the failure record file were last modified.

[0016] According to another embodiment of the present application, a testing device for a board device is provided, comprising:

[0017] An acquisition module, used for acquiring a test request, wherein the test request is used for requesting a plurality of board devices to be tested to perform a functional test;

[0018] A generating module, configured to respond to the test request and generate one or more target test item sets and a reference test item set according to a board configuration file of each board device among the multiple board devices, wherein the board configuration file is used to record the test items to be executed by the corresponding board device, each of the target test item sets records the target test items that are allowed to be executed simultaneously on different board devices, and the reference test item set records the reference test items other than the target test items among the test items to be executed by the multiple board devices;

[0019] A splicing module, used to splice the one or more target test item sets and the reference test item set into a test script corresponding to the multiple board devices, wherein the test script is used to perform functional tests on the multiple board devices according to the arrangement order of the one or more target test item sets and the reference test item set;

[0020] An execution module is used to execute the test script.

[0021] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0022] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0023] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0024] Through the present application, a test request is obtained, wherein the test request is used to request functional testing of multiple board devices to be tested; in response to the test request, one or more target test item sets and a reference test item set are generated according to a board configuration file of each board device in the multiple board devices, wherein the board configuration file is used to record the test items to be executed by the corresponding board device, each target test item set records the target test items that are allowed to be executed simultaneously on different board devices, and the reference test item set records the reference test items other than the target test items in the test items to be executed by the multiple board devices; one or more target test item sets and the reference test item set are spliced ​​into test scripts corresponding to multiple board devices, wherein the test script is used to perform functional testing on the multiple board devices according to the arrangement order of the one or more target test item sets and the reference test item set; and the test script is executed. That is to say, a target test item set and a reference test item set are generated, and the board device is controlled to execute the test script obtained by the target test item set and the reference test item set. Since the target test item set records the target test items that are allowed to be executed simultaneously on different board devices, during the execution of the target test item set, multiple board devices are allowed to execute the corresponding target test items according to the target test item set simultaneously, thereby reducing the time for the board device to execute the test items. Therefore, the problem of low efficiency of board device testing can be solved, and the effect of improving the efficiency of board device testing can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a hardware structure block diagram of a server device of a method for testing a board device according to an embodiment of the present application;

[0026] Figure 2 is a flow chart of a method for testing a board device according to an embodiment of the present application;

[0027] Figure 3 The following is a schematic diagram of a process of constructing target test items and reference test items according to an embodiment of the present application. Figure 1 ;

[0028] Figure 4 The following is a schematic diagram of a process of constructing target test items and reference test items according to an embodiment of the present application. Figure 2 ;

[0029] Figure 5 is a flow chart of executing a test script according to an embodiment of the present application;

[0030] Figure 6 is a schematic diagram of a working process of a test script according to an embodiment of the present application;

[0031] Figure 7 is a flow chart of a test process of a board device according to an embodiment of the present application;

[0032] Figure 8 is a structural block diagram of a test device for a board device according to an embodiment of the present application;

[0033] Fig. 9 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0034] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0036] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a board device testing method according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0037] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the test method of the board device in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0038] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0039] In this embodiment, a method for testing a board device is provided. Figure 2 is a flow chart of a method for testing a board device according to an embodiment of the present application. Figure 2 As shown, the process includes the following steps:

[0040] Step S202, obtaining a test request, wherein the test request is used to request a functional test to be performed on a plurality of board devices to be tested;

[0041] Step S204, in response to the test request, generating one or more target test item sets and reference test item sets according to a board configuration file of each board device among the multiple board devices, wherein the board configuration file is used to record the test items to be executed by the corresponding board device, each of the target test item sets records the target test items that are allowed to be executed simultaneously on different board devices, and the reference test item set records the reference test items other than the target test items among the test items to be executed by the multiple board devices;

[0042] Step S206, splicing the one or more target test item sets and the reference test item set into a test script corresponding to the multiple board devices, wherein the test script is used to perform functional tests on the multiple board devices according to the arrangement order of the one or more target test item sets and the reference test item set;

[0043] Step S208, executing the test script.

[0044] Through the above steps, a target test item set and a reference test item set are generated, and the board device is controlled to execute the test script obtained by the target test item set and the reference test item set. Since the target test item set records the target test items that are allowed to be executed simultaneously on different board devices, during the execution of the target test item set, multiple board devices are allowed to execute corresponding target test items according to the target test item set simultaneously, which reduces the time for the board device to execute the test items. Therefore, the problem of low efficiency of board device testing can be solved, and the effect of improving the efficiency of board device testing can be achieved.

[0045] Optionally, in the present embodiment, the testing method for the board and card device proposed in the present application is used in a wide range of scenarios, which may include but are not limited to: performing prototype testing on the board and card device to verify the correctness and feasibility of the design of the board and card device, testing each functional module of the board and card device during the development of the board and card device, regularly testing the server and the board and card device during the use of the board and card device, and testing the board and card device when a fault occurs to determine the cause of the fault and repair it, etc. In the following embodiments, the testing method for the board and card device may be described by taking, but not limited to, the scenario of testing each functional module of the board and card device as an example, but the usage scenario is not limited. The testing method for the board and card device proposed in the present application can be used in any scenario that requires functional testing of the board and card device.

[0046] Optionally, in this embodiment, the test method of the board device proposed in this application can be applied to, but not limited to, a test tool that performs functional tests on the board device, and the functional tests can include, but not limited to: performing circuit functional tests on the hardware of the board device, and performing software functional tests on the software of the board device. Since the board device needs to be powered on (for example, the board device is powered on by the mainboard) before executing the subsequent test process, the test tool can be, but not limited to, a test program running in the operating system of the device that powers on the board device, or can also be other independent electronic devices.

[0047] Optionally, in this embodiment, the above-mentioned board device may include but is not limited to: a smart network card, a storage acceleration card, a network acceleration card, and other expansion cards or modules that are allowed to be installed in a computer or other electronic device.

[0048] In the technical solution provided in the above step S202, the above test request can be but is not limited to being triggered in multiple situations, such as: triggering a test request when testing a functional module of a board device, triggering a test request when a board device fails, etc.

[0049] Optionally, in this embodiment, the above-mentioned test request may, but is not limited to, carry the board device identification of each board device to be tested, and the test tool obtains the board configuration file of each board device according to the board device identification; or, the board configuration file may be carried as the board device identification of the board device in the test request and sent down.

[0050] Optionally, in this embodiment, a group of completely identical board devices can be used as the board devices to be tested, or a group of different board devices can be used as the board devices to be tested. It should be noted that different board devices include: board devices of the same type but with different models, board devices of different types, etc.

[0051] Optionally, in the present embodiment, a group of different board devices are used as the above-mentioned board devices to be tested for functional testing, but not limited to: connecting multiple board devices to the mainboard for testing at the same time, and deploying multiple board devices on the same test tool for testing at the same time. It should be noted that whether a group of different board devices execute the test process at the same time, or a group of identical board devices execute the test process at the same time, only when the test items executed at the same time do not affect the test results, they are allowed to execute simultaneously, such as: for multiple network card devices, testing the working condition of its NCSI interface requires connecting the network card device to the mainboard, but due to the number of interfaces on the mainboard device, only one network card device is allowed to be tested at a time, so the NCSI interface is not allowed to be executed simultaneously as a test item. Or, for testing the bandwidth usage of the board device, since the bandwidth is allowed to be distributed to multiple board devices, only the bandwidth usage of one board device is allowed to be tested at a time, so the bandwidth usage is not allowed to be executed simultaneously as a test item.

[0052] In the technical solution provided in the above step S204, the above functional test may include, but is not limited to: performing a circuit functional test on the hardware of the board device, and performing a software functional test on the software of the board device. For the same board device, the test items performed in the circuit functional test on the hardware and the software functional test on the software are different.

[0053] Optionally, in this embodiment, the board configuration file of each board device may record, but is not limited to, the test items that need to be executed for the functional test of each aspect of the board device. When a test request is received, the test items corresponding to the functional test of the current aspect are extracted from the board configuration file according to the test request. Alternatively, the test items corresponding to the aspect of the functional test to be executed are extracted from the test request.

[0054] In an exemplary embodiment, one or more target test item sets and a reference test item set can be generated according to a board configuration file of each board device among the multiple board devices in the following manner, but is not limited to: obtaining the board configuration file of each board device among the multiple board devices to obtain a configuration file set; extracting the target test items that are allowed to be executed simultaneously on different board devices from the configuration file set to obtain the one or more target test item sets, wherein each target test item set records the board devices and the target test items that have a corresponding relationship; adding the other test items except the target test items among the test items to be executed by the multiple board devices as the reference test items to the same test item set to obtain the reference test item set.

[0055] Optionally, in this embodiment, for the same board device, it may correspond to the same board configuration file, therefore, when the multiple board devices to be tested include multiple different board devices, the board configuration file corresponding to each different board device is obtained to obtain a configuration file set. Alternatively, the corresponding board configuration file may be configured for each board device according to different test scenarios.

[0056] Optionally, in this embodiment, the configuration file set includes multiple board configuration files, and the board configuration files record the test items to be executed by the corresponding board devices. The target test items that are allowed to be executed simultaneously on different board devices can be extracted from the configuration file set by, but not limited to, the following method:

[0057] Extract a board configuration file from the configuration file set as a candidate board configuration file, take each test item in the candidate board configuration file as a candidate test item, take each candidate test item as a candidate test item set to obtain multiple candidate test item sets, traverse each board configuration file in the configuration file set except the candidate board configuration file as an updated board configuration file, and repeat the following steps until the configuration file set is empty:

[0058] Traverse each test item in the update board configuration file as an update test item, and repeat the following steps until the update board configuration file is empty: detect from multiple initial candidate test item sets that the parallel state between the currently traversed update test item is a candidate test item set that allows simultaneous execution;

[0059] When it is detected that the parallel state between the currently traversed update test item and the candidate test item set allowed to be executed simultaneously is the same, the currently traversed update test item is added to the candidate test item set allowed to be executed simultaneously; the currently traversed update test item is deleted from the update board configuration file; the update test items are continued to be traversed until each board configuration file in the configuration file set except the candidate board configuration file is traversed; each test item in the candidate test item set including only a single test item in the multiple candidate test item sets currently obtained is determined as a reference test item, and the reference test item is added to the same test item set to obtain a reference test item set; or, each candidate test item set in the candidate test item set including multiple test items in the multiple candidate test item sets currently obtained is determined as a target test item set.

[0060] In the case that no candidate test item set is detected whose parallel status with the currently traversed update test item is allowed to be executed simultaneously, use the currently traversed update test item as a candidate test item set, continue to traverse the update test items until each board configuration file in the configuration file set except the candidate board configuration file is traversed; determine each test item in the candidate test item set that only includes a single test item in the multiple candidate test item sets currently obtained as a reference test item, add the reference test item to the same test item set to obtain a reference test item set; or, determine each candidate test item set in the candidate test item set that includes multiple test items in the multiple candidate test item sets currently obtained as a target test item set.

[0061] Optionally, in this embodiment, Figure 3 The following is a schematic diagram of a process of constructing target test items and reference test items according to an embodiment of the present application. Figure 1 ,like Figure 3 As shown, the configuration file set includes a board configuration file 1 and a board configuration file 2, the board configuration file 1 records the test items A-1, A-2 and A-3 to be executed by the board device A, and the board configuration file 2 records the test items B-1 and B-2 to be executed by the board device B. The target test items and the reference test items can be screened in the following ways, but are not limited to:

[0062] Extract board configuration file 1 as a candidate board configuration file, use test item A-1, test item A-2 and test item A-3 in board configuration file 1 as a candidate test item set respectively, obtain candidate test item set A-1, candidate test item set A-2 and candidate test item set A-3, traverse the test items in board configuration file 2, use the currently traversed test item B-1 as an updated test item, and detect whether there is a test item that is allowed to be used with test item B-1 in candidate test item set A-1, candidate test item set A-2 and candidate test item set A-3 For a candidate test item set to be executed simultaneously, when the candidate test item set A-1, the candidate test item set A-2 and the candidate test item set A-3 are all not allowed to be executed simultaneously with the test item B-1, use the test item B-1 as a new candidate test item set, traverse the test items in the board configuration file 2, use the currently traversed test item B-2 as the updated test item, and detect whether there is a candidate test item set that is allowed to be executed simultaneously with the test item B-2 in the candidate test item set A-1, the candidate test item set A-2 and the candidate test item set A-3. It should be noted that two test items of the same board device are not allowed to be executed simultaneously, that is, the test item B-2 is not allowed to be added to the candidate test item set B-1 constructed using the test item B-1.

[0063] Alternatively, taking the example of allowing test item B-1 to be executed simultaneously with all test items included in candidate test item set A-1, that is, test item A-1, test item B-1 (that is, the target test item) is added to candidate test item set A-1, the test items in board configuration file 2 are traversed, and the currently traversed test item B-2 is used as the updated test item, and it is detected whether there is a candidate test item set in candidate test item set A-2 and candidate test item set A-3 that is allowed to be executed simultaneously with test item B-2. It should be noted that for the same board device, two test items are not allowed to be executed simultaneously, that is, test item B-2 is not allowed to be added to candidate test item set A-1 that includes test item B-1.

[0064] In the above process of extracting target test items and reference test items, the test items that can be executed in parallel are gradually screened out by traversing the board configuration files one by one, ensuring that each test item undergoes a detailed parallelism check. During the traversal process, a single test item or a collection of multiple test items can be flexibly processed to adapt to different test requirements and configurations, and the candidate test item collection and the updated test item collection are continuously updated. The test items that can be executed in parallel are dynamically adjusted to improve the flexibility and efficiency of the test. In the case of complex dependencies between test items, the above process is used to gradually screen and update to ensure that the test items executed in parallel do not affect each other.

[0065] In an exemplary embodiment, the target test items that are allowed to be executed simultaneously on different board devices can be extracted from the configuration file set in the following manner, but is not limited to: extracting one of the board configuration files from the configuration file set as a candidate board configuration file, and repeatedly performing the following steps until the configuration file set is empty, to obtain the target test item set corresponding to all the candidate board configuration files: extracting a test item from the candidate board configuration file as an initial candidate test item set, traversing each of the board configuration files except the candidate board configuration file in the configuration file set as an updated board configuration file, and repeatedly performing the following steps until the candidate board configuration file is empty: detecting from the currently traversed updated board configuration file a test item that is in a parallel state with the current candidate test item set and is allowed to be executed simultaneously as an updated test item; and when the updated test item is detected, using the updated test item as the Add the target test item to the current candidate test item set to obtain the next candidate test item set; delete the candidate test item from the candidate board card configuration file and delete the update test item from the currently traversed update board card configuration file; continue to traverse the next update board card configuration file until all the board card configuration files except the candidate board card configuration file in the configuration file set are traversed, and determine the currently obtained candidate test item set as a target test item set; delete the empty board card configuration file from the configuration file set; if the update test item is not detected, continue to traverse the next update board card configuration file until all the board card configuration files except the candidate board card configuration file in the configuration file set are traversed and the update test item is still not detected, delete the candidate test item from the candidate board card configuration file and determine the candidate test item as the reference test item; delete the empty board card configuration file from the configuration file set.

[0066] Optionally, in this embodiment, Figure 4 The following is a schematic diagram of a process of constructing target test items and reference test items according to an embodiment of the present application. Figure 2 ,like Figure 4 As shown, the configuration file set includes a board configuration file 1 and a board configuration file 2, the board configuration file 1 records the test items A-1, A-2 and A-3 to be executed by the board device A, the board configuration file 2 records the test items B-1 and B-2 to be executed by the board device B, and the board configuration file 3 records the test items C-1, C-2 and C-3 to be executed by the board device C. The target test items and the reference test items can be screened in the following ways, but are not limited to:

[0067] Extract board configuration file 1 from the configuration file set as a candidate board configuration file, and repeat the following steps until the configuration file set is empty, and obtain the target test item set corresponding to all candidate board configuration files:

[0068] Extract test item A-1 from board configuration file 1 as the initial candidate test item set, traverse each board configuration file in the configuration file set except board configuration file 1 as the updated board configuration file, and repeat the following steps until board configuration file 1 is empty:

[0069] Taking the updated board configuration file currently traversed as board configuration file 2 as an example, it is detected whether the test item B-1 included in the board configuration file 2 is allowed to be executed simultaneously with the test item A-1 included in the candidate test item set;

[0070] If the test item B-1 is allowed to be executed simultaneously with the test item A-1, the test item B-1 is added as a target test item to the current candidate test item set to obtain the next candidate test item set, and the test item B-1 is deleted from the board configuration file 2 (it should be noted that, if the candidate test item set includes multiple test items, it is necessary to detect whether each test item included in the candidate test item set is allowed to be executed simultaneously with the test item B-1. Only if the test item B-1 is executed simultaneously with each test item included in the candidate test item set, the test item B-1 is added as a target test item to the candidate test item set);

[0071] When test item B-1 is not allowed to be executed simultaneously with test item A-1, detect whether the next test item B-2 of test item B-1 allows test item A-1 to be executed simultaneously. When each test item in board configuration file 2 is not allowed to be executed simultaneously with test item A-1, use board configuration file 3 as the updated board configuration file.

[0072] If no test item allowed to be executed simultaneously with test item A-1 is detected after traversing all board configuration files in the configuration file set except board configuration file 1, test item A-1 is deleted from board configuration file 1 and is determined as a reference test item.

[0073] In the above process, by extracting one test item at a time as a candidate test item set, the traversal and screening process is simplified, the processing complexity is reduced, and the test items that can be executed in parallel are quickly determined, the number of traversals is reduced, and the efficiency of determining the target test items is improved. After the test items that can be executed in parallel are detected, they are directly added to the target test item set and deleted from the candidate and update configuration files, reducing unnecessary traversals. The scheme structure is simple and easy to expand and modify to adapt to different testing requirements and configuration changes. By simplifying the traversal process and quickly determining the target test items, the efficiency of determining the target test items is improved when the test item dependencies are relatively simple or clear.

[0074] In an exemplary embodiment, the following method can be used but is not limited to detect test items that are allowed to be executed simultaneously from the currently traversed update board configuration file and the current candidate test item set in a parallel state as update test items: extract candidate parallel identifiers of test items from the board configuration file corresponding to the test items in the current candidate test item set, and extract update parallel identifiers of test items from the currently traversed update board configuration file, wherein the parallel identifier of the test item is used to indicate the test items that are allowed to be executed in parallel; determine the parallel state between the test items in the currently traversed update board configuration file and the current candidate test item set based on the candidate parallel identifier and the update parallel identifier; and determine the test items whose corresponding parallel states are all allowed to be executed simultaneously as the update test items.

[0075] Optionally, in this embodiment, when the candidate test items included in the candidate test item set and the updated test items corresponding to the updated board card configuration file are the same board card device, the board card configuration file corresponding to the candidate test items and the updated test items are the same board card configuration file, and the correspondence between the test items and whether the test items are allowed to be executed simultaneously can be, but is not limited to, written into the board card configuration file as a parallel identifier, for example: taking the format of the parallel identifier as test item name-whether simultaneous execution is allowed, 1 indicates that simultaneous execution is allowed, and 0 indicates that simultaneous execution is not allowed. For example, testitemA-1 recorded in the board card configuration file is used to indicate that multiple identical board card devices are allowed to execute the test item testitemA simultaneously, and testitemC-0 recorded in the board card configuration file is used to indicate that multiple identical board card devices are not allowed to execute the test item testitemC simultaneously.

[0076] Alternatively, in the case where the candidate test items included in the candidate test item set and the updated test items corresponding to the updated board configuration file are different board devices, and the board configuration files corresponding to the candidate test items and the updated test items are different board configuration files, the corresponding relationship between the current test item and the test items allowed to be executed simultaneously with the current test item can be written into the board configuration file as a parallel identifier, but is not limited to it. For example, taking the parallel identifier format of the current test item-the test item allowed to be executed simultaneously with the current test item as an example, the parallel identifier testitemB-testitemD-testitemA is used to indicate that the test item testitemB is allowed to be executed simultaneously with testitemD and testitemA. It should be noted that testitemD and testitemA are test items recorded in a board configuration file different from the board configuration file to which the current test item belongs.

[0077] In the technical solution provided in the above step S206, it is possible but not limited to splicing one or more target test item sets after the reference test item set to obtain test scripts corresponding to multiple board devices; or, splicing one or more target test item sets after the reference test item set to obtain test scripts corresponding to multiple board devices.

[0078] In an exemplary embodiment, the one or more target test item sets and the reference test item set may be spliced ​​into test scripts corresponding to the multiple board devices in the following manner, but is not limited to: a first test script is generated according to the one or more target test item sets, wherein the first test script includes a plurality of parallel test instructions, and the parallel test instructions are used to control the multiple board devices to simultaneously execute the corresponding target test items according to the records in each target test item set, and the parallel test instructions include nohup sh testcard.sh N>test_N.log 2>&1&, nohup is used to run the process and control the process to ignore the hang-up signal, sh is used to control the board device to execute the corresponding test script, testcard.sh is the test script to be executed by the board device, the board device is used to execute the corresponding test script to complete the target test item, N is the location number of the test machine deployed by the board device, > is used to redirect the standard data output during the board device's execution of the test script to the specified file, test_N.log is the file where the standard data during the board device's execution of the test script is stored, 2>&1 is used to redirect the standard error data during the board device's execution of the test script to the specified file, & is used to execute the output file process during the board device's execution of the test script in the background; generate a second test script according to the reference test item set, wherein the second test script includes multiple serial test instructions, and the serial test instructions are used to control each board device to execute the corresponding candidate test item in sequence according to the records in the reference test item set; splice the first test script and the second test script into the test script corresponding to the multiple board devices.

[0079] Optionally, in this embodiment, taking controlling N board devices to simultaneously execute corresponding target test items as an example, the first test script may include but is not limited to the following contents:

[0080] nohup sh testcard.sh 1>test_1.log 2>&1&; / / Run the testcard.sh script in the background, redirect both the standard output and standard error to the log file with 1 as the suffix, and ignore the hangup signal;

[0081] nohup sh testcard.sh 2>test_2.log 2>&1&; / / Run the testcard.sh script in the background, redirect both the standard output and standard error to the log file with 2 as the suffix, and ignore the hangup signal;

[0082] ……;

[0083] nohup sh testcard.sh N>test_N.log 2>&1&; / / Run the testcard.sh script in the background, redirect both the standard output and standard error to the log file with N as the suffix, and ignore the hangup signal.

[0084] Use nohup to wake up the test process of N board devices. The nohup command allows the test process to continue running in the background. Even if the terminal is closed or the user logs out, the test process will not stop. Putting the test process of N board devices into the background for execution not only realizes multi-process synchronous execution, but also reduces the occupation of terminal resources and improves the utilization efficiency of system resources. Furthermore, the nohup command is used together with the redirection operation to redirect the standard output and standard error output of the program to the specified file for subsequent viewing and analysis.

[0085] Optionally, in this embodiment, taking controlling a board device in a reference test item set to execute a corresponding candidate test item as an example, the serial test instruction may include but is not limited to:

[0086] First, create an empty file through touch.lockfile (touch command). If the file already exists, update its timestamp. The purpose of using the touch.lockfile command here is to ensure that the .lockfile file exists for performing initialization operations.

[0087] If the .lockfile file exists, create a soft link from .lockfile to .lockfileln through In-s.lickfile.lockfileln (In command). The -s option indicates the creation of a soft link (symbolic link). The return value is 0, indicating that the soft link is created successfully.

[0088] If the soft link is successfully created, it is considered that the board device corresponding to the current candidate test item "locks" the process executing the candidate test item, that is, the current process is "exclusively occupied". If the soft link fails to be created, it is considered that the process currently executing the test item is exclusively occupied by other board devices and cannot be used.

[0089] Furthermore, for the board device corresponding to the candidate test item, a timeout period, such as 1800 seconds, can be set. If the timeout period occurs, the test item directly fails and exits with exit 1.

[0090] Using soft links as a locking mechanism is relatively simple and does not require complex programming logic or additional library support. In addition, most modern operating systems currently support soft links, which allows the above method to be applied to most current operating systems. When the process of creating a soft link ends, the soft link can be automatically deleted, reducing the additional cleanup process, achieving automated processing, and reducing errors caused by improper manual operations, such as accidental deletion or overwriting of important files.

[0091] In the technical solution provided in the above step S208, the test script may be, but is not limited to, sent to a corresponding test tool to execute the corresponding test item.

[0092] In an exemplary embodiment, the following steps may be included but are not limited to: in the process of executing the test script, the update time length of the monitoring record file and the failure record file is detected, wherein the monitoring record file is used to record the test items that have been completed by the board device, and the failure record file is used to record the board device that failed the test, and the update time length is the distance between the time when the monitoring record file and the failure record file were last modified and the current time; when the update time length is greater than or equal to the time threshold, it is determined that the test script execution has timed out, and the timeout information is reported.

[0093] Optionally, in this embodiment, the time for the board device to execute the test item is extracted from the target information. When the time for the board device to execute the test item exceeds a time threshold, it is determined that the test script execution has timed out, and the timeout information is reported.

[0094] In an exemplary embodiment, before the update time of the monitoring log file and the failure log file is detected, the last modification time of the monitoring log file and the failure log file can be obtained in the following manner but is not limited to: starting the monitoring program; using the monitoring program to detect the time when the board device starts to execute the test item as the last modification time of the monitoring log file and the failure log file.

[0095] In one exemplary embodiment, an example of a process for executing a test script is provided. Figure 5 is a flowchart of executing a test script according to an embodiment of the present application, such as Figure 5 As shown, taking the test script executed by the main program as the configuration file items.cfg as an example, multiple target test item sets can be executed in the following ways, but are not limited to:

[0096] The main program reads a target test item set from the configuration file items.cfg;

[0097] The main program determines whether a set of target test items to be executed is obtained;

[0098] When a target test item set is obtained, multiple board devices are controlled to execute corresponding target test items at the same time;

[0099] Obtain the return value of the test item executed by the board device, wherein the return value is used to indicate whether the target test item is executed successfully;

[0100] When a return value of 0 indicating successful execution of the target test item is obtained, the next target test item set is read from the configuration file items.cfg until all target test item sets are completed;

[0101] When the return value is not 0, the test fails and the failure data is obtained from the monitoring program.

[0102] The reference test item set may be executed in the following ways, but is not limited to:

[0103] The main program reads a reference test item from the configuration file items.cfg;

[0104] The main program determines whether the reference test items to be executed are obtained;

[0105] When the reference test items are obtained, the board device is controlled to execute the reference test items;

[0106] Obtaining the return value of the reference test item executed by the board device, wherein the return value is used to indicate whether the reference test item is executed successfully;

[0107] When a return value of 0 indicating successful execution of a reference test item is obtained, the next reference test item is read from the configuration file items.cfg until all reference test items are completed;

[0108] When the return value is not 0, the test fails and the failure data is obtained from the monitoring program.

[0109] In one exemplary embodiment, an example of a test script is provided. Figure 6 is a schematic diagram of a working process of a test script according to an embodiment of the present application, such as Figure 6 As shown, taking the board devices to be tested as the same board devices as an example, the parallel flags of the test items to be executed by the board devices are obtained from the board configuration files of each board device to be tested.

[0110] Determine the test items that the board device is allowed to execute according to the parallel flag;

[0111] For the test items to be executed with the parallel flag of 1, a command for executing the corresponding test item is constructed and added to the test script, and the board device to be tested is controlled by the command to execute the test items simultaneously;

[0112] For the test items to be executed with the parallel flag of 0, a touch command is constructed for each test item and added to the test script. The touch command (touch.lockfile) is used to detect whether the .lockfile file exists. If the .lockfile file does not exist, the .lockfile file is created; and a ln command (In-s.Iockfile.lockfileln) is constructed for each test item and added to the test script. When the touch command is executed, a soft link is created through the ln command.

[0113] Optionally, in this embodiment, in order to better understand the testing process of the above-mentioned board and card device in the testing method of the board and card device proposed in this application, the above-mentioned process is described in combination with an optional embodiment below, but it is not used to limit the technical solution of the embodiment of this application.

[0114] In an exemplary embodiment, an example of a testing process of a board device is provided. Figure 7 is a flow chart of a test process of a board device according to an embodiment of the present application, such as Figure 7 As shown, the test process of the board device can be completed through but not limited to the following process:

[0115] For each board device, the main test program testcard.sh N of each board device may be started but is not limited to, where N is the identification of the board device, and the main test program controls the board device to execute a corresponding test process.

[0116] Before the board device executes the test process, start the start.sh program (monitoring program) to monitor the test progress of all board devices until all board devices are tested or fail. The monitoring method is to continuously scan the contents of MONITOR.txt (monitoring record file) and FailedQN.txt (failure record file) to achieve.

[0117] MONITOR.txt is used to record the test items that each board device has completed. For example, in MONITOR.txt, the information recorded in the format of test item name-slot number includes testitemA-1, testitemA-2, testitemB-1, and testitemA-3, indicating that board device No. 1 has completed test items testitemA and testitemB, board No. 2 has completed testitemA, and board No. 3 has completed testitemA. At this time, the slot number is the location number of the test machine where the board device is deployed.

[0118] FailedQN.txt is used to record the SN information of the failed test. For example, FailedQN.txt follows the format: SN slot number: board device SN code record information including SN1: 123456789000001, SN2: 123456789000002, indicating that board device 1 and board device 2 have failed the test, and their SNs are 123456789000001 and 123456789000002. It should be noted that when the board device is deployed on the test machine, the SN code of the board device needs to be bound to the slot number of the test machine.

[0119] The process of start.sh program monitoring and outputting test progress includes three layers of loops, the outermost layer is loop A, the middle layer is loop B, and the innermost layer is loop C, as follows:

[0120] First, loop A starts looping according to the test items in the test script. Each loop obtains the test item name item_name and the line number item_line of the test item in the test script, and then executes loop B.

[0121] Loop B is a loop that runs once per second. Its purpose is to monitor the execution time of loop C and continue to execute loop C.

[0122] In loop C, the test is executed according to the loop of board device 1, board device 2, ..., board device N (here is the test order in the test script). Each time the start.sh program completes a test, it reads the test completion record in MONITOR.txt and the test failure record in FailedQN.txt.

[0123] If the test completion record of the test item of the current board device can be read in MONITOR.txt, it means that the test item of this board device has been tested; if loop B reaches 1800 times, and there is neither a test completion record nor a test failure record in MONITOR.txt and FailedQN.txt, it means that the test item of this board device has timed out and failed, then the test failure record of this board device will be written into FailedQN.txt; if loop B does not reach 1800 times, and there is neither a test completion record nor a test failure record in MONITOR.txt and FailedQN.txt, it means that this board device has not yet completed this test item; if there is a failure record in FailedQN.txt, it means that this board device has failed. Based on the above information, the current test progress can be output from the screen.

[0124] Through the testing method of the board device proposed in this application, by mixing parallel and serial calls to multiple board test programs, the testing efficiency can be further improved on the basis of one-to-many, greatly saving time costs. Through the automated scheduling program start.sh and the monitoring mechanism, the testing process is automated, reducing manual intervention and the possibility of operational errors. Resource locking is achieved through the soft link mechanism to ensure that the test items will not be interfered with by other processes during execution, avoiding conflicts during concurrent execution, and being independent of specific hardware or software environments, thereby achieving improved testing efficiency, reduced costs, improved automation, and enhanced system stability and reliability.

[0125] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0126] In this embodiment, a test device for a board device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0127] Figure 8 is a structural block diagram of a test device for a board device according to an embodiment of the present application, such as Figure 8 As shown, the device comprises:

[0128] An acquisition module 82 is used to acquire a test request, wherein the test request is used to request a functional test to be performed on a plurality of board devices to be tested;

[0129] A generating module 84, configured to respond to the test request and generate one or more target test item sets and a reference test item set according to a board configuration file of each board device among the multiple board devices, wherein the board configuration file is used to record the test items to be executed by the corresponding board device, each of the target test item sets records the target test items that are allowed to be executed simultaneously on different board devices, and the reference test item set records the reference test items other than the target test items among the test items to be executed by the multiple board devices;

[0130] A splicing module 86, used to splice the one or more target test item sets and the reference test item set into a test script corresponding to the multiple board devices, wherein the test script is used to perform functional tests on the multiple board devices according to the arrangement order of the one or more target test item sets and the reference test item set;

[0131] The execution module 88 is used to execute the test script.

[0132] Through the above device, a target test item set and a reference test item set are generated, and the board device is controlled to execute the test script obtained by the target test item set and the reference test item set. Since the target test item set records the target test items that are allowed to be executed simultaneously on different board devices, during the execution of the target test item set, multiple board devices are allowed to execute the corresponding target test items according to the target test item set simultaneously, which reduces the time for the board device to execute the test items. Therefore, the problem of low efficiency of board device testing can be solved, and the effect of improving the efficiency of board device testing can be achieved.

[0133] In an exemplary embodiment, the generating module comprises:

[0134] An acquiring unit, configured to acquire the board configuration file of each of the plurality of board devices to obtain a configuration file set;

[0135] An extraction unit is used to extract the target test items that are allowed to be executed simultaneously on different board devices from the configuration file set to obtain the one or more target test item sets, wherein each target test item set records the board device and the target test item that have a corresponding relationship;

[0136] The adding unit is used to add other test items except the target test items among the test items to be executed by the multiple board devices as the reference test items to the same test item set to obtain the reference test item set.

[0137] In an exemplary embodiment, the extraction unit is used to extract one of the board configuration files from the configuration file set as a candidate board configuration file, and repeatedly perform the following steps until the configuration file set is empty, thereby obtaining the target test item set corresponding to all the candidate board configuration files:

[0138] Extract a test item from the candidate board configuration file as an initial candidate test item set, traverse each board configuration file except the candidate board configuration file in the configuration file set as an update board configuration file, and repeat the following steps until the candidate board configuration file is empty: detect from the currently traversed update board configuration file a test item whose parallel status with the current candidate test item set is allowed to be executed simultaneously as an update test item; in the case of detecting the update test item, add the update test item as the target test item to the current candidate test item set to obtain the next candidate test item set; delete the candidate test item from the candidate board configuration file and delete the update test item from the currently traversed update board configuration file; continue to traverse the next update board configuration file until all the board configuration files except the candidate board configuration file in the configuration file set are traversed, and determine the currently obtained candidate test item set as a target test item set; delete the empty board configuration file from the configuration file set;

[0139] If the update test item is not detected, continue to traverse the next updated board card configuration file until all the board card configuration files in the configuration file set except the candidate board card configuration file are traversed and the update test item is still not detected, delete the candidate test item from the candidate board card configuration file and determine the candidate test item as the reference test item; delete the empty board card configuration file from the configuration file set.

[0140] In an exemplary embodiment, the extraction unit is further used to: extract candidate parallel identifiers of test items from a board configuration file corresponding to a test item in the current candidate test item set, and extract updated parallel identifiers of test items from the currently traversed updated board configuration file, wherein the parallel identifier of a test item is used to indicate a test item that is allowed to be executed in parallel; determine the parallel status between the test item in the currently traversed updated board configuration file and the current candidate test item set based on the candidate parallel identifier and the updated parallel identifier; and determine the test items whose corresponding parallel statuses are all allowed to be executed simultaneously as the updated test items.

[0141] In an exemplary embodiment, the splicing module comprises:

[0142] A first generating unit is used to generate a first test script according to the one or more target test item sets, wherein the first test script includes multiple parallel test instructions, and the parallel test instructions are used to control multiple board devices to simultaneously execute corresponding target test items according to the records in each target test item set. The parallel test instructions include nohup sh testcard.sh N>test_N.log 2>&1&, nohup is used to run a process and control the process to ignore a hangup signal, sh is used to control the board device to execute a corresponding test script, testcard.sh is a test script to be executed by the board device, and the board device is used to execute the corresponding test script to complete the target test item, N is a location number of a test machine deployed by the board device, > is used to redirect standard data output during the board device's execution of the test script to a specified file, test_N.log is a file where standard data is stored during the board device's execution of the test script, 2>&1 is used to redirect standard error data during the board device's execution of the test script to a specified file, and & is used to execute the output file process during the board device's execution of the test script in the background;

[0143] A second generating unit, configured to generate a second test script according to the reference test item set, wherein the second test script includes a plurality of serial test instructions, and the serial test instructions are used to sequentially control each board device to execute the corresponding candidate test item according to the records in the reference test item set;

[0144] A splicing unit is used to splice the first test script and the second test script into a test script corresponding to the multiple board devices.

[0145] In an exemplary embodiment, the apparatus further comprises:

[0146] A first detection module is used to detect the update time length of the monitoring record file and the failure record file during the execution of the test script, wherein the monitoring record file is used to record the test items that have been completed by the board device, and the failure record file is used to record the board device that failed the test, and the update time length is the distance between the time when the monitoring record file and the failure record file were last modified and the current time;

[0147] The processing module is used to determine that the test script execution has timed out and report timeout information when the update time length is greater than or equal to a time threshold.

[0148] In an exemplary embodiment, before the update time of the detection monitoring log file and the failure log file, the device further includes:

[0149] A startup module is used to start the monitoring program;

[0150] The second detection module is used to detect the time when the board device starts to execute the test item through the monitoring program as the time when the monitoring record file and the failure record file were last modified.

[0151] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0152] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0153] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0154] An embodiment of the present application further provides an electronic device, Fig. 9 is a structural block diagram of an electronic device according to an embodiment of the present application, such as Fig. 9 As shown, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the method embodiments described above.

[0155] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0156] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0157] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0158] The embodiments of the present application also provide a computer program, which includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any one of the above method embodiments.

[0159] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0160] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0161] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A test method for a board device, It is characterized in that include: Obtaining a test request, wherein the test request is used to request a functional test to be performed on a plurality of board devices to be tested; In response to the test request, one or more target test item sets and a reference test item set are generated according to a board configuration file of each board device among the multiple board devices, wherein the board configuration file is used to record the test items to be executed by the corresponding board device, each of the target test item sets records the target test items that are allowed to be executed simultaneously on different board devices, and the reference test item set records the reference test items other than the target test items among the test items to be executed by the multiple board devices; Splicing the one or more target test item sets and the reference test item set into a test script corresponding to the multiple board devices, wherein the test script is used to perform functional tests on the multiple board devices according to the arrangement order of the one or more target test item sets and the reference test item set; Execute the test script.

2. The method according to claim 1, It is characterized in that The step of generating one or more target test item sets and a reference test item set according to a board configuration file of each board device among the plurality of board devices comprises: Obtain the board configuration file of each of the board devices in the plurality of board devices to obtain a configuration file set; Extracting the target test items that are allowed to be executed simultaneously on different board devices from the configuration file set to obtain the one or more target test item sets, wherein each target test item set records the board devices and the target test items that have a corresponding relationship; The other test items except the target test items among the test items to be executed by the multiple board devices are added as the reference test items to the same test item set to obtain the reference test item set.

3. The method according to claim 2, It is characterized in that Extracting the target test items that are allowed to be executed simultaneously on different board devices from the configuration file set to obtain the one or more target test item sets includes: Extracting one of the board configuration files from the configuration file set as a candidate board configuration file, and repeatedly performing the following steps until the configuration file set is empty, thereby obtaining the target test item set corresponding to all the candidate board configuration files: Extract a test item from the candidate board configuration file as an initial candidate test item set, traverse each board configuration file in the configuration file set except the candidate board configuration file as an updated board configuration file, and repeat the following steps until the candidate board configuration file is empty: Detecting from the currently traversed update board configuration file the test items that are in a parallel state with the current candidate test item set and are allowed to be executed simultaneously as update test items; In the case where the update test item is detected, the update test item is added as the target test item to the current candidate test item set to obtain the next candidate test item set; the candidate test item is deleted from the candidate board configuration file and the update test item is deleted from the currently traversed update board configuration file; the next update board configuration file is continuously traversed until all the board configuration files in the configuration file set except the candidate board configuration file are traversed, and the currently obtained candidate test item set is determined as a target test item set; and the empty board configuration file is deleted from the configuration file set; If the update test item is not detected, continue to traverse the next updated board card configuration file until all the board card configuration files in the configuration file set except the candidate board card configuration file are traversed and the update test item is still not detected, delete the candidate test item from the candidate board card configuration file and determine the candidate test item as the reference test item; delete the empty board card configuration file from the configuration file set.

4. The method according to claim 3, It is characterized in that The detecting, from the currently traversed update board configuration file, the parallel state between the current candidate test item set and the test items that are allowed to be executed simultaneously as update test items, comprises: Extracting candidate parallel identifiers of test items from the board configuration file corresponding to the test items in the current candidate test item set, and extracting updated parallel identifiers of test items from the currently traversed updated board configuration file, wherein the parallel identifiers of test items are used to indicate test items that are allowed to be executed in parallel; Determine the parallel status between the test items in the updated board configuration file currently traversed and the current candidate test item set according to the candidate parallel identifier and the update parallel identifier; The test items whose corresponding parallel states are all allowed to be executed simultaneously are determined as the updated test items.

5. The method according to claim 1, It is characterized in that The step of splicing the one or more target test item sets and the reference test item set into test scripts corresponding to the multiple board devices includes: Generate a first test script according to the one or more target test item sets, wherein the first test script includes multiple parallel test instructions, and the parallel test instructions are used to control multiple board devices to simultaneously execute corresponding target test items according to the records in each target test item set. The parallel test instructions include nohup sh testcard.sh N>test_N.log 2>&1&, nohup is used to run the process and control the process to ignore the hang-up signal, sh is used to control the board device to execute the corresponding test script, testcard.sh is the test script to be executed by the board device, and the board device is used to execute the corresponding test script to complete the target test item, N is the location number of the test machine deployed by the board device, > is used to redirect the standard data output during the board device to the specified file during the execution of the test script, test_N.log is the file where the standard data during the board device to execute the test script is stored, 2>&1 is used to redirect the standard error data during the board device to the specified file during the execution of the test script, and & is used to execute the output file process during the board device to execute the test script in the background; Generate a second test script according to the reference test item set, wherein the second test script includes a plurality of serial test instructions, and the serial test instructions are used to sequentially control each board device to execute the corresponding candidate test item according to the records in the reference test item set; The first test script and the second test script are spliced ​​into a test script corresponding to the multiple board devices.

6. The method according to claim 1, It is characterized in that The method further comprises: In the process of executing the test script, the update time length of the monitoring record file and the failure record file is detected, wherein the monitoring record file is used to record the test items that have been completed by the board device, and the failure record file is used to record the board device that failed the test, and the update time length is the distance between the time when the monitoring record file and the failure record file were last modified and the current time; When the update time length is greater than or equal to the time threshold, it is determined that the test script execution has timed out, and timeout information is reported.

7. The method according to claim 6, It is characterized in that Before the update time of the detection monitoring record file and the failure record file, the method further includes: Initiate monitoring procedures; The time when the board device starts to execute the test item is detected by the monitoring program as the time when the monitoring record file and the failure record file were last modified.

8. A test device for a board device, It is characterized in that include: An acquisition module, used for acquiring a test request, wherein the test request is used for requesting a plurality of board devices to be tested to perform a functional test; A generating module, configured to respond to the test request and generate one or more target test item sets and a reference test item set according to a board configuration file of each board device among the multiple board devices, wherein the board configuration file is used to record the test items to be executed by the corresponding board device, each of the target test item sets records the target test items that are allowed to be executed simultaneously on different board devices, and the reference test item set records the reference test items other than the target test items among the test items to be executed by the multiple board devices; A splicing module, used to splice the one or more target test item sets and the reference test item set into a test script corresponding to the multiple board devices, wherein the test script is used to perform functional tests on the multiple board devices according to the arrangement order of the one or more target test item sets and the reference test item set; An execution module is used to execute the test script.

9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 7 when executed by a processor.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method described in any one of claims 1 to 7 are implemented.