Cluster consistency test method, device, equipment and storage medium

By backing up the operating system and uploading the test configuration on the node under test, cluster consistency testing was conducted, which resolved the functional abnormalities of different versions of the cluster in the hybrid cloud environment and enabled the normal operation and resource efficiency improvement of multi-version cluster products.

CN122309385APending Publication Date: 2026-06-30CHINA UNITED NETWORK COMM GRP CO LTD +2

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA UNITED NETWORK COMM GRP CO LTD
Filing Date
2024-12-30
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Most existing cluster consistency testing methods are for a single version and lack methods for testing cluster consistency across different versions, which makes it impossible to guarantee the normal operation of functions between different versions in a hybrid cloud environment.

Method used

By identifying multiple test versions of the cluster and components to be tested, creating test configurations, backing up the operating system on the test nodes and uploading the test configurations, performing consistency tests, monitoring the test process and generating reports, automatically handling exceptions, and adapting to the testing needs of multi-version clusters.

Benefits of technology

Consistency testing of multiple versions under test is performed under a single test environment resource to ensure the normal operation of multi-version cluster products, while reducing dependence on test environment resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122309385A_ABST
    Figure CN122309385A_ABST
Patent Text Reader

Abstract

This application relates to the field of microservice testing technology, and provides a cluster consistency testing method, apparatus, device, and storage medium. The method includes: determining at least one version of the cluster and components to be tested based on a test application, and creating a test configuration based on the cluster and the at least one version; importing the test configuration, and connecting at least one node to be tested in the cluster according to the test configuration; backing up the operating system of any node to be tested, then uploading the cluster and the test configuration, and performing consistency testing on the cluster according to the test configuration. Through this method, consistency testing of multiple versions can be performed under a single test environment resource, ensuring the normal operation of multi-version cluster products while reducing dependence on test environment resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of microservice testing technology, and in particular to a cluster consistency testing method, apparatus, device and storage medium. Background Technology

[0002] With the widespread adoption of cloud-native and containerization technologies, many developers and service providers have launched Kubernetes products based on private or public clouds. For some customers or vendors with specific business or technical needs, they may require customized development of Kubernetes cloud-native cluster functionalities. However, the complex architecture of these clusters necessitates that developers repeatedly conduct comprehensive consistency testing of existing functionalities during the development process to ensure that unmodified cluster functionality is free of anomalies.

[0003] Meanwhile, cloud service providers may offer different versions of cluster products. To ensure that the cluster functions properly and that no functionalities are missing or abnormal due to version differences, consistency testing between different versions needs to be performed in a hybrid cloud environment.

[0004] However, most existing cluster consistency testing methods are for a single version, and there is a lack of consistency testing methods for different versions. Summary of the Invention

[0005] This application provides a cluster consistency testing method, apparatus, device, and storage medium.

[0006] Firstly, this application provides a cluster consistency testing method, the method comprising:

[0007] Based on the test application, at least one version of the cluster and component to be tested is determined, and a test configuration is created based on the cluster to be tested and the at least one version to be tested;

[0008] Import the test configuration and connect at least one node to be tested in the cluster to be tested according to the test configuration;

[0009] For any node to be tested, back up the operating system of the node to be tested, and then upload the cluster to be tested and the test configuration;

[0010] Perform consistency testing on the cluster to be tested according to the test configuration.

[0011] In one possible implementation, performing consistency testing on the cluster under test according to the test configuration includes:

[0012] For any version to be tested, import the components of the version to be tested into the node to be tested, and then start the consistency test;

[0013] Monitor the current data during the consistency test and determine the current test status based on the current data;

[0014] If the current test status indicates that there is an anomaly in the consistency test, then an anomaly handling measure is determined according to the test configuration and the anomaly handling measure is executed.

[0015] If the current test status indicates that the consistency test has ended, a test report is generated, and it is determined whether there are any untested versions to be tested. Then, the corresponding operations are performed based on the determination result.

[0016] In one possible implementation, performing the corresponding operation based on the determination result includes:

[0017] If the determination result indicates that there are no untested versions to be tested, then the test reports corresponding to each version to be tested are summarized to obtain a consistency report, and the consistency report is transmitted.

[0018] If the determination result indicates that there is an untested version to be tested, then the node to be tested is restored to its initial state according to the backed-up operating system. After that, the cluster to be tested and the test configuration are installed, wherein the initial state indicates the state of the node to be tested when no consistency test is performed.

[0019] The process involves randomly selecting a version to be tested from the untested versions to be tested, repeatedly importing the components of the version to be tested into the node to be tested, starting the consistency test, and determining the current test status until the determination result indicates that there is no untested version to be tested.

[0020] In one possible implementation, determining and executing anomaly handling measures based on the test configuration includes:

[0021] Determine whether the aforementioned anomaly handling measures indicate an interruption of the consistency test;

[0022] If so, the consistency test is interrupted and a troubleshooting prompt message is output, wherein the troubleshooting prompt message is used to prompt the operator to troubleshoot the test anomaly;

[0023] If not, continue with the consistency test.

[0024] In one possible implementation, after outputting the troubleshooting prompt information, the method further includes:

[0025] Once an operator's response to the aforementioned troubleshooting prompts is detected, the consistency test continues.

[0026] In one possible implementation, creating the test configuration based on the cluster to be tested and the at least one version to be tested includes:

[0027] Obtain the test objectives for the consistency test based on the aforementioned test request;

[0028] Based on the test objective, at least one node to be tested is determined from the cluster to be tested, and the configuration parameters of each node to be tested are obtained;

[0029] A first test configuration is created based on the at least one node to be tested and the configuration parameters corresponding to each node to be tested.

[0030] Create a second test configuration based on at least one version to be tested.

[0031] In one possible implementation, the step of creating a second test configuration based on the at least one version to be tested includes:

[0032] Obtain the test plan contained in the test application, wherein the test plan is used to guide the execution of consistency tests;

[0033] A second test configuration is created based on the test plan and the at least one version to be tested.

[0034] Secondly, this application also provides a cluster consistency testing device, including a construction module, a transmission module, and a testing module:

[0035] The construction module is used to determine at least one version of the cluster and component to be tested based on the test application, and to create a test configuration based on the cluster to be tested and the at least one version to be tested.

[0036] The transmission module is used to import the test configuration and connect at least one node to be tested in the cluster to be tested according to the test configuration;

[0037] The transmission module is also used to back up the operating system of any node to be tested, and then upload the cluster to be tested and the test configuration.

[0038] The testing module is used to perform consistency testing on the cluster under test according to the testing configuration.

[0039] In one possible implementation, the test module is further configured to:

[0040] For any version to be tested, import the components of the version to be tested into the node to be tested, and then start the consistency test;

[0041] Monitor the current data during the consistency test and determine the current test status based on the current data;

[0042] If the current test status indicates that there is an anomaly in the consistency test, then an anomaly handling measure is determined according to the test configuration and the anomaly handling measure is executed.

[0043] If the current test status indicates that the consistency test has ended, a test report is generated, and it is determined whether there are any untested versions to be tested. Then, the corresponding operations are performed based on the determination result.

[0044] In one possible implementation, the test module is further configured to:

[0045] If the determination result indicates that there are no untested versions to be tested, then the test reports corresponding to each version to be tested are summarized to obtain a consistency report, and the consistency report is transmitted.

[0046] If the determination result indicates that there is an untested version to be tested, then the node to be tested is restored to its initial state according to the backed-up operating system. After that, the cluster to be tested and the test configuration are installed, wherein the initial state indicates the state of the node to be tested when no consistency test is performed.

[0047] The process involves randomly selecting a version to be tested from the untested versions to be tested, repeatedly importing the components of the version to be tested into the node to be tested, starting the consistency test, and determining the current test status until the determination result indicates that there is no untested version to be tested.

[0048] In one possible implementation, the test module is further configured to:

[0049] Determine whether the aforementioned anomaly handling measures indicate an interruption of the consistency test;

[0050] If so, the consistency test is interrupted and a troubleshooting prompt message is output, wherein the troubleshooting prompt message is used to prompt the operator to troubleshoot the test anomaly;

[0051] If not, continue with the consistency test.

[0052] In one possible implementation, after outputting the troubleshooting prompt information, the testing module is further configured to:

[0053] Once an operator's response to the aforementioned troubleshooting prompts is detected, the consistency test continues.

[0054] In one possible implementation, the building module is further configured to:

[0055] Obtain the test objectives for the consistency test based on the aforementioned test request;

[0056] Based on the test objective, at least one node to be tested is determined from the cluster to be tested, and the configuration parameters of each node to be tested are obtained;

[0057] A first test configuration is created based on the at least one node to be tested and the configuration parameters corresponding to each node to be tested.

[0058] Create a second test configuration based on at least one version to be tested.

[0059] In one possible implementation, the building module is further configured to;

[0060] Obtain the test plan contained in the test application, wherein the test plan is used to guide the execution of consistency tests;

[0061] A second test configuration is created based on the test plan and the at least one version to be tested.

[0062] Thirdly, this application also provides an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0063] The memory stores computer-executed instructions;

[0064] The processor executes computer execution instructions stored in the memory to implement the method as described in any of the first aspects.

[0065] Fourthly, this application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any of the first aspects.

[0066] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, can implement the steps of the scheme recommendation method as described in any of the first aspects.

[0067] The cluster consistency testing method, apparatus, equipment, and storage medium provided in this application determine at least one version of the cluster and components to be tested, create a test configuration, connect the nodes to be tested according to the imported test configuration, back up the operating system of each node to be tested, and finally upload the cluster to be tested and the test configuration, and perform consistency testing. Through this method, consistency testing of multiple versions to be tested can be performed under a single test environment resource, ensuring the normal operation of multi-version cluster products while reducing dependence on test environment resources. Attached Figure Description

[0068] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0069] Figure 1 A flowchart illustrating a cluster consistency testing method provided in this application embodiment. Figure 1 ;

[0070] Figure 2 A flowchart illustrating a cluster consistency testing method provided in this application embodiment. Figure 2 ;

[0071] Figure 3 A flowchart illustrating a cluster consistency testing method provided in this application embodiment. Figure 3 ;

[0072] Figure 4 This is a schematic diagram of the structure of a cluster consistency testing device provided in an embodiment of this application;

[0073] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0074] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0075] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0076] With the widespread adoption of cloud-native and containerization technologies, more and more customers and vendors need to customize Kubernetes clusters. However, due to the complexity of cluster architecture, developers need to continuously perform full-range consistency checks during the development process to ensure the cluster functions correctly. Meanwhile, cloud service providers may offer different versions of cluster products. To ensure seamless switching between different versions and avoid functional gaps or anomalies, multi-version consistency checks are essential in hybrid cloud environments. However, currently, most cluster consistency check methods are only for a single version and lack consistency check strategies for different versions.

[0077] The cluster consistency testing method provided in this application identifies at least one version of the cluster and components to be tested, creates a test configuration, connects the nodes to be tested according to the imported test configuration, backs up the operating system of each node to be tested, and finally uploads the cluster to be tested and the test configuration, and performs consistency testing. This method allows for consistency testing of multiple versions of the cluster under a single test environment resource, ensuring the normal operation of multiple versions of the cluster product while reducing dependence on test environment resources.

[0078] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0079] Figure 1 A flowchart illustrating a cluster consistency testing method provided in this application embodiment. Figure 1 .like Figure 1 As shown, the method includes:

[0080] S101. Determine at least one version of the cluster and component to be tested based on the test application, and create a test configuration based on the cluster and at least one version to be tested.

[0081] In this step, the test request indicates a need for consistency testing and includes the data required for the test, such as a test plan selected or edited by the operator to guide the consistency test, or the target object of this consistency test. Consistency testing is used to test whether the cluster functionality used or developed by the developer or cloud service provider is consistent with the native Kubernetes cluster functionality and whether its behavior conforms to the official Kubernetes specifications.

[0082] Specifically, upon receiving a test request, the cluster to be tested for this consistency test, as well as at least one version of the component to be tested, are determined based on the test request. A test configuration is then created based on the determined cluster to be tested and at least one version to be tested. This test configuration is used for subsequent building of the test environment.

[0083] It should be noted that the test configuration is used to guide the controller to connect to the resource under test, i.e., the node under test, and to initialize and install the corresponding environment. It also guides the consistency testing process. The specific content of the test configuration, and how to create the test configuration based on the cluster under test and at least one version under test, will be described in subsequent embodiments and will not be elaborated upon here.

[0084] S102. Import the test configuration and connect at least one node to be tested in the cluster to be tested according to the test configuration.

[0085] In this step, after creating a test configuration based on the cluster under test and at least one version under test, the controller needs to connect to the nodes under test in the test cluster according to the test configuration. Therefore, the controller imports the test configuration internally so that it can subsequently connect to the nodes under test based on the imported test configuration. Afterward, the controller connects to at least one node under test in the cluster under test according to the test configuration.

[0086] It should be noted that, in addition to importing the test configuration in the controller, you also need to import the resources required to support consistency testing, such as a component library containing test components and related configurations that consistency testing depends on.

[0087] Furthermore, before importing the test configuration into the controller, the controller must be deployed. This embodiment does not impose any limitations on how the controller is deployed. For example, since the controller is a key component of the cluster under test, responsible for managing resources within the cluster, it is typically deployed on the master node of the cluster under test. This is because it needs to handle resource management and coordination tasks within the cluster. The master node is usually the first node to join the cluster under test, responsible for electing the leader and managing the cluster.

[0088] Meanwhile, to prioritize rapid deployment, environmental consistency, ease of scalability, and maintenance, controller deployment can also be containerized. This requires the machine deploying the controller to be network reachable from the test nodes to ensure the controller's proper functioning. The specific process is as follows: In a containerized scenario, a relevant controller image is provided. When based on a Kubernetes cluster, deployment can be done with a single click using YAML or charts. This includes image resources, test dependency media, and deployment resources.

[0089] S103. For any node to be tested, back up the operating system of the node to be tested, and then upload the cluster to be tested and the test configuration.

[0090] In this step, since there are usually multiple nodes to be tested, generally: at least two nodes should be tested, one as the master node and one as a worker node. If the number of master nodes is not 1, the number of master nodes should be greater than 2. The number of worker nodes should be greater than 0.

[0091] For ease of explanation, this embodiment and subsequent embodiments will describe each node individually, focusing on any node to be tested.

[0092] Furthermore, since there may be multiple versions to be tested, if each version's component uses different environment resources for consistency testing, the environment resources within the test node will be insufficient to complete consistency testing for all versions when the number of versions is large. Therefore, this embodiment reduces the dependence of multi-version consistency testing on environment resources, completing consistency testing for all versions using a single set of resources.

[0093] Specifically, for any node under test, after the controller connects to the node according to the test configuration, it backs up the operating system of the node under test. This operating system is used to restore the initial test environment later. Then, the controller is invoked to upload the cluster under test and the test configuration to the node under test for subsequent test environment construction. It should be noted that this test environment is used to simulate the production environment.

[0094] In one possible implementation, the operating system of the node under test is Linux. Since Linux provides file system-level backup and restore capabilities that are independent of the hardware environment, backup and restore operations can proceed normally regardless of whether the node under test is on a physical machine or a virtual machine, as long as the file system structure of the operating system is the same. This increases the applicability of the consistency testing scheme.

[0095] S104. Perform consistency testing on the cluster to be tested according to the test configuration.

[0096] In this step, after the controller uploads the test configuration and the cluster to be tested within the node to be tested, a consistency test is performed on the cluster to be tested based on the test configuration.

[0097] Specifically, consistency testing is initiated and data is monitored during the consistency testing process. After the test is completed, a test report corresponding to the version to be tested is generated. Then, the test environment for this test is cleaned up and the initial test environment is restored through the backup operating system. Consistency testing is then performed on the components of other versions to be tested.

[0098] The cluster consistency testing method provided in this application identifies at least one version of the cluster and components to be tested, creates a test configuration, connects the nodes to be tested according to the imported test configuration, backs up the operating system of each node to be tested, and finally uploads the cluster to be tested and the test configuration, and performs consistency testing. This method allows for consistency testing of multiple versions of the cluster under a single test environment resource, ensuring the normal operation of multiple versions of the cluster product while reducing dependence on test environment resources.

[0099] Figure 2 A flowchart illustrating a cluster consistency testing method provided in this application embodiment. Figure 2 This implementation provides a detailed explanation of the steps for performing consistency testing on the cluster under test according to the test configuration. For example... Figure 2 As shown, the method includes:

[0100] S201. For any version to be tested, import the components of the version to be tested into the node to be tested, and then start the consistency test.

[0101] In this step, the component to be tested is the Kubernetes component of the version to be tested. Based on the test configuration, the controller selects the component of the version to be tested from multiple component versions imported into the controller's component library beforehand. This component, along with the test components in the component library used to support the consistency test and related arrangements, is then transferred to the node to be tested to set up the test environment. After the test environment is set up, the consistency test is started.

[0102] For example, Sonobuoy can be used as a tool for performing consistency testing.

[0103] S202. Monitor the current data during the consistency test and determine the current test status based on the current data.

[0104] In this step, during the consistency testing process, depending on the test configuration, if an anomaly is detected, the consistency test can continue only, recording the anomaly in the final generated test report; or, the consistency test can be interrupted, and operators can be prompted to investigate the anomaly. Therefore, it is necessary to monitor the data generated during the consistency test and determine the current test status based on this data. The current test status can be used to indicate the current stage of this consistency test and whether any anomalies exist.

[0105] Specifically, when it is determined that the consistency test has started, the current data during the consistency test process is monitored, and the current test status is determined based on the current data. This embodiment does not limit the steps of how to determine the current test status based on the current data.

[0106] In one possible implementation, the expected test path is determined based on the test configuration, and the current data is analyzed to determine whether it conforms to the expected test path. The current test status is then determined based on the analysis results.

[0107] S203. If the current test status indicates that there is an anomaly in the consistency test, determine the anomaly handling measures according to the test configuration and execute the anomaly handling measures.

[0108] In this step, when the current test status, determined based on the current data, indicates an anomaly in the consistency test, the predefined anomaly handling measures to be executed in the event of a consistency test anomaly are determined according to the test configuration, and then these anomaly handling measures are executed. The specific steps are as follows:

[0109] Determine whether the exception handling measures indicate an interruption of the consistency test;

[0110] If so, the consistency test will be interrupted and a troubleshooting prompt message will be output. The troubleshooting prompt message is used to prompt the operator to troubleshoot the test anomaly.

[0111] If not, continue with the consistency test.

[0112] Furthermore, after outputting the troubleshooting prompt message, the consistency test should continue only after confirming that the operator has responded to the prompt message. For example, this action could be clicking a button or control indicating that the consistency test should continue.

[0113] S204. If the current test status indicates that the consistency test has ended, generate a test report and determine whether there are any untested versions to be tested.

[0114] In this step, once the current test status indicates the end of the current consistency test, a test report is generated based on the data monitored during the process. Considering there may be multiple versions to be tested, after generating the test report, it is further determined whether there are still versions that have not undergone consistency testing. Based on the determination result, it is decided whether to continue consistency testing or generate the final report.

[0115] S205. If the result indicates that there is no untested version to be tested, then summarize the test reports corresponding to each version to be tested to obtain a consistency report and transmit the consistency report.

[0116] In this step, once the result indicates that there is no version under test that has not undergone consistency testing, the test reports corresponding to each version under test are summarized to obtain a consistency report, and the consistency report is transmitted.

[0117] S206. If the result indicates that there is an untested version to be tested, restore the node to be tested to its initial state according to the backed-up operating system, and then install the cluster to be tested and the test configuration.

[0118] The initial state indicates the state of the node under test before consistency testing is performed.

[0119] In this step, if it is determined that there are still untested versions to be tested, the test environment previously built in the node to be tested needs to be restored to its initial state, and then the consistency test is performed again.

[0120] Specifically, when the results indicate the existence of an untested version to be tested, the test environment within the node to be tested is cleaned up, including but not limited to the data and status generated by the aforementioned consistency test. After cleanup, the test environment of the node to be tested is restored to its initial state by installing a pre-backed-up operating system. Then, the cluster to be tested and the test configuration are installed.

[0121] S207. Randomly obtain the version to be tested for this consistency test from the untested versions to be tested, and repeatedly import the components of the version to be tested into the node to be tested, start the consistency test, and determine the current test status until the determination result indicates that there is no untested version to be tested.

[0122] In this step, when it is determined that consistency testing should continue on other versions to be tested, after restoring the test environment and installing the cluster and test configuration, a version corresponding to this consistency test is randomly selected from the untested versions. The controller is then invoked to transfer the components of this version, along with other test components and configurations supporting consistency testing in the component library, to the node to be tested. After that, the consistency test is started. The operations during the consistency test process are the same as those described above, so they will not be explained in detail here.

[0123] The cluster consistency testing method provided in this application calls the controller to transmit the component version to be tested and starts consistency testing. It monitors the current data during the testing process and determines the current test status. Based on the current test status, it generates a test report and determines whether all versions to be tested have been tested. Based on the determination result, it generates a consistency test report, or restores the test environment and continues consistency testing, or determines and executes exception handling statements. Through the above methods, the installation and cleanup of the corresponding versions in the test environment can be automated, and the testing can be completed, making the solution more intelligent.

[0124] Figure 3 A flowchart illustrating a cluster consistency testing method provided in this application embodiment. Figure 3 This implementation provides detailed instructions on how to create a test configuration based on the cluster to be tested and at least one version to be tested. For example... Figure 3 As shown, the method includes:

[0125] S301. Obtain the test objectives for the consistency test based on the test request.

[0126] In this step, the nodes to be tested can be selected manually by the operator or automatically by the node selector. Therefore, upon receiving a test request, the test target for the consistency test is obtained based on the test request. This test target can indicate only the cluster to be tested, or it can indicate the target node specified by the operator according to the test requirements.

[0127] S302. Based on the test objective, determine at least one node to be tested from the cluster to be tested, and obtain the configuration parameters of each node to be tested.

[0128] In this step, after obtaining the test target, the selection method for the nodes to be tested is determined based on the test target. For example, if the test target indicates the cluster to be tested, the corresponding selection method is automatic selection; if the test target indicates the target node, the corresponding selection method is manual selection.

[0129] Furthermore, when the selection method is determined to be automatic selection, at least one node to be tested is determined from the cluster under test using a node selector based on node affinity rules; when the selection method is determined to be manual selection, at least one node to be tested is determined from the cluster under test according to the test objective. Then, the configuration parameters of each node to be tested are obtained. For example, the configuration parameters include the username and password of the node to be tested, the operating system model of the node to be tested, the CPU architecture of the node to be tested, the role of the node to be tested in the cluster, the component library address, etc.

[0130] S303. Create a first test configuration based on at least one node to be tested and the configuration parameters corresponding to each node to be tested.

[0131] In this step, the first test configuration is used for the controller to connect to the node under test and for initializing and installing the corresponding environment.

[0132] Specifically, when at least one node to be tested and the configuration parameters corresponding to each node to be tested are determined in the cluster to be tested, a first test configuration is created based on the aforementioned two contents.

[0133] S304. Obtain the test plan contained in the test application, and create a second test configuration based on the test plan and at least one version to be tested.

[0134] In this step, the test plan guides the execution of consistency tests. For example, a test plan includes test scripts, test data, test parameters, test scenarios, and monitoring configurations. Specifically:

[0135] Test scripts are used to verify whether the functionality and performance of the cluster under test meet expectations. Test data is used to ensure that the test scripts can be run on real datasets. Test parameters may include test load, test duration, number of concurrent users, etc. Test scenarios may include normal business processes and abnormal input data. Monitoring configurations are used to collect data and system logs during consistency testing for analyzing test results.

[0136] Therefore, after obtaining the test plan based on the test application, a second test configuration is created based on the test plan and the version to be tested.

[0137] It should be noted that this second test configuration also includes configuration items for the tools used to perform consistency testing. For example, if the tool used for consistency testing is Sonobuoy, the second test configuration should also include Sonobuoy configuration items.

[0138] The cluster consistency testing method provided in this application determines the selection method of the nodes to be tested based on the test objectives included in the test application, and then selects the nodes to be tested based on the selection method. A first test configuration is created based on the nodes to be tested and their corresponding configuration parameters, and a second test configuration is created based on the test plan included in the test application and the version to be tested. Through this method, the expected cluster state is defined, as well as how to verify whether the cluster to be tested has reached this state, thus ensuring the reliability of subsequent consistency test results.

[0139] Figure 4 This is a schematic diagram of a cluster consistency testing device provided in an embodiment of this application. Figure 4 As shown, the cluster consistency testing device 40 includes: a construction module 401, a transmission module 402, and a testing module 403.

[0140] The construction module 401 is used to determine at least one version of the cluster and component to be tested according to the test application, and to create a test configuration according to the cluster to be tested and the at least one version to be tested.

[0141] The transmission module 402 is used to import the test configuration and connect at least one node to be tested in the cluster to be tested according to the test configuration;

[0142] The transmission module 402 is also used to back up the operating system of any node to be tested, and then upload the cluster to be tested and the test configuration.

[0143] The test module 403 is used to perform consistency testing on the cluster to be tested according to the test configuration.

[0144] In one possible implementation, the test module 403 is further configured to:

[0145] For any version to be tested, import the components of the version to be tested into the node to be tested, and then start the consistency test;

[0146] Monitor the current data during the consistency test and determine the current test status based on the current data;

[0147] If the current test status indicates that there is an anomaly in the consistency test, then an anomaly handling measure is determined according to the test configuration and the anomaly handling measure is executed.

[0148] If the current test status indicates that the consistency test has ended, a test report is generated, and it is determined whether there are any untested versions to be tested. Then, the corresponding operations are performed based on the determination result.

[0149] In one possible implementation, the test module 403 is further configured to:

[0150] If the determination result indicates that there are no untested versions to be tested, then the test reports corresponding to each version to be tested are summarized to obtain a consistency report, and the consistency report is transmitted.

[0151] If the determination result indicates that there is an untested version to be tested, then the node to be tested is restored to its initial state according to the backed-up operating system. After that, the cluster to be tested and the test configuration are installed, wherein the initial state indicates the state of the node to be tested when no consistency test is performed.

[0152] The process involves randomly selecting a version to be tested from the untested versions to be tested, repeatedly importing the components of the version to be tested into the node to be tested, starting the consistency test, and determining the current test status until the determination result indicates that there is no untested version to be tested.

[0153] In one possible implementation, the test module 403 is further configured to:

[0154] Determine whether the aforementioned anomaly handling measures indicate an interruption of the consistency test;

[0155] If so, the consistency test is interrupted and a troubleshooting prompt message is output, wherein the troubleshooting prompt message is used to prompt the operator to troubleshoot the test anomaly;

[0156] If not, continue with the consistency test.

[0157] In one possible implementation, after outputting the troubleshooting prompt information, the test module 403 is further configured to:

[0158] Once an operator's response to the aforementioned troubleshooting prompts is detected, the consistency test continues.

[0159] In one possible implementation, the building module 401 is further configured to:

[0160] Obtain the test objectives for the consistency test based on the aforementioned test request;

[0161] Based on the test objective, at least one node to be tested is determined from the cluster to be tested, and the configuration parameters of each node to be tested are obtained;

[0162] A first test configuration is created based on the at least one node to be tested and the configuration parameters corresponding to each node to be tested.

[0163] Create a second test configuration based on at least one version to be tested.

[0164] In one possible implementation, the building module 401 is further configured to;

[0165] Obtain the test plan contained in the test application, wherein the test plan is used to guide the execution of consistency tests;

[0166] A second test configuration is created based on the test plan and the at least one version to be tested.

[0167] This embodiment provides a cluster consistency testing device that can execute the cluster consistency testing method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0168] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 5 As shown, the electronic device 50 includes a processor 501 and a memory 502 communicatively connected to the processor 501. Optionally, the electronic device 50 further includes a communication component 503. The processor 501, memory 502, and communication component 503 are connected via a bus 504.

[0169] The memory 502 stores computer-executed instructions;

[0170] The processor 501 executes computer execution instructions stored in the memory 502 to implement the method as described in any of the preceding descriptions.

[0171] At least one processor 501 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.

[0172] Optionally, in specific implementations, the processor 501 and memory 502 are implemented independently. In this case, the processor 501 and memory 502 can be interconnected via a bus to complete communication between them. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc., but this does not imply that there is only one bus or one type of bus.

[0173] Optionally, in a specific implementation, if the processor 501 and the memory 502 are integrated on a single chip, the processor 501 and the memory 502 can communicate through an internal interface.

[0174] This application also provides a computer storage medium storing computer execution instructions, which, when executed by a processor, implements the aforementioned cluster consistency test method.

[0175] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The computer-readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0176] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Alternatively, the readable storage medium can be an integral part of the processor. Both the processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the control device of a garment handling apparatus.

[0177] The division of units described herein is merely a logical functional division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0178] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0179] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0180] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion 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 described in the various embodiments of this 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.

[0181] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0182] The technical solutions of this application have been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it is readily understood by those skilled in the art that the scope of protection of this application is obviously not limited to these specific embodiments. The above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit them. Although this application 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 or all of the technical features therein. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A cluster consistency testing method, characterized in that, The method includes: Based on the test application, at least one version of the cluster and component to be tested is determined, and a test configuration is created based on the cluster to be tested and the at least one version to be tested; Import the test configuration and connect at least one node to be tested in the cluster to be tested according to the test configuration; For any node to be tested, back up the operating system of the node to be tested, and then upload the cluster to be tested and the test configuration; Perform consistency testing on the cluster to be tested according to the test configuration.

2. The method according to claim 1, characterized in that, The consistency test performed on the cluster under test according to the test configuration includes: For any version to be tested, import the components of the version to be tested into the node to be tested, and then start the consistency test; Monitor the current data during the consistency test and determine the current test status based on the current data; If the current test status indicates that there is an anomaly in the consistency test, then an anomaly handling measure is determined according to the test configuration and the anomaly handling measure is executed. If the current test status indicates that the consistency test has ended, a test report is generated, and it is determined whether there are any untested versions to be tested. Then, the corresponding operations are performed based on the determination result.

3. The method according to claim 2, characterized in that, The step of performing the corresponding operation based on the determined result includes: If the determination result indicates that there are no untested versions to be tested, then the test reports corresponding to each version to be tested are summarized to obtain a consistency report, and the consistency report is transmitted. If the determination result indicates that there is an untested version to be tested, then the node to be tested is restored to its initial state according to the backed-up operating system. After that, the cluster to be tested and the test configuration are installed, wherein the initial state indicates the state of the node to be tested when no consistency test is performed. The process involves randomly selecting a version to be tested from the untested versions to be tested, repeatedly importing the components of the version to be tested into the node to be tested, starting the consistency test, and determining the current test status until the determination result indicates that there is no untested version to be tested.

4. The method according to claim 3, characterized in that, The step of determining and executing anomaly handling measures based on the test configuration includes: Determine whether the aforementioned anomaly handling measures indicate an interruption of the consistency test; If so, the consistency test is interrupted and a troubleshooting prompt message is output, wherein the troubleshooting prompt message is used to prompt the operator to troubleshoot the test anomaly; If not, continue with the consistency test.

5. The method according to claim 4, characterized in that, After outputting the troubleshooting prompt information, the method further includes: Once an operator's response to the aforementioned troubleshooting prompts is detected, the consistency test continues.

6. The method according to any one of claims 1-5, characterized in that, The step of creating a test configuration based on the cluster to be tested and the at least one version to be tested includes: Obtain the test objectives for the consistency test based on the aforementioned test request; Based on the test objective, at least one node to be tested is determined from the cluster to be tested, and the configuration parameters of each node to be tested are obtained; A first test configuration is created based on the at least one node to be tested and the configuration parameters corresponding to each node to be tested. Create a second test configuration based on at least one version to be tested.

7. The method according to claim 6, characterized in that, The step of creating a second test configuration based on the at least one version to be tested includes: Obtain the test plan contained in the test application, wherein the test plan is used to guide the execution of consistency tests; A second test configuration is created based on the test plan and the at least one version to be tested.

8. A cluster consistency testing device, characterized in that, Includes a build module, a transport module, and a test module: The construction module is used to determine at least one version of the cluster and component to be tested based on the test application, and to create a test configuration based on the cluster to be tested and the at least one version to be tested. The transmission module is used to import the test configuration and connect at least one node to be tested in the cluster to be tested according to the test configuration; The transmission module is also used to back up the operating system of any node to be tested, and then upload the cluster to be tested and the test configuration. The testing module is used to perform consistency testing on the cluster under test according to the testing configuration.

9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 7.