BMC (Baseboard Management Controller) automatic test method and device and test case execution platform

By building a process startup and running dependency tree and reasonably configuring the BMC virtual machine, the problem of low execution efficiency of test cases in BMC automation testing is solved, and the balanced scheduling of hardware resources and the improvement of test efficiency is achieved.

CN119415327AActive Publication Date: 2025-02-11SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202411344814.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2025-02-11
Estimated Expiration
2044-09-25

AI Technical Summary

Technical Problem

In the prior art, the test cases of BMC automation tests are less efficient, resulting in lower BMC automation tests.

Method used

By building a process startup and operation dependency tree, determine the execution order of test cases in the order from low to high in the tree layer, and configure a BMC virtual machine that matches the current hardware resource utilization rate, start the process to be tested, and according to the running status of the virtual machine Adjust the number of BMC virtual machines.

Benefits of technology

By rationally configuring and adjusting the number of BMC virtual machines, the balanced scheduling of hardware resources can be achieved, and the execution speed of test cases can be accelerated, thereby improving the efficiency of BMC automated testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415327A_ABST
    Figure CN119415327A_ABST
Patent Text Reader

Abstract

The invention provides a BMC automatic test method and device and a test case execution platform, and relates to the technical field of automatic test.The method comprises the steps that at least one first test case corresponding to a to-be-tested process of a current layer is determined from all test cases corresponding to a to-be-tested BMC according to the sequence from low to high of tree layers in a process starting operation dependency tree; configuring at least one BMC virtual machine conforming to the current hardware resource utilization rate, and starting a to-be-tested process of a current layer in each BMC virtual machine; distributing the at least one first test case to the at least one BMC virtual machine, and testing a current layer to-be-tested process corresponding to the at least one BMC virtual machine; and adjusting the number of the BMC virtual machines in the test process based on the running state corresponding to the at least one BMC virtual machine. According to the method and the device, balanced scheduling of hardware resources in the automatic testing process of the to-be-tested BMC can be realized, and the execution speed of the test case and the automatic testing efficiency of the BMC are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automated testing technology, and in particular to a BMC automated testing method, device and test case execution platform. Background Art

[0002] BMC (Baseboard Management Controller) is an essential management unit for servers. BMC is responsible for monitoring the status of hardware such as sensors, fans, and GPU (Graphics Processing Unit) on the server, and collecting logs. Therefore, BMC automated testing is particularly important in the BMC firmware development process. When performing BMC automated testing, unit testing, integration testing, and system testing are required. However, since BMC has many functions, there are many corresponding test cases, and each function corresponds to at least one independent process, and functions and processes are interdependent. Therefore, the execution speed of test cases is an important indicator for measuring the performance of BMC automated testing. At present, Figure 1 As shown, when performing BMC automated testing, test cases are generally scheduled through a test case automated execution platform, and each test case is executed serially. The BMC to be tested receives commands converted from the test cases through the network for performance testing, but the execution efficiency of the test cases is low, resulting in low efficiency of BMC automated testing.

[0003] In the prior art, the execution efficiency of test cases is improved by virtualizing BMC and executing test cases in parallel on the test case automation execution platform. However, the number of BMC virtual machines started in the prior art is fixed. When the hardware resources are fixed, the more BMC virtual machines are started, the slower the performance and the lower the execution efficiency of the test cases, which leads to low efficiency of BMC automated testing. Summary of the invention

[0004] The present invention provides a BMC automated testing method, device and test case execution platform, which are used to solve the defect that the execution efficiency of test cases in the prior art is low, thereby causing low efficiency of BMC automated testing.

[0005] The present invention provides a BMC automatic testing method, comprising: According to the order of tree layers from low to high in the process startup and operation dependency tree, at least one first test case corresponding to the process to be tested in the current layer is determined from all test cases corresponding to the BMC to be tested; the process startup and operation dependency tree is used to characterize the dependency relationship between all the processes to be tested in the BMC to be tested; Configure at least one BMC virtual machine that is consistent with the current hardware resource utilization, and start the current layer test process in each of the BMC virtual machines; Allocating the at least one first test case to the at least one BMC virtual machine to test the current layer process to be tested corresponding to the at least one BMC virtual machine; Based on the running status corresponding to each of the at least one BMC virtual machines, the number of the BMC virtual machines during the test is adjusted.

[0006] According to the BMC automated testing method provided by the present invention, the configuration of at least one BMC virtual machine that is consistent with the current hardware resource utilization rate includes: Based on the tree layer where the current layer is located, determining a maximum number of BMC virtual machines to be started that is consistent with the current hardware resource utilization of the current layer; Configure the maximum number of BMC virtual machines to be started.

[0007] According to the BMC automated testing method provided by the present invention, the determining, based on the tree layer where the current layer is located, the maximum number of BMC virtual machines to be started that is consistent with the current hardware resource utilization of the current layer includes: In the case where the tree layer where the current layer is located is the first layer, determining that the maximum number of BMC virtual machines started that is consistent with the current hardware resource utilization of the first layer is a preset number, and configuring the preset number of BMC virtual machines; In the case that the tree layer where the current layer is located is not the first layer, based on the current hardware resource utilization and the remaining number of tests after the tests of each previous BMC virtual machine configured in the previous layer, the maximum startup number of BMC virtual machines that are consistent with the current hardware resources of the current layer is determined, and the maximum startup number of BMC virtual machines is configured; the remaining number of tests and the maximum startup number are both less than or equal to the preset number.

[0008] According to the BMC automated testing method provided by the present invention, the current hardware resource utilization rate and the remaining number of tests of each previous BMC virtual machine configured in the previous layer after the test are determined to be consistent with the current hardware resources of the current layer. The method includes: When the current hardware resource utilization rate of each previous BMC virtual machine configured in the previous layer after the test is less than or equal to the preset threshold, the remaining number of tests of the previous BMC virtual machine corresponding to the previous layer is determined as the maximum number of BMC virtual machines that are started in accordance with the current hardware resources of the current layer; the remaining number of tests is the number of previous BMC virtual machines remaining after the test case of the previous layer is tested; When at least one of the current hardware resource utilizations of the previous BMC virtual machines configured in the previous layer after the test is greater than the preset threshold, the previous BMC virtual machines whose current hardware resource utilizations are greater than the preset threshold are released in sequence until the updated current hardware resource utilizations corresponding to the remaining previous BMC virtual machines are all less than or equal to the preset threshold, and the number of the remaining previous BMC virtual machines is determined as the maximum startup number of BMC virtual machines that is consistent with the current hardware resources of the current layer.

[0009] According to the BMC automated testing method provided by the present invention, the allocating the at least one first test case to the at least one BMC virtual machine includes: Monitoring the running status of each of the at least one BMC virtual machines; The at least one first test case is sequentially allocated to the BMC virtual machines whose running state is an idle state.

[0010] According to the BMC automated testing method provided by the present invention, adjusting the number of BMC virtual machines during the test based on the running status corresponding to each of the at least one BMC virtual machines includes: When at least one idle BMC virtual machine exists in the at least one BMC virtual machine, the idle BMC virtual machine is released and the number of BMC virtual machines in the current layer is adjusted; the idle BMC virtual machine is a BMC virtual machine that maintains an idle state within a preset time period.

[0011] The present invention also provides a BMC automatic testing device, comprising: A determination module is used to determine at least one first test case corresponding to the process to be tested in the current layer from all test cases corresponding to the BMC to be tested in the order of tree layers from low to high in the process startup and operation dependency tree; the process startup and operation dependency tree is used to characterize the dependency relationship between all the processes to be tested in the BMC to be tested; A configuration module, configured to configure at least one BMC virtual machine that is consistent with the current hardware resource utilization, and start the current layer process to be tested in each of the BMC virtual machines; A testing module, configured to allocate the at least one first test case to the at least one BMC virtual machine, and test a current layer process to be tested corresponding to the at least one BMC virtual machine; The adjustment module is used to adjust the number of BMC virtual machines during the test based on the running status corresponding to each of the at least one BMC virtual machines.

[0012] The present invention also provides a test case execution platform, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-mentioned BMC automated testing methods when executing the computer program.

[0013] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the BMC automatic testing method described in any one of the above is implemented.

[0014] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned BMC automatic testing methods.

[0015] The BMC automated testing method, device and test case execution platform provided by the present invention obtain a process startup operation dependency tree for characterizing the dependency relationship between all processes to be tested in the BMC to be tested, and determine the execution order of all test cases of the BMC to be tested according to the order of tree layers from low to high in the process startup operation dependency tree, and determine at least one first test case corresponding to the current layer to be tested, configure at least one BMC virtual machine consistent with the current hardware resource utilization rate when the hardware resources are fixed, and start the process to be tested in the current layer in each BMC virtual machine, after the process to be tested in the current layer is started, distribute all first test cases to each BMC virtual machine to test the process to be tested in the current layer, and adjust the number of BMC virtual machines in the test process by monitoring the corresponding running status of each virtual machine. In the present invention, by reasonable configuration of the number of BMC virtual machines and reasonable adjustment during the test process, balanced scheduling of hardware resources in the automated testing process of the BMC to be tested is achieved, and the execution speed of test cases is accelerated, thereby improving the efficiency of BMC automated testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 The figure is a flow chart of a BMC automatic testing method provided by the prior art.

[0018] Figure 2 The figure is a flow chart of a BMC automatic testing method provided by an embodiment of the present invention.

[0019] Figure 3It is a schematic diagram of the structure of the process startup and running dependency tree provided by an embodiment of the present invention.

[0020] Figure 4 It is a schematic diagram of the mount point of the BMC virtual machine provided by an embodiment of the present invention.

[0021] Figure 5 It is a schematic diagram of allocating a first test case provided by an embodiment of the present invention.

[0022] Figure 6 It is a structural schematic diagram of a BMC automatic testing device provided by an embodiment of the present invention.

[0023] Figure 7 It is a structural diagram of a test case execution platform provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0025] Aiming at the problem that the execution efficiency of test cases in the prior art is low, which leads to the low efficiency of BMC (Baseboard Management Controller) automated testing, an embodiment of the present invention provides a BMC automated testing method. Figure 2 FIG. 1 is a flow chart of a BMC automated testing method provided by an embodiment of the present invention. Figure 2 As shown, the method includes the following steps 210 to 240.

[0026] Step 210: Determine at least one first test case corresponding to the process to be tested in the current layer from all test cases corresponding to the BMC to be tested in the order of tree layers from low to high in the process startup and operation dependency tree; the process startup and operation dependency tree is used to characterize the dependency relationship between all processes to be tested in the BMC to be tested.

[0027] The process startup and run dependency tree is constructed based on the execution order of all the processes to be tested in the BMC to be tested, or the dependency relationship between all the processes to be tested, and is stored in the test case execution platform after construction. Different BMCs to be tested have different process startup and run dependency trees. The process startup and run dependency tree has the structure of a tree in a data structure, that is, the process startup and run dependency tree includes a root node and multiple leaf nodes composed of the processes to be tested. The tree layer where the root node is located is the first layer, and the tree layer where each leaf node is located is a non-first layer.

[0028] For example, Figure 3 is a schematic diagram of the structure of the process startup and running dependency tree provided by an embodiment of the present invention, such as Figure 3 As shown, the processes to be tested in the BMC to be tested include the Init.d process, the A process, the B process, the C process, the A1 process, and the A2 process. Among them, the Init.d process constitutes the root node. The A process, the B process, and the C process constitute the leaf nodes of the second layer. The A process, the B process, and the C process are independent of each other, and these three processes can only be started after the Init.d process is started. The A1 process and the A2 process constitute the leaf nodes of the third layer. The A1 process and the A2 process are independent of each other, and these two processes can only be started after the A process is started.

[0029] It should be noted that in the process startup and running dependency tree, the higher the tree layer the process to be tested is located, the greater the dependency value of the process to be tested is. For example, the tree layer where the Init.d process is located is the first layer, which is at the lowest tree layer, so the dependency value of the Init.d process is the smallest. The tree layer where the A1 process is located is the third layer, Figure 3 In the process startup and running dependency tree shown, the A1 process is at the highest tree level. The A1 process depends on the startup of the Init.d process and the A process. Therefore, the A1 process has the largest dependency value.

[0030] After obtaining the process startup and operation dependency tree corresponding to the BMC to be tested, the execution order of all processes to be tested in the BMC to be tested can be determined according to the order of the tree layers from low to high in the process startup and operation dependency tree. Since all test cases corresponding to the BMC to be tested need to be tested after the corresponding process to be tested is started, after determining the execution order of all processes to be tested, the execution order of all test cases corresponding to the BMC to be tested can be determined. Traverse each layer of the test process in the process startup and operation dependency tree to determine the process to be tested at the current layer, which can be the first layer or non-first layer. For the process to be tested at the current layer, at least one first test case corresponding to the process to be tested at the current layer can be determined from all test cases. All first test cases are part of the test cases or all of the test cases in all test cases, and are associated with the process to be tested at the current layer, that is, the functions corresponding to all first test cases are the same as the functions corresponding to the test cases at the current layer.

[0031] Step 220: configure at least one BMC virtual machine that matches the current hardware resource utilization, and start the current layer test process in each BMC virtual machine.

[0032] Specifically, since the hardware resources are fixed, the number of BMC virtual machines configured in the current layer is inversely proportional to the number of processes to be tested started in the current layer, that is, the more processes to be tested are started in the current layer, the lower the performance of the BMC virtual machine, resulting in fewer BMC virtual machines configured in the current layer. Therefore, in the embodiment of the present invention, BMC virtual machines that are consistent with the current hardware resource utilization of the current layer are reasonably configured to achieve balanced scheduling of hardware resources, and the processes to be tested in the current layer are started in each BMC virtual machine, which facilitates the execution of the subsequent first test case.

[0033] For example, the current layer is Figure 3 Taking the second layer shown in the figure, and configuring three BMC virtual machines in the second layer as an example, the current layer processes to be tested corresponding to the second layer include process A, process B and process C. Process A, process B and process C are started simultaneously in each BMC virtual machine, so that parallel execution can be achieved when allocating the first test case, thereby improving the execution efficiency of the test case.

[0034] It should be noted that in the prior art, multi-task parallel execution of test cases is also implemented through a test case automation execution platform, or the execution efficiency of test cases is improved by increasing the BMC to be tested, but the testing method in the prior art cannot improve the execution efficiency of test cases when the resources to be tested are fixed. In the embodiment of the present invention, by virtualizing the BMC to be tested, at least one BMC virtual machine corresponding to the BMC to be tested is generated, and the same test process, user, network and file system are isolated through the BMC virtual machine, and each BMC virtual machine is independent of each other, thereby achieving the purpose of parallel execution. That is, when the resources to be tested are fixed, the use of the BMC virtual machine can solve the problem of insufficient hardware resources in the BMC automated testing process, thereby realizing the parallel execution of test cases and improving the execution efficiency of test cases and the efficiency of BMC automated testing.

[0035] Optionally, the BMC virtual machine is implemented based on BMC virtualization technology, and the embodiment of the present invention does not limit the generation method of the BMC virtual machine. For example, if the BMC firmware is developed based on the Linux kernel, virtualization can be achieved through the namespace and cgroup provided by the Linux kernel, that is, a BMC virtual machine is generated.

[0036] Optionally, the current hardware resource utilization may include CPU (Central Processing Unit) utilization or memory utilization, which is not limited in the embodiment of the present invention.

[0037] It should be noted that the mount point of each BMC virtual machine has a different spi flash storage location. spi flash is a hardware storage device that is not lost when the power is off. By partitioning the spi flash and mounting each BMC virtual machine in a different storage location of the spi flash, the persistent storage of the log or configuration corresponding to each BMC virtual machine can be ensured, which is convenient for subsequent viewing of related logs or configurations. For example, Figure 4 Schematic diagram of the mount point of the BMC virtual machine provided by the embodiment of the present invention, such as Figure 4 As shown, the mount point of BMC virtual machine 1 is at fs1 of spi flash, the mount point of BMC virtual machine 2 is at fs2 of spiflash, and the mount point of BMC virtual machine N is at fsN of spi flash. Among them, fsi refers to the i-th rootfs, and rootfs refers to the file system loaded after the kernel is started. After the file system is loaded, the first parent process of the system, Init.d process, will be run; i is an integer greater than or equal to 1 and less than N, and N represents the number of BMC virtual machines. In addition, spi flash also includes kernel, which is the kernel. The kernel is the most basic part of the operating system and is software that provides secure access to computer hardware for many applications.

[0038] Further, configuring at least one BMC virtual machine that is consistent with the current hardware resource utilization includes: Based on the tree layer where the current layer is located, determine the maximum number of BMC virtual machines that can be started that is consistent with the current hardware resource utilization of the current layer; Configure the maximum number of BMC VMs that can be started.

[0039] Specifically, the current hardware resource utilization rate corresponding to the current layer is different when the current layer is in a different tree layer. When the current layer is the first layer, the current hardware resource utilization rate of the first layer is low because the BMC virtual machine has not been configured. At this time, the maximum number of configurable BMC virtual machines that are consistent with the current hardware resource utilization rate is large. When the current layer is not the first layer, the first M layers of the current layer have been configured with BMC virtual machines, and at least one process to be tested has been started in the configured BMC virtual machines. The current hardware resource utilization rate of the non-first layer is high. At this time, in order to be consistent with the current hardware resource utilization rate, that is, to ensure the performance of the configured BMC virtual machine, the maximum number of configurable BMC virtual machines that can be started is small. After determining the maximum number of startups, the maximum number of BMC virtual machines that can be started can be configured without affecting the performance of the BMC virtual machine.

[0040] Further, based on the tree layer where the current layer is located, determining the maximum number of BMC virtual machines to be started that is consistent with the current hardware resource utilization of the current layer includes: In the case where the tree layer where the current layer is located is the first layer, determining that the maximum number of BMC virtual machines started that is consistent with the current hardware resource utilization of the first layer is a preset number, and configuring the preset number of BMC virtual machines; When the tree layer where the current layer is located is not the first layer, based on the current hardware resource utilization and the remaining number of tests after the tests of the previous BMC virtual machines configured in the previous layer, the maximum number of BMC virtual machines to be started that are consistent with the current hardware resources of the current layer is determined, and the maximum number of BMC virtual machines to be started is configured; the remaining number of tests and the maximum number of startups are both less than or equal to the preset number.

[0041] Specifically, the preset number is the maximum number of BMC virtual machines that can be configured according to the initial hardware resource utilization when the BMC virtual machine is not configured. When configuring the BMC virtual machine in the current layer, it can only be adjusted with the preset number as the upper limit. When configuring the BMC virtual machine in the first layer, since the BMC virtual machine has not been configured, the current hardware resource utilization corresponding to the first layer is small and close to the initial hardware resource utilization. At this time, a preset number of BMC virtual machines can be configured. When configuring the BMC virtual machine in the non-first layer, as the number of processes to be tested in the BMC virtual machine gradually increases, the current hardware resource utilization corresponding to the non-first layer is large. In order to ensure the performance of the configured BMC virtual machine, when configuring the BMC virtual machine in the non-first layer, it is necessary to use the remaining number of BMC virtual machines after the test case test of the previous layer is completed as the upper limit, and adjust it in combination with the current hardware resource utilization after the test of the previous layer is completed. When the non-first layer is the second layer, the remaining number of tests corresponding to the previous layer is the preset number. When the non-first layer is the non-second layer, the remaining number of tests corresponding to the previous layer is less than or equal to the preset number.

[0042] Further, based on the current hardware resource utilization and the remaining number of tests of each previous BMC virtual machine configured in the previous layer after the test, the maximum number of BMC virtual machines to be started that is consistent with the current hardware resources of the current layer is determined, including: When the current hardware resource utilization rate of each previous BMC virtual machine configured in the previous layer after the test is less than or equal to the preset threshold, the remaining number of tests of the previous BMC virtual machines corresponding to the previous layer is determined as the maximum number of BMC virtual machines that are started in accordance with the current hardware resources of the current layer; the remaining number of tests is the number of previous BMC virtual machines remaining after the test case of the previous layer is tested; When at least one of the current hardware resource utilizations of the previous BMC virtual machines configured in the previous layer after the test is greater than a preset threshold, the previous BMC virtual machines whose current hardware resource utilizations are greater than the preset threshold are released in sequence until the updated current hardware resource utilizations corresponding to the remaining previous BMC virtual machines are all less than or equal to the preset threshold, and the number of the remaining previous BMC virtual machines is determined as the maximum startup number of BMC virtual machines that is consistent with the current hardware resources of the current layer.

[0043] It should be noted that the preset threshold value may be an upper limit of utilization rate set based on experience. When the current hardware resource utilization rate of the BMC virtual machine is greater than the preset threshold value, it indicates that the remaining hardware resources of the BMC virtual machine are small, which has affected the performance of the BMC virtual machine and further affected the execution efficiency of the test case. For example, the preset threshold value may be 80%, 85%, 90%, etc., which is not limited in the embodiment of the present invention.

[0044] Specifically, if all test cases corresponding to the previous layer are tested and completed, and the current hardware resource utilization corresponding to each remaining previous BMC virtual machine is less than or equal to the preset threshold, it indicates that each previous BMC virtual machine has sufficient hardware resources to execute the first test case of the current layer. At this time, the remaining number of tests corresponding to all previous BMC virtual machines can be determined as the maximum startup number of the current layer. If all test cases corresponding to the previous layer are tested and completed, there is a current hardware resource utilization greater than the preset threshold among the remaining previous BMC virtual machines, which indicates that the previous BMC virtual machine with a current hardware resource utilization greater than the preset threshold does not have sufficient hardware resources to execute the first test case of the current layer. At this time, the previous BMC virtual machine can be released. In the case of a fixed total amount of hardware resources, the hardware resources of the previous BMC virtual machine after release will be allocated to other previous BMC virtual machines. At this time, the new current hardware resource utilization of the other previous BMC virtual machines is recalculated. If each new current hardware resource utilization is less than or equal to the preset threshold, it indicates that the remaining other previous BMC virtual machines have sufficient hardware resources to execute the first test case of the current layer. At this time, the number of other previous BMC virtual machines can be determined as the maximum startup number of the current layer. If there are still other previous BMC virtual machines whose new current hardware resource utilizations are greater than the preset threshold, the previous BMC virtual machines greater than the preset threshold can continue to be released until the new current hardware resource utilizations of the remaining previous BMC virtual machines after adjustment are all less than or equal to the preset threshold, and the adjustment is stopped. At this time, the number of previous BMC virtual machines remaining after adjustment is the maximum startup number that can be configured in the current layer.

[0045] In the embodiment of the present invention, by reasonably configuring the number of BMC virtual machines configured at each layer, balanced scheduling of hardware resources is achieved, ensuring that when executing test cases at each layer, the BMC virtual machines configured at each layer have sufficient performance to execute the test cases, thereby improving the execution efficiency of the test cases, speeding up the testing of the processes to be tested at each layer, and thus improving the efficiency of BMC automated testing.

[0046] Step 230: Allocate at least one first test case to at least one BMC virtual machine to test a current layer process to be tested corresponding to the at least one BMC virtual machine.

[0047] Specifically, after the BMC virtual machine of the current layer is configured, all first test cases may be sequentially allocated to each BMC virtual machine for parallel execution, thereby realizing automated testing of the process to be tested of the current layer started in the BMC virtual machine.

[0048] It should be noted that all first test cases may include at least one test case set (suite), and each test case set belongs to the same type of test, that is, each test case set tests the same function. Based on factors such as resource competition, test isolation, dependencies, clarity of test results and test security, each test case set cannot be executed in parallel on a BMC virtual machine, but can be allocated to different BMC virtual machines for parallel execution.

[0049] Further, allocating at least one first test case to at least one BMC virtual machine includes: Monitor the running status of at least one BMC virtual machine; At least one first test case is sequentially allocated to the BMC virtual machines whose running state is an idle state.

[0050] Specifically, after configuring the BMC virtual machines of the current layer, the running status of each BMC virtual machine can be monitored, and according to the running status of each BMC virtual machine, all first test cases can be sequentially allocated to the BMC virtual machines in the idle state to achieve balanced scheduling of all first test cases.

[0051] For example, Figure 5 is a schematic diagram of allocating a first test case provided by an embodiment of the present invention, such as Figure 5As shown, taking the configuration of 3 BMC virtual machines and the number of first test cases as 10 as an example, a test case is allocated to each BMC virtual machine in time period 1, time period 2 and time period 3, that is, in time period 1, the first test case suite1-testcase1 is allocated to BMC virtual machine 1, the first test case suite1-testcase2 is allocated to BMC virtual machine 2, and the first test case suite1-testcase3 is allocated to BMC virtual machine 3. In time period 2, the three BMC virtual machines are all in an idle state. At this time, the first test case suite1-testcase4 can be allocated to BMC virtual machine 1, the first test case suite1-testcase5 can be allocated to BMC virtual machine 2, and the first test case suite2-testcase1 can be allocated to BMC virtual machine 3. In time period 3, the three BMC virtual machines are all in an idle state. At this time, the first test case suite2-testcase2 can be allocated to BMC virtual machine 1, the first test case suite2-testcase3 can be allocated to BMC virtual machine 2, and the first test case suite2-testcase4 can be allocated to BMC virtual machine 3. In period 4, the three BMC virtual machines are all in an idle state, and only one first test case of the current layer remains. At this time, the remaining first test case suite3-testcase1 can be allocated to BMC virtual machine 1.

[0052] In addition, since the execution time of each first test case is different, after the first test cases are evenly distributed in time period 1, it may be monitored in time period 2 that BMC virtual machine 1 and BMC virtual machine 2 are both in an idle state, while the running state of BMC virtual machine 3 is an execution state. At this time, one first test case may be allocated to BMC virtual machine 1 and BMC virtual machine 2 respectively, and no first test case may be allocated to BMC virtual machine 3.

[0053] Step 240: Based on the running status of at least one BMC virtual machine, adjust the number of BMC virtual machines during the test.

[0054] Specifically, during the test process, the number of BMC virtual machines during the test process can be reasonably adjusted according to the running status of each BMC virtual machine, so as to evenly schedule hardware resources and ensure that the adjusted BMC virtual machine has sufficient performance to execute the first test case, thereby improving the execution efficiency of the test case.

[0055] Further, based on the running status of at least one BMC virtual machine, the number of BMC virtual machines in the test process is adjusted, including: When at least one idle BMC virtual machine exists in the at least one BMC virtual machine, the idle BMC virtual machine is released and the number of BMC virtual machines in the current layer is adjusted; the idle BMC virtual machine is a BMC virtual machine that remains in an idle state within a preset time period.

[0056] For example, Figure 5 As shown, in time period 4, among all the first test cases in the current layer, only one first test case remains, and is assigned to BMC virtual machine 1. At this time, BMC virtual machine 2 and BMC virtual machine 3 are always in an idle state during the time period after the remaining first test cases are executed, and the time period is greater than or equal to the preset duration. At this time, BMC virtual machine 2 and BMC virtual machine 3 are both idle BMC virtual machines. At this time, BMC virtual machine 2 and BMC virtual machine 3 can be released, that is, the hardware resources corresponding to BMC virtual machine 2 and BMC virtual machine 3 are released, so that the hardware resources of BMC virtual machine 1 are increased, and the efficiency of BMC virtual machine 1 in executing the first test cases is improved, thereby improving the execution efficiency of all first test cases.

[0057] The BMC automated testing method provided by the embodiment of the present invention obtains a process startup and operation dependency tree for characterizing the dependency relationship between all processes to be tested in the BMC to be tested, and determines the execution order of all test cases of the BMC to be tested according to the order of tree layers from low to high in the process startup and operation dependency tree, and determines at least one first test case corresponding to the current layer to be tested, and configures at least one BMC virtual machine that matches the current hardware resource utilization rate when the hardware resources are fixed, and starts the process to be tested in the current layer in each BMC virtual machine. After the process to be tested in the current layer is started, all first test cases are allocated to each BMC virtual machine to test the process to be tested in the current layer, and the number of BMC virtual machines in the test process is adjusted by monitoring the corresponding running status of each virtual machine. In the present invention, by reasonably configuring the number of BMC virtual machines and reasonably adjusting during the test process, balanced scheduling of hardware resources in the automated testing process of the BMC to be tested is achieved, and the execution speed of test cases is accelerated, thereby improving the efficiency of BMC automated testing.

[0058] The BMC automatic testing device provided by the present invention is described below. The BMC automatic testing device described below and the BMC automatic testing method described above can be referred to each other.

[0059] Figure 6 Schematic diagram of the structure of the BMC automatic test device provided by the embodiment of the present invention. Figure 6 As shown, the BMC automatic testing device 600 includes: a determination module 610 , a configuration module 620 , a testing module 630 and an adjustment module 640 .

[0060] The determination module 610 is used to determine at least one first test case corresponding to the process to be tested in the current layer from all test cases corresponding to the BMC to be tested in the order of tree layers from low to high in the process startup and operation dependency tree; the process startup and operation dependency tree is used to characterize the dependency relationship between all processes to be tested in the BMC to be tested.

[0061] The configuration module 620 is used to configure at least one BMC virtual machine that is consistent with the current hardware resource utilization, and start the current layer test process in each BMC virtual machine.

[0062] The testing module 630 is used to allocate at least one first test case to at least one BMC virtual machine, and test the current layer process to be tested corresponding to the at least one BMC virtual machine.

[0063] The adjustment module 640 is configured to adjust the number of BMC virtual machines during the test based on the corresponding running status of at least one BMC virtual machine.

[0064] The BMC automated testing device provided by the embodiment of the present invention obtains a process startup and operation dependency tree for characterizing the dependency relationship between all processes to be tested in the BMC to be tested, and determines the execution order of all test cases of the BMC to be tested according to the order of tree layers from low to high in the process startup and operation dependency tree, and determines at least one first test case corresponding to the current layer to be tested, configures at least one BMC virtual machine that matches the current hardware resource utilization rate when the hardware resources are fixed, and starts the process to be tested in the current layer in each BMC virtual machine, after the process to be tested in the current layer is started, distributes all first test cases to each BMC virtual machine to test the process to be tested in the current layer, and adjusts the number of BMC virtual machines in the test process by monitoring the corresponding running status of each virtual machine. In the present invention, by reasonably configuring the number of BMC virtual machines and reasonably adjusting in the test process, balanced scheduling of hardware resources in the automated testing process of the BMC to be tested is achieved, and the execution speed of test cases is accelerated, thereby improving the efficiency of BMC automated testing.

[0065] Optionally, the configuration module 620 is specifically configured to: Based on the tree layer where the current layer is located, determining a maximum number of BMC virtual machines to be started that is consistent with the current hardware resource utilization of the current layer; Configure the maximum number of BMC virtual machines to be started.

[0066] Optionally, the configuration module 620 is specifically configured to: In the case where the tree layer where the current layer is located is the first layer, determining that the maximum number of BMC virtual machines started that is consistent with the current hardware resource utilization of the first layer is a preset number, and configuring the preset number of BMC virtual machines; In the case that the tree layer where the current layer is located is not the first layer, based on the current hardware resource utilization and the remaining number of tests after the tests of each previous BMC virtual machine configured in the previous layer, the maximum startup number of BMC virtual machines that are consistent with the current hardware resources of the current layer is determined, and the maximum startup number of BMC virtual machines is configured; the remaining number of tests and the maximum startup number are both less than or equal to the preset number.

[0067] Optionally, the configuration module 620 is specifically configured to: When the current hardware resource utilization rate of each previous BMC virtual machine configured in the previous layer after the test is less than or equal to the preset threshold, the remaining number of tests of the previous BMC virtual machine corresponding to the previous layer is determined as the maximum number of BMC virtual machines that are started in accordance with the current hardware resources of the current layer; the remaining number of tests is the number of previous BMC virtual machines remaining after the test case of the previous layer is tested; When at least one of the current hardware resource utilizations of the previous BMC virtual machines configured in the previous layer after the test is greater than the preset threshold, the previous BMC virtual machines whose current hardware resource utilizations are greater than the preset threshold are released in sequence until the updated current hardware resource utilizations corresponding to the remaining previous BMC virtual machines are all less than or equal to the preset threshold, and the number of the remaining previous BMC virtual machines is determined as the maximum startup number of BMC virtual machines that is consistent with the current hardware resources of the current layer.

[0068] Optionally, the testing module 630 is specifically configured to: Monitoring the running status of each of the at least one BMC virtual machines; The at least one first test case is sequentially allocated to the BMC virtual machines whose running state is an idle state.

[0069] Optionally, the adjustment module 640 is specifically configured to: When at least one idle BMC virtual machine exists in the at least one BMC virtual machine, the idle BMC virtual machine is released and the number of BMC virtual machines in the current layer is adjusted; the idle BMC virtual machine is a BMC virtual machine that maintains an idle state within a preset time period.

[0070] Figure 7 is a schematic diagram of the structure of the test case execution platform provided by an embodiment of the present invention, such as Figure 7As shown, the test case automation platform may include: a processor 710, a communications interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communications interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the BMC automated testing method, which includes: According to the order of tree layers from low to high in the process startup and operation dependency tree, at least one first test case corresponding to the process to be tested in the current layer is determined from all test cases corresponding to the BMC to be tested; the process startup and operation dependency tree is used to characterize the dependency relationship between all the processes to be tested in the BMC to be tested; Configure at least one BMC virtual machine that is consistent with the current hardware resource utilization, and start the current layer test process in each of the BMC virtual machines; Allocating the at least one first test case to the at least one BMC virtual machine to test the current layer process to be tested corresponding to the at least one BMC virtual machine; Based on the running status corresponding to each of the at least one BMC virtual machines, the number of the BMC virtual machines during the test is adjusted.

[0071] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0072] Optionally, the test case execution platform may be a Jenkins platform, which is a continuous integration tool developed based on Java and used to monitor continuous and repetitive work, aiming to provide an open and easy-to-use software platform so that software projects can be continuously integrated. The embodiment of the present invention does not limit this.

[0073] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the BMC automated testing method provided by the above methods, the method includes: According to the order of tree layers from low to high in the process startup and operation dependency tree, at least one first test case corresponding to the process to be tested in the current layer is determined from all test cases corresponding to the BMC to be tested; the process startup and operation dependency tree is used to characterize the dependency relationship between all the processes to be tested in the BMC to be tested; Configure at least one BMC virtual machine that is consistent with the current hardware resource utilization, and start the current layer test process in each of the BMC virtual machines; Allocating the at least one first test case to the at least one BMC virtual machine to test the current layer process to be tested corresponding to the at least one BMC virtual machine; Based on the running status corresponding to each of the at least one BMC virtual machines, the number of the BMC virtual machines during the test is adjusted.

[0074] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the BMC automated testing method provided by the above methods is implemented, and the method includes: According to the order of tree layers from low to high in the process startup and operation dependency tree, at least one first test case corresponding to the process to be tested in the current layer is determined from all test cases corresponding to the BMC to be tested; the process startup and operation dependency tree is used to characterize the dependency relationship between all the processes to be tested in the BMC to be tested; Configure at least one BMC virtual machine that is consistent with the current hardware resource utilization, and start the current layer test process in each of the BMC virtual machines; Allocating the at least one first test case to the at least one BMC virtual machine to test the current layer process to be tested corresponding to the at least one BMC virtual machine; Based on the running status corresponding to each of the at least one BMC virtual machines, the number of the BMC virtual machines during the test is adjusted.

[0075] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

[0076] Through the description of the above implementation modes, those skilled in the art can clearly understand that each implementation mode can be implemented by means of software plus a necessary general hardware platform, or of course by hardware. Based on such an understanding, the above technical solution can essentially or in other words be embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A BMC automated testing method, characterized in that: include: Determine at least one first test case corresponding to the process to be tested in the current layer from all test cases corresponding to the BMC to be tested in the order of tree layers from low to high in the process startup and running dependency tree; The process startup and running dependency tree is used to characterize the dependency relationship between all processes to be tested in the BMC to be tested; Configure at least one BMC virtual machine that is consistent with the current hardware resource utilization, and start the current layer test process in each of the BMC virtual machines; Allocating the at least one first test case to the at least one BMC virtual machine to test the current layer process to be tested corresponding to the at least one BMC virtual machine; Based on the running status corresponding to each of the at least one BMC virtual machines, the number of the BMC virtual machines during the test is adjusted.

2. The BMC automated testing method according to claim 1, characterized in that: The configuration of at least one BMC virtual machine that is consistent with the current hardware resource utilization includes: Based on the tree layer where the current layer is located, determining a maximum number of BMC virtual machines to be started that is consistent with the current hardware resource utilization of the current layer; Configure the maximum number of BMC virtual machines to be started.

3. The BMC automated testing method according to claim 2, characterized in that: The determining, based on the tree layer where the current layer is located, the maximum number of BMC virtual machines to be started that is consistent with the current hardware resource utilization of the current layer includes: In the case where the tree layer where the current layer is located is the first layer, determining that the maximum number of BMC virtual machines started that is consistent with the current hardware resource utilization of the first layer is a preset number, and configuring the preset number of BMC virtual machines; In the case that the tree layer where the current layer is located is not the first layer, based on the current hardware resource utilization and the remaining number of tests after the tests of each previous BMC virtual machine configured in the previous layer, the maximum startup number of BMC virtual machines that are consistent with the current hardware resources of the current layer is determined, and the maximum startup number of BMC virtual machines is configured; the remaining number of tests and the maximum startup number are both less than or equal to the preset number.

4. The BMC automated testing method according to claim 3, characterized in that: The determining the maximum number of BMC virtual machines to be started that are consistent with the current hardware resources of the current layer based on the current hardware resource utilization rate and the remaining number of tests of each previous BMC virtual machine configured in the previous layer after the test includes: When the current hardware resource utilization rate of each previous BMC virtual machine configured in the previous layer after the test is less than or equal to the preset threshold, the remaining number of tests of the previous BMC virtual machine corresponding to the previous layer is determined as the maximum number of BMC virtual machines that are started in accordance with the current hardware resources of the current layer; the remaining number of tests is the number of previous BMC virtual machines remaining after the test case of the previous layer is tested; When at least one of the current hardware resource utilizations of the previous BMC virtual machines configured in the previous layer after the test is greater than the preset threshold, the previous BMC virtual machines whose current hardware resource utilizations are greater than the preset threshold are released in sequence until the updated current hardware resource utilizations corresponding to the remaining previous BMC virtual machines are all less than or equal to the preset threshold, and the number of the remaining previous BMC virtual machines is determined as the maximum startup number of BMC virtual machines that is consistent with the current hardware resources of the current layer.

5. The BMC automated testing method according to any one of claims 1 to 4, characterized in that: The allocating the at least one first test case to the at least one BMC virtual machine includes: Monitoring the running status of each of the at least one BMC virtual machines; The at least one first test case is sequentially allocated to the BMC virtual machines whose running state is an idle state.

6. The BMC automated testing method according to any one of claims 1 to 4, characterized in that: The adjusting the number of BMC virtual machines during the test based on the running status corresponding to each of the at least one BMC virtual machines includes: When at least one idle BMC virtual machine exists in the at least one BMC virtual machine, the idle BMC virtual machine is released and the number of BMC virtual machines in the current layer is adjusted; the idle BMC virtual machine is a BMC virtual machine that maintains an idle state within a preset time period.

7. A BMC automated testing device, characterized in that: include: A determination module, configured to determine at least one first test case corresponding to the process to be tested in the current layer from all test cases corresponding to the BMC to be tested, in the order of tree layers from low to high in the process startup and running dependency tree; The process startup and running dependency tree is used to characterize the dependency relationship between all processes to be tested in the BMC to be tested; A configuration module, configured to configure at least one BMC virtual machine that is consistent with the current hardware resource utilization, and start the current layer process to be tested in each of the BMC virtual machines; A testing module, configured to allocate the at least one first test case to the at least one BMC virtual machine, and test a current layer process to be tested corresponding to the at least one BMC virtual machine; The adjustment module is used to adjust the number of BMC virtual machines during the test based on the running status corresponding to each of the at least one BMC virtual machines.

8. A test case execution platform, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the BMC automatic testing method according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the BMC automatic testing method according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the BMC automatic testing method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Automatic testing method and executing node

    CN104679651A

  • Docker-based lightweight website deployment method

    CN108021608A

  • Testing method and device for virtual machine energy consumption

    CN108228445A

  • Virtual machine resource management method, device and computing device

    CN109086120A

  • Automatic testing method and system for NVDIMM and related components

    CN110515785A