BMC Automated Testing Methods, Devices, and Test Case Execution Platform
By obtaining the process startup dependency tree in BMC automated testing and reasonably configuring and adjusting the number of BMC virtual machines, the problem of low test case execution efficiency is solved, balanced scheduling of hardware resources is achieved, and the efficiency of BMC automated testing is improved.
Patent Information
- Application Number
- CN202411344814.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-09-25
AI Technical Summary
The execution efficiency of test cases in existing BMC automated testing methods is low, resulting in low efficiency of BMC automated testing. Especially when hardware resources are fixed, the more BMC virtual machines are started, the slower the performance and the lower the execution efficiency of test cases.
By obtaining the process startup dependency tree of the BMC under test, the execution order of test cases is determined according to the order of tree levels from low to high. A BMC virtual machine that matches the current hardware resource utilization is configured, and the process under test is started in the virtual machine. Test cases are assigned to the virtual machine, and the virtual machine status is monitored to adjust the number of virtual machines in order to achieve balanced scheduling of hardware resources.
With fixed hardware resources, the execution speed of test cases and the efficiency of BMC automated testing were improved by reasonably configuring and adjusting the number of BMC virtual machines.
Smart Images

Figure CN119415327B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automated testing technology, and in particular to a BMC automated testing method, apparatus, and test case execution platform. Background Technology
[0002] The Baseboard Management Controller (BMC) is an essential management unit for servers. It monitors the status of hardware such as sensors, fans, and GPUs (Graphics Processing Units) and collects logs. Therefore, automated testing of the BMC is crucial in the BMC firmware development process, encompassing unit testing, integration testing, and system testing. However, due to the numerous functions of the BMC and the corresponding number of test cases, with each function corresponding to at least one independent process and dependencies between functions and processes, the execution speed of test cases is a critical indicator of BMC automated testing performance. Currently, as... Figure 1 As shown, when performing automated testing of BMC, test cases are typically scheduled through an automated test case execution platform, and each test case is executed serially. The BMC under test receives the commands converted from the test cases over the network for performance testing. However, the execution efficiency of the test cases is low, resulting in low efficiency of automated testing of BMC.
[0003] In existing technologies, test case execution efficiency is improved by using BMC virtualization and a test case automation execution platform to execute test cases in parallel across multiple tasks. However, the number of BMC virtual machines launched in existing methods is fixed. With fixed hardware resources, the more BMC virtual machines launched, the slower the performance and the lower the test case execution efficiency, resulting in low efficiency for BMC automated testing. Summary of the Invention
[0004] This invention provides a BMC automated testing method, apparatus, and test case execution platform to address the shortcomings of low test case execution efficiency in existing technologies, which leads to low efficiency in BMC automated testing.
[0005] This invention provides an automated BMC testing method, comprising:
[0006] According to the process startup and execution dependency tree, in ascending order of tree levels, at least one first test case is determined from all test cases corresponding to the BMC under test for the current layer of the process under test; the process startup and execution dependency tree is used to characterize the dependency relationships between all processes under test in the BMC under test.
[0007] Configure at least one BMC virtual machine that matches the current hardware resource utilization, and start the current layer test process in each of the BMC virtual machines;
[0008] The at least one first test case is assigned 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;
[0009] The number of BMC virtual machines during the test is adjusted based on the running status of each of the at least one BMC virtual machine.
[0010] According to the BMC automated testing method provided by the present invention, the configuration of at least one BMC virtual machine that matches the current hardware resource utilization includes:
[0011] Based on the tree level where the current layer is located, determine the maximum number of BMC virtual machines that can be launched, which is consistent with the current hardware resource utilization rate of the current layer.
[0012] Configure the maximum number of BMC virtual machines to be launched.
[0013] According to the BMC automated testing method provided by the present invention, determining the maximum number of BMC virtual machines to be launched based on the tree layer in which the current layer is located, and which corresponds to the current hardware resource utilization rate of the current layer, includes:
[0014] If the current layer is the first layer in the tree, determine the maximum number of BMC virtual machines that match the current hardware resource utilization of the first layer as a preset number, and configure the preset number of BMC virtual machines.
[0015] If the current layer is not the first layer in the tree, based on the current hardware resource utilization and remaining number of tests of each previous BMC virtual machine configured in the previous layer, determine the maximum number of BMC virtual machines that match the current hardware resources of the current layer, and configure the maximum number of BMC virtual machines to be started; the remaining number of tests and the maximum number of startups are both less than or equal to the preset number.
[0016] According to the BMC automated testing method provided by the present invention, determining the maximum number of BMC virtual machines to be launched that match the current hardware resources of the current layer, based on the current hardware resource utilization and remaining number of tests of each previous BMC virtual machine configured in the previous layer, includes:
[0017] If the current hardware resource utilization rate of each previous BMC virtual machine configured in the previous layer is less than or equal to a preset threshold after testing, the remaining number of the previous BMC virtual machines corresponding to the previous layer is determined as the maximum number of BMC virtual machines that can be started, which is consistent with the current hardware resources of the current layer; the remaining number of the test is the number of previous BMC virtual machines remaining after the test cases of the previous layer are completed.
[0018] If at least one of the previous BMC virtual machines configured in the previous layer has a current hardware resource utilization rate greater than the preset threshold after testing, the previous BMC virtual machines with a current hardware resource utilization rate greater than the preset threshold are released sequentially until the updated current hardware resource utilization rate of each of the remaining previous BMC virtual machines is less than or equal to the preset threshold. Then, the number of the remaining previous BMC virtual machines is determined as the maximum number of BMC virtual machines that can be started, which is consistent with the current hardware resources of the current layer.
[0019] According to the BMC automated testing method provided by the present invention, the step of assigning the at least one first test case to the at least one BMC virtual machine includes:
[0020] Monitor the running status of each of the at least one BMC virtual machines;
[0021] The at least one first test case is sequentially assigned to a BMC virtual machine that is in an idle state.
[0022] According to the BMC automated testing method provided by the present invention, adjusting the number of BMC virtual machines during the testing process based on the respective running states of the at least one BMC virtual machine includes:
[0023] If at least one BMC virtual machine exists among the at least one BMC virtual machines, 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 has maintained an idle state for a preset time period.
[0024] The present invention also provides an automated BMC testing device, comprising:
[0025] The determination module is used to determine at least one first test case corresponding to the process under test at the current layer from all test cases corresponding to the BMC under test, according to the order of the process startup and execution dependency tree from low to high; the process startup and execution dependency tree is used to characterize the dependency relationship between all processes under test in the BMC under test.
[0026] A configuration module is used to configure at least one BMC virtual machine that matches the current hardware resource utilization rate, and to start the current layer test process in each of the BMC virtual machines;
[0027] The testing module is used to assign the at least one first test case to the at least one BMC virtual machine and test the current layer process to be tested corresponding to the at least one BMC virtual machine;
[0028] The adjustment module is used to adjust the number of BMC virtual machines during the test based on the running status of each of the at least one BMC virtual machine.
[0029] The present invention also provides a test case execution platform, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the BMC automated testing method as described above.
[0030] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the BMC automated testing method as described above.
[0031] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the BMC automated testing method as described above.
[0032] The BMC automated testing method, apparatus, and test case execution platform provided by this invention obtain a process startup dependency tree characterizing the dependencies between all processes under test in the BMC under test. Following the ascending order of the tree levels, the execution order of all test cases for the BMC under test is determined, and at least one first test case is assigned to the current layer. With fixed hardware resources, at least one BMC virtual machine is configured with utilization matching the current hardware resources. The current layer's process under test is started in each BMC virtual machine. After the current layer's process under test is started, all first test cases are assigned to each BMC virtual machine to test the current layer's process. The number of BMC virtual machines during the testing process is adjusted by monitoring the running status of each virtual machine. This invention achieves balanced scheduling of hardware resources during the automated testing of the BMC under test by rationally configuring the number of BMC virtual machines and adjusting them during the testing process, thereby accelerating the execution speed of test cases and improving the efficiency of BMC automated testing. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0034] Figure 1 This is a flowchart illustrating the BMC automated testing method provided by existing technology.
[0035] Figure 2 This is a flowchart illustrating the BMC automated testing method provided in this embodiment of the invention.
[0036] Figure 3 This is a schematic diagram of the process startup and execution dependency tree provided in an embodiment of the present invention.
[0037] Figure 4 This is a schematic diagram of the mount point of the BMC virtual machine provided in an embodiment of the present invention.
[0038] Figure 5 This is a schematic diagram of the allocation of the first test case provided in an embodiment of the present invention.
[0039] Figure 6 This is a schematic diagram of the structure of the BMC automated testing device provided in an embodiment of the present invention.
[0040] Figure 7 This is a schematic diagram of the test case execution platform provided in an embodiment of the present invention. Detailed Implementation
[0041] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0042] To address the problem of low execution efficiency of test cases in existing technologies, which leads to low efficiency in automated testing of BMC (Baseboard Management Controller), this invention provides an automated testing method for BMC. Figure 2 This is a flowchart illustrating the BMC automated testing method provided in this embodiment of the invention, as shown below. Figure 2 As shown, the method includes steps 210 to 240.
[0043] Step 210: According to the order of the process startup and execution dependency tree from low to high, determine at least one first test case corresponding to the process under test at the current layer from all test cases corresponding to the BMC under test; the process startup and execution dependency tree is used to characterize the dependency relationship between all processes under test in the BMC under test.
[0044] The process startup dependency tree is constructed based on the execution order of all processes under test in the BMC under test, or the dependency relationships between all processes under test, and is stored in the test case execution platform after construction. Different BMCs under test have different process startup dependency trees. The process startup dependency tree has a tree structure in data structures, that is, the process startup dependency tree includes a root node composed of processes under test and multiple leaf nodes. The tree level where the root node is located is the first level, and the tree levels where each leaf node is located are non-first levels.
[0045] For example, Figure 3 This is a schematic diagram of the process startup and execution dependency tree provided in an embodiment of the present invention, such as... Figure 3 As shown, the processes under test in the BMC include the Init.d process, process A, process B, process C, process A1, and process A2. The Init.d process forms the root node. Processes A, B, and C form the leaf nodes of the second level; these three processes are independent of each other and can only start after the Init.d process has started. Processes A1 and A2 form the leaf nodes of the third level; these two processes are independent of each other and can only start after the A process has started.
[0046] It should be noted that in the process startup dependency tree, the higher the level of the process under test, the greater its dependency value. For example, the Init.d process is at the first level, the lowest level, therefore its dependency value is the smallest. The A1 process is at the third level... Figure 3 The process startup dependency tree shown is at the highest level. Process A1 depends on the startup of both the Init.d process and process A to start. Therefore, process A1 has the largest dependency value.
[0047] After obtaining the process startup dependency tree corresponding to the BMC under test, the execution order of all processes under test in the BMC can be determined according to the ascending order of the tree levels. Since all test cases corresponding to the BMC can only be tested after the corresponding process under test has started, the execution order of all test cases corresponding to the BMC can be determined after determining the execution order of all processes under test. Traverse the test processes at each level of the process startup dependency tree to determine the current layer of the process under test, which can be the first layer or a non-first layer. For the current layer of the process under test, at least one first test case can be determined from all test cases. All first test cases are some or all of the test cases and are associated with the current layer of the process under test; that is, the functionality corresponding to all first test cases is the same as the functionality corresponding to the current layer test case.
[0048] 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.
[0049] Specifically, since hardware resources are fixed, the number of BMC virtual machines configured in the current layer is inversely proportional to the number of processes under test started in the current layer. That is, the more processes under test started in the current layer, the lower the performance of the BMC virtual machines, resulting in fewer BMC virtual machines configured in the current layer. Therefore, in this embodiment of the invention, BMC virtual machines are configured reasonably to match the current hardware resource utilization rate of the current layer to achieve balanced scheduling of hardware resources, and the processes under test of the current layer are started in each BMC virtual machine to facilitate the execution of the subsequent first test case.
[0050] For example, taking the current layer as... Figure 3 The second layer shown in the figure, with three BMC virtual machines configured in the second layer as an example, includes processes A, B and C as the processes to be tested in the current layer. Processes A, B and C are started simultaneously in each BMC virtual machine, which facilitates parallel execution when allocating the first test case, thereby improving the execution efficiency of the test case.
[0051] It should be noted that existing technologies also utilize automated test case execution platforms to achieve parallel execution of test cases across multiple tasks, or add test chambers (BMCs) to improve test case execution efficiency. However, these existing testing methods cannot improve test case execution efficiency when the resources under test are fixed. In this embodiment of the invention, by virtualizing the BMC under test, at least one BMC virtual machine is generated corresponding to the BMC. The BMC virtual machines isolate identical test processes, users, networks, and file systems, and each BMC virtual machine is independent of the others, thereby achieving parallel execution. That is, when the resources under test are fixed, using BMC virtual machines can solve the problem of insufficient hardware resources during BMC automated testing, thereby achieving parallel execution of test cases and improving the efficiency of both test case execution and BMC automated testing.
[0052] Optionally, the BMC virtual machine is implemented based on BMC virtualization technology, and the embodiments of the present invention do 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 namespaces and cgroups provided by the Linux kernel, that is, the BMC virtual machine can be generated.
[0053] Optionally, the current hardware resource utilization rate may include CPU (Central Processing Unit) utilization rate or memory utilization rate, and this embodiment of the invention does not limit this.
[0054] It's important to note that each BMC virtual machine has a different SPI flash storage location as its mount point. SPI flash is a hardware storage device that is rewritable and non-volatile. By partitioning the SPI flash and mounting each BMC virtual machine to a different storage location, persistent storage of the corresponding logs or configurations for each BMC virtual machine can be ensured, facilitating subsequent viewing of these logs or configurations. For example, Figure 4 This is a schematic diagram of the mount point of the BMC virtual machine provided in an embodiment of the present invention, as shown below. Figure 4As shown, the mount point of BMC virtual machine 1 is located at fs1 in the SPI flash, the mount point of BMC virtual machine 2 is located at fs2 in the SPI flash, and the mount point of BMC virtual machine N is located at fsN in the SPI flash. Here, fsi refers to the i-th rootfs, which is the file system loaded after the kernel boots, and the first parent process, Init.d, runs after the file system is loaded; i is an integer greater than or equal to 1 and less than N, where N represents the number of BMC virtual machines. Furthermore, the SPI flash also includes the kernel, which is the most fundamental part of the operating system, providing secure access to computer hardware for numerous applications.
[0055] Furthermore, configure at least one BMC virtual machine that matches the current hardware resource utilization, including:
[0056] Based on the tree level of the current layer, determine the maximum number of BMC virtual machines that can be launched, which is consistent with the current hardware resource utilization of the current layer.
[0057] Configure the maximum number of BMC virtual machines to start.
[0058] Specifically, the current hardware resource utilization rate varies depending on the current layer's position in the tree hierarchy. When the current layer is the first layer, its hardware resource utilization is low because no BMC virtual machines have been configured yet. Therefore, the maximum number of configurable BMC virtual machines that can be started is relatively large. When the current layer is not the first layer, its hardware resource utilization is high because BMC virtual machines have been configured in the preceding M layers, and at least one process under test has been started in each of these configured BMC virtual machines. Therefore, to match the current hardware resource utilization rate and ensure the performance of the configured BMC virtual machines, the maximum number of configurable BMC virtual machines that can be started is relatively small. After determining the maximum number of startups, a maximum number of BMC virtual machines can be configured to be started without affecting their performance.
[0059] Furthermore, based on the tree level of the current layer, determine the maximum number of BMC virtual machines that can be launched, which should match the current hardware resource utilization of the current layer, including:
[0060] If the current layer is the first layer in the tree, determine the maximum number of BMC virtual machines that matches the current hardware resource utilization of the first layer as the preset number, and configure the preset number of BMC virtual machines.
[0061] If the current layer is not the first layer in the tree, based on the current hardware resource utilization and remaining number of BMC virtual machines after testing the previous layer, determine the maximum number of BMC virtual machines that match the current hardware resources of the current layer, and configure the maximum number of BMC virtual machines to be started; the remaining number of tests and the maximum number of startups are both less than or equal to the preset number.
[0062] Specifically, the preset number is the maximum number of BMC virtual machines that can be configured based on the initial hardware resource utilization when no BMC virtual machines are configured. When configuring BMC virtual machines in the current layer, adjustments can only be made up to this preset number. When configuring BMC virtual machines in the first layer, since no BMC virtual machines have been configured yet, the current hardware resource utilization corresponding to the first layer is relatively low, close to the initial hardware resource utilization. In this case, the preset number of BMC virtual machines can be configured. When configuring BMC virtual machines in non-first layers, as the number of processes under test launched in the BMC virtual machines gradually increases, the current hardware resource utilization corresponding to the non-first layer is relatively high. To ensure the performance of the configured BMC virtual machines, when configuring BMC virtual machines in non-first layers, the maximum number of BMC virtual machines remaining after the test cases of the previous layer have been completed should be used as the upper limit, and adjustments should be made based on the current hardware resource utilization after the previous layer's test has ended. When the non-first layer is the second layer, the number of remaining test cases corresponding to the previous layer is the preset number. When the non-first layer is not the second layer, the number of remaining test cases corresponding to the previous layer is less than or equal to this preset number.
[0063] Furthermore, based on the current hardware resource utilization and remaining number of tests of each previous BMC virtual machine configured in the previous layer, the maximum number of BMC virtual machines that can be launched, matching the current hardware resources of the current layer, is determined, including:
[0064] If the current hardware resource utilization rate of each previous BMC virtual machine configured in the previous layer is less than or equal to the preset threshold after testing, the remaining number of previous BMC virtual machines in the previous layer is determined as the maximum number of BMC virtual machines that can be started 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 cases in the previous layer have been completed.
[0065] If at least one of the previous BMC virtual machines configured in the previous layer has a current hardware resource utilization rate greater than a preset threshold after testing, the previous BMC virtual machines with a current hardware resource utilization rate greater than the preset threshold are released sequentially until the updated current hardware resource utilization rate of each of the remaining previous BMC virtual machines is less than or equal to the preset threshold. Then, the number of the remaining previous BMC virtual machines is determined as the maximum number of BMC virtual machines that can be started, which is consistent with the current hardware resources of the current layer.
[0066] It should be noted that the preset threshold can be an upper limit of utilization set based on experience. When the current hardware resource utilization of the BMC virtual machine is greater than the preset threshold, it indicates that the remaining hardware resources of the BMC virtual machine are low, which has affected the performance of the BMC virtual machine and thus the execution efficiency of the test cases. For example, the preset threshold can be 80%, 85%, 90%, etc., and this embodiment of the invention does not limit it.
[0067] Specifically, if after all test cases corresponding to the previous layer have been tested, the current hardware resource utilization rate of each remaining previous BMC virtual machine is less than or equal to a preset threshold, indicating that each previous BMC virtual machine has sufficient hardware resources to execute the first test case of the current layer. In this case, the remaining number of test cases corresponding to all previous BMC virtual machines can be determined as the maximum number of machines that can be started in the current layer. If after all test cases corresponding to the previous layer have been tested, among the remaining previous BMC virtual machines, there is one with a current hardware resource utilization rate greater than a preset threshold, indicating that the previous BMC virtual machine with a current hardware resource utilization rate greater than the preset threshold does not have sufficient hardware resources to execute the first test case of the current layer. In this case, the previous BMC virtual machine can be released. With a fixed total amount of hardware resources, the hardware resources of the released previous BMC virtual machine will be allocated to other previous BMC virtual machines. At this time, the new current hardware resource utilization rate of the other previous BMC virtual machines is recalculated. If the new current hardware resource utilization rate is less than or equal to the preset threshold, indicating that the remaining other previous BMC virtual machines have sufficient hardware resources to execute the first test case of the current layer, the number of other previous BMC virtual machines can be determined as the maximum number of machines that can be started in the current layer. If there are still other previous BMC virtual machines whose current hardware resource utilization is greater than the preset threshold, the previous BMC virtual machines with the higher utilization can continue to be released until the new current hardware resource utilization of the remaining previous BMC virtual machines after adjustment is less than or equal to the preset threshold. At this time, the number of the remaining previous BMC virtual machines after adjustment is the maximum number of machines that can be started in the current layer.
[0068] In this embodiment of the 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 test cases, thereby improving the execution efficiency of test cases, accelerating the testing of processes under test at each layer, and thus improving the efficiency of BMC automated testing.
[0069] Step 230: Assign at least one first test case to at least one BMC virtual machine and test the current layer process to be tested corresponding to at least one BMC virtual machine.
[0070] Specifically, after configuring the BMC virtual machine of the current layer, all first test cases can be sequentially assigned to each BMC virtual machine for parallel execution, thereby achieving automated testing of the current layer's process under test launched in the BMC virtual machine.
[0071] It should be noted that all first test cases may include at least one test case suite. Each test case suite belongs to the same type of test, that is, each test case suite tests the same function. Due to factors such as resource contention, test isolation, dependencies, clarity of test results and test security, each test case suite cannot be executed in parallel on a single BMC virtual machine, but can be assigned to different BMC virtual machines for parallel execution.
[0072] Furthermore, at least one first test case is assigned to at least one BMC virtual machine, including:
[0073] Monitor the running status of at least one BMC virtual machine;
[0074] At least one first test case is sequentially assigned to a BMC virtual machine that is in an idle state.
[0075] Specifically, after configuring the BMC virtual machine 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 BMC virtual machines in an idle state, thereby achieving balanced scheduling of all first test cases.
[0076] For example, Figure 5 This is a schematic diagram of the allocation of the first test case provided in an embodiment of the present invention, as shown below. Figure 5As shown, taking a configuration of 3 BMC virtual machines and 10 test cases as an example, one test case is assigned to each BMC virtual machine in time periods 1, 2, and 3 respectively. Specifically, in time period 1, test case suite1-testcase1 is assigned to BMC virtual machine 1, suite1-testcase2 to BMC virtual machine 2, and suite1-testcase3 to BMC virtual machine 3. In time period 2, all three BMC virtual machines are idle. At this time, test case suite1-testcase4 can be assigned to BMC virtual machine 1, suite1-testcase5 to BMC virtual machine 2, and suite2-testcase1 to BMC virtual machine 3. In time period 3, all three BMC virtual machines are idle. At this time, test case suite2-testcase2 can be assigned to BMC virtual machine 1, suite2-testcase3 to BMC virtual machine 2, and suite2-testcase4 to BMC virtual machine 3. During time period 4, all three BMC virtual machines are in an idle state, and only one first test case remains in the current layer. At this time, the remaining first test case, suite3-testcase1, can be assigned to BMC virtual machine 1.
[0077] Furthermore, 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 detected in time period 2 that BMC virtual machine 1 and BMC virtual machine 2 are both in an idle state, while BMC virtual machine 3 is in an execution state. At this time, one first test case can be allocated to each of BMC virtual machine 1 and BMC virtual machine 2, but no first test case can be allocated to BMC virtual machine 3.
[0078] Step 240: Based on the running status of at least one BMC virtual machine, adjust the number of BMC virtual machines during the test.
[0079] Specifically, during the testing process, the number of BMC virtual machines can be adjusted reasonably according to the running status of each BMC virtual machine, thereby balancing the scheduling of hardware resources and ensuring that the adjusted BMC virtual machines have sufficient performance to execute the first test case, thus improving the execution efficiency of the test cases.
[0080] Furthermore, based on the running status of at least one BMC virtual machine, the number of BMC virtual machines during the test is adjusted, including:
[0081] If at least one BMC virtual machine exists in 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; an idle BMC virtual machine is a BMC virtual machine that has remained in an idle state for a preset time period.
[0082] For example, such as Figure 5 As shown, during time period 4, only one first test case remains among all the first test cases in the current layer, and it is assigned to BMC virtual machine 1. At this time, BMC virtual machine 2 and BMC virtual machine 3 remain idle during the time period after the remaining first test case is executed. This time period is greater than or equal to the preset duration. At this time, both BMC virtual machine 2 and BMC virtual machine 3 are 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 can be released, thereby increasing the hardware resources of BMC virtual machine 1, improving the efficiency of BMC virtual machine 1 in executing the first test case, and thus improving the execution efficiency of all first test cases.
[0083] The BMC automated testing method provided in this invention obtains a process startup dependency tree characterizing the dependencies between all processes under test in the BMC under test. Following the ascending order of the tree levels, the execution order of all test cases for the BMC under test is determined, and at least one first test case is assigned to the current layer. With fixed hardware resources, at least one BMC virtual machine is configured with utilization matching the current hardware resources. The current layer's process under test is started in each BMC virtual machine. After the current layer's process under test is started, all first test cases are assigned to each BMC virtual machine to test the current layer's process. The number of BMC virtual machines during the testing process is adjusted by monitoring the running status of each virtual machine. This invention achieves balanced scheduling of hardware resources during the automated testing of the BMC under test by rationally configuring the number of BMC virtual machines and adjusting them during the testing process, thereby accelerating the execution speed of test cases and improving the efficiency of BMC automated testing.
[0084] The BMC automated testing device provided by the present invention is described below. The BMC automated testing device described below can be referred to in correspondence with the BMC automated testing method described above.
[0085] Figure 6 This is a schematic diagram of the structure of the BMC automated testing device provided in an embodiment of the present invention, as shown below. Figure 6 As shown, the BMC automated testing device 600 includes: a determination module 610, a configuration module 620, a testing module 630, and an adjustment module 640.
[0086] The determination module 610 is used to determine at least one first test case corresponding to the process under test in the current layer from all test cases corresponding to the BMC under test, according to the order of the process startup and execution dependency tree from low to high. The process startup and execution dependency tree is used to characterize the dependency relationship between all processes under test in the BMC under test.
[0087] Configuration module 620 is used to configure at least one BMC virtual machine that matches the current hardware resource utilization rate, and to start the current layer test process in each BMC virtual machine.
[0088] Test module 630 is used to assign at least one first test case to at least one BMC virtual machine and test the current layer process to be tested corresponding to at least one BMC virtual machine.
[0089] The adjustment module 640 is used to adjust the number of BMC virtual machines during the test based on the running status of at least one BMC virtual machine.
[0090] The BMC automated testing device provided in this invention acquires a process startup dependency tree characterizing the dependencies between all processes under test in the BMC under test. Following the ascending order of the tree levels, it determines the execution order of all test cases for the BMC under test and identifies at least one first test case corresponding to the current layer. With fixed hardware resources, it configures at least one BMC virtual machine (VM) with utilization matching the current hardware resources and starts the current layer's process under test in each VM. After the current layer's process under test starts, all first test cases are assigned to each VM to test it. The device also adjusts the number of VMs during testing by monitoring the running status of each VM. This invention achieves balanced scheduling of hardware resources during automated testing of the BMC under test through reasonable configuration of the number of VMs and adjustments during the testing process, accelerating the execution speed of test cases and thus improving the efficiency of automated BMC testing.
[0091] Optionally, the configuration module 620 is specifically used for:
[0092] Based on the tree level where the current layer is located, determine the maximum number of BMC virtual machines that can be launched, which is consistent with the current hardware resource utilization rate of the current layer.
[0093] Configure the maximum number of BMC virtual machines to be launched.
[0094] Optionally, the configuration module 620 is specifically used for:
[0095] If the current layer is the first layer in the tree, determine the maximum number of BMC virtual machines that match the current hardware resource utilization of the first layer as a preset number, and configure the preset number of BMC virtual machines.
[0096] If the current layer is not the first layer in the tree, based on the current hardware resource utilization and remaining number of tests of each previous BMC virtual machine configured in the previous layer, determine the maximum number of BMC virtual machines that match the current hardware resources of the current layer, and configure the maximum number of BMC virtual machines to be started; the remaining number of tests and the maximum number of startups are both less than or equal to the preset number.
[0097] Optionally, the configuration module 620 is specifically used for:
[0098] If the current hardware resource utilization rate of each previous BMC virtual machine configured in the previous layer is less than or equal to a preset threshold after testing, the remaining number of the previous BMC virtual machines corresponding to the previous layer is determined as the maximum number of BMC virtual machines that can be started, which is consistent with the current hardware resources of the current layer; the remaining number of the test is the number of previous BMC virtual machines remaining after the test cases of the previous layer are completed.
[0099] If at least one of the previous BMC virtual machines configured in the previous layer has a current hardware resource utilization rate greater than the preset threshold after testing, the previous BMC virtual machines with a current hardware resource utilization rate greater than the preset threshold are released sequentially until the updated current hardware resource utilization rate of each of the remaining previous BMC virtual machines is less than or equal to the preset threshold. Then, the number of the remaining previous BMC virtual machines is determined as the maximum number of BMC virtual machines that can be started, which is consistent with the current hardware resources of the current layer.
[0100] Optionally, the test module 630 is specifically used for:
[0101] Monitor the running status of each of the at least one BMC virtual machines;
[0102] The at least one first test case is sequentially assigned to a BMC virtual machine that is in an idle state.
[0103] Optionally, the adjustment module 640 is specifically used for:
[0104] If at least one BMC virtual machine exists among the at least one BMC virtual machines, 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 has maintained an idle state for a preset time period.
[0105] Figure 7 This is a schematic diagram of the structure of the test case execution platform provided in the embodiments of the present invention, as shown below. Figure 7 As shown, the test case automation platform may include: a processor 710, a communications interface 720, a memory 730, and a communication bus 740. The processor 710, communications interface 720, and memory 730 communicate with each other via the communication bus 740. The processor 710 can call logical instructions in the memory 730 to execute a BMC automated testing method, which includes:
[0106] According to the process startup and execution dependency tree, in ascending order of tree levels, at least one first test case is determined from all test cases corresponding to the BMC under test for the current layer of the process under test; the process startup and execution dependency tree is used to characterize the dependency relationships between all processes under test in the BMC under test.
[0107] Configure at least one BMC virtual machine that matches the current hardware resource utilization, and start the current layer test process in each of the BMC virtual machines;
[0108] The at least one first test case is assigned 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;
[0109] The number of BMC virtual machines during the test is adjusted based on the running status of each of the at least one BMC virtual machine.
[0110] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0111] Optionally, the test case execution platform can be the Jenkins platform, which is a continuous integration tool developed based on Java. Jenkins is used to monitor repetitive tasks and aims to provide an open and easy-to-use software platform that enables continuous integration in software projects. This embodiment of the invention does not limit this approach.
[0112] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the BMC automated testing method provided by the above methods, the method comprising:
[0113] According to the process startup and execution dependency tree, in ascending order of tree levels, at least one first test case is determined from all test cases corresponding to the BMC under test for the current layer of the process under test; the process startup and execution dependency tree is used to characterize the dependency relationships between all processes under test in the BMC under test.
[0114] Configure at least one BMC virtual machine that matches the current hardware resource utilization, and start the current layer test process in each of the BMC virtual machines;
[0115] The at least one first test case is assigned 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;
[0116] The number of BMC virtual machines during the test is adjusted based on the running status of each of the at least one BMC virtual machine.
[0117] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the BMC automated testing method provided by the methods described above, the method comprising:
[0118] According to the process startup and execution dependency tree, in ascending order of tree levels, at least one first test case is determined from all test cases corresponding to the BMC under test for the current layer of the process under test; the process startup and execution dependency tree is used to characterize the dependency relationships between all processes under test in the BMC under test.
[0119] Configure at least one BMC virtual machine that matches the current hardware resource utilization, and start the current layer test process in each of the BMC virtual machines;
[0120] The at least one first test case is assigned 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;
[0121] The number of BMC virtual machines during the test is adjusted based on the running status of each of the at least one BMC virtual machine.
[0122] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0123] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An automated BMC testing method, characterized in that, include: Based on the order of the tree layers in the process startup dependency tree from low to high, determine at least one first test case corresponding to the process under test at the current layer from all the test cases corresponding to the BMC under test. The process startup dependency tree is used to characterize the dependency relationships between all processes under test in the BMC under test. If the current layer is the first layer in the tree, determine the maximum number of BMC virtual machines that match the current hardware resource utilization of the first layer as a preset number, and configure the preset number of BMC virtual machines. If the current layer is not the first layer in the tree, and the current hardware resource utilization rate of each previous BMC virtual machine configured in the previous layer is less than or equal to a preset threshold, the remaining number of the previous BMC virtual machines corresponding to the previous layer is determined as the maximum number of BMC virtual machines that can be started, which is consistent with the current hardware resources of the current layer; the remaining number of the test is the number of previous BMC virtual machines remaining after the test cases of the previous layer have been completed. If the current layer is not the first layer in the tree, and at least one of the previous BMC virtual machines configured in the previous layer has a current hardware resource utilization rate that is greater than the preset threshold, the previous BMC virtual machines with a current hardware resource utilization rate greater than the preset threshold are released sequentially until the updated current hardware resource utilization rate of each of the remaining previous BMC virtual machines is less than or equal to the preset threshold. Then, the number of the remaining previous BMC virtual machines is determined as the maximum number of BMC virtual machines that can be started, which is consistent with the current hardware resources of the current layer. Configure the maximum number of BMC virtual machines to be launched; the remaining number of tests and the maximum number of launches are both less than or equal to the preset number, and start the current layer test process in each of the BMC virtual machines; The at least one first test case is assigned 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; The number of BMC virtual machines during the test is adjusted based on the running status of each of the at least one BMC virtual machine.
2. The BMC automated testing method according to claim 1, characterized in that, Assigning the at least one first test case to the at least one BMC virtual machine includes: Monitor the running status of each of the at least one BMC virtual machines; The at least one first test case is sequentially assigned to a BMC virtual machine that is in an idle state.
3. The BMC automated testing method according to claim 1, characterized in that, Adjusting the number of BMC virtual machines during the test based on the respective running states of the at least one BMC virtual machine includes: If at least one BMC virtual machine exists among the at least one BMC virtual machines, 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 has maintained an idle state for a preset time period.
4. An automated BMC testing device, characterized in that, include: The determination module is used to determine at least one first test case corresponding to the process under test at the current layer from all test cases corresponding to the BMC under test, according to the order of the tree layers in the process startup dependency tree from low to high. The process startup dependency tree is used to characterize the dependency relationships between all processes under test in the BMC under test. The configuration module is configured to, when the current layer is the first layer in the tree, determine the maximum number of BMC virtual machines to be started that matches the current hardware resource utilization of the first layer as a preset number, and configure the preset number of BMC virtual machines; when the current layer is not the first layer in the tree, and the current hardware resource utilization of each BMC virtual machine configured in the previous layer after testing is less than or equal to a preset threshold, determine the remaining number of the previous BMC virtual machines corresponding to the previous layer as the maximum number of BMC virtual machines to be started that matches the current hardware resources of the current layer; the remaining number of the test is the number of previous BMC virtual machines remaining after the test cases in the previous layer have been completed; when the current layer is not the first layer in the tree, the configuration module is configured to, when the current layer is not the first layer in the tree, determine the remaining number of the previous BMC virtual machines to be started that matches the current hardware resources of the current layer; the configuration module is configured to, when the current layer is not the first layer in the tree, determine the maximum number of BMC virtual machines to be started that matches the current hardware resources of the current layer; the configuration module is configured to, when the current layer is not the first layer in the tree, determine the maximum number of BMC virtual machines to be started that matches the current hardware resources of the current layer; the configuration module is configured to, when the current layer is not the first layer in the tree, determine the maximum number of BMC virtual machines to be started that matches the current hardware resource utilization of the previous layer after testing the test cases in the previous ... after testing the test cases in the previous layer after testing the test cases in the previous layer after testing the test cases in the previous layer after testing the test cases in the previous layer after testing the test cases in In the first layer, if at least one of the previous BMC virtual machines configured in the previous layer has a current hardware resource utilization rate greater than the preset threshold after testing, the previous BMC virtual machines with a current hardware resource utilization rate greater than the preset threshold are released sequentially until the updated current hardware resource utilization rate of each of the remaining previous BMC virtual machines is less than or equal to the preset threshold. Then, the number of remaining previous BMC virtual machines is determined as the maximum number of BMC virtual machines that matches the current hardware resources of the current layer. The maximum number of BMC virtual machines to be started is configured. The remaining number of tests and the maximum number of starts are both less than or equal to the preset number, and the process to be tested in the current layer is started in each of the BMC virtual machines. The testing module is used to assign the at least one first test case to the at least one BMC virtual machine and test the 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 of each of the at least one BMC virtual machine.
5. 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, it implements the BMC automated testing method as described in any one of claims 1 to 3.
6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the BMC automated testing method as described in any one of claims 1 to 3.
7. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the BMC automated testing method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Automatic testing method and executing node
CN104679651A
Docker-based lightweight website deployment method
CN108021608A