Automatic testing method and device for charging scene
By automating the extraction and assembly of test plugins and scripts in the chaos testing system, the inefficiency of existing tools in non-containerized environments is solved, enabling a fast and standardized automated testing process and improving testing efficiency and resource utilization.
Patent Information
- Application Number
- CN202411434102.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2024-11-12
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing chaos engineering tools are inefficient in non-containerized deployment environments such as traditional virtual machines and physical servers. They lack standardized business use case libraries and fault injection templates, resulting in heavy reliance on manual intervention and making it difficult to achieve rapid iteration and broad environment compatibility.
Design an automated testing method and device for charging scenarios. By transmitting information between the controller and the controlled machine of a chaotic testing system, test plug-ins and scripts are automatically extracted using a pre-configured database to generate a comprehensive test instruction set, reducing manual intervention and realizing an automated testing process.
It significantly accelerated test startup speed, improved test efficiency, reduced manual operation delays, achieved standardization of testing in different scenarios and efficient resource scheduling, and strengthened collaboration between development and operations.
Smart Images

Figure CN118939567A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of charging scenario testing, and in particular to an automated testing method and device for charging scenarios. Background Art
[0002] As the complexity of software systems continues to increase, ensuring high reliability and resilience of the system has become a vital requirement. Traditional software testing methods have limitations in evaluating the fault tolerance of the system under extreme conditions, especially in reflecting the performance of the system in the real operating environment. Chaos engineering came into being as a proactive means of system reliability verification. By deliberately inducing controllable failures (such as network interruptions, hardware failures, and service crashes) in distributed systems, potential vulnerabilities can be systematically identified and repaired to enhance the resilience and stability of the system. Currently, there are advanced chaos engineering practice tools on the market, such as the Alibaba Cloud open source project Chaosblade, especially Chaosblade-box, which provides a comprehensive containerized solution for the Kubernetes environment. Chaosblade-box integrates the full-link functions of fault injection, recovery, monitoring, and data analysis, and supports the visual design and analysis of experiments through an intuitive Web UI. It seamlessly connects to monitoring systems such as Prometheus and Grafana, greatly facilitating the implementation of chaos experiments on the Kubernetes platform.
[0003] However, existing technologies have shown obvious limitations when facing non-containerized deployment environments, especially traditional virtual machines and physical servers. Fault injection and management in these environments often rely on a lot of manual intervention, which is not only inefficient but also difficult to implement on a large scale. It usually takes several months to complete a chaos engineering exercise covering all scenarios, which seriously hinders the pace of rapid iteration and continuous optimization. In addition, the lack of standardized business use case libraries, fault injection templates, and effective management of test environments makes it difficult to accumulate and reuse knowledge and experience, further restricting the depth and breadth of chaos engineering practices.
[0004] In view of the above challenges, there is an urgent need to build a more universal and efficient chaos engineering drill platform to reduce manual dependence, accelerate the testing cycle, and achieve wide environment compatibility, including but not limited to Kubernetes clusters, to meet the rapidly changing IT architecture requirements and ensure system stability and reliability in various deployment environments. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide an automated testing method and device for charging scenarios, which are respectively applied to the control machine and the controlled machine of the chaos testing system, thereby strengthening the collaboration between development and operation and maintenance, greatly reducing the time and workload of manual intervention, and accelerating the testing cycle.
[0006] In the first aspect, an embodiment of the present invention provides an automated testing method for charging scenarios, wherein the method is applied to a control machine of a chaos test system, and the chaos test system also includes a controlled machine and a message processor; wherein the control machine and the controlled machine transmit information through the message processor; the control machine is a machine running a chaos experiment engine, and the controlled machine is a machine to be tested; the method includes: responding to a scenario test instruction; wherein the scenario test instruction includes an identifier of the controlled machine, and information used to characterize the chaos experiment scenario to be tested; according to the scenario test instruction, extracting an identifier of a test plug-in and / or a test script that matches the chaos experiment scenario information to be tested from a pre-configured database; wherein the test script includes an environment management script, a fault injection script, and a business test script; each test script contains a script definition; assembling the identifier of the controlled machine, the identifier of the test plug-in and / or the test script, and generating a comprehensive test instruction set that matches the chaos experiment scenario information to be tested; pushing the comprehensive test instruction set to the message processor, so as to push the comprehensive test instruction set to the controlled machine through the message processor.
[0007] In combination with the first aspect, an embodiment of the present invention provides a first implementation method of the first aspect, wherein the message processor is configured with an automatic operation and maintenance communication interface; the step of pushing the comprehensive test instruction set to the message processor so as to push the comprehensive test instruction set to the controlled machine through the message processor includes: pushing the comprehensive test instruction set to the automatic operation and maintenance communication interface of the message processor so as to push the comprehensive test instruction set to each controlled machine through the automatic operation and maintenance communication interface.
[0008] In combination with the first aspect, an embodiment of the present invention provides a second implementation of the first aspect, wherein the method further comprises: receiving a test result of the controlled machine transmitted by the message processor to record the test result.
[0009] In combination with the first aspect, an embodiment of the present invention provides a third implementation of the first aspect, wherein the method further comprises: defining a program targeted by the test script and a controlled machine to be tested targeted by the test script.
[0010] In the second aspect, an embodiment of the present invention provides another automated testing method for charging scenarios, wherein the method is applied to a controlled machine of a chaos testing system, and the chaos testing system also includes a control machine and a message processor; wherein the control machine and the controlled machine transmit information through the message processor; the control machine is a machine running a chaos experiment engine, and the controlled machine is a machine to be tested; the method includes: receiving a comprehensive test instruction set sent by the controlled machine via the message processor; wherein the comprehensive test instruction set carries an identifier of the controlled machine, an identifier of a test plug-in and / or a test script; extracting the identifier of the controlled machine carried in the comprehensive test instruction set; determining whether the identifier of the controlled machine is consistent with the host identifier configured by itself; if so, extracting the identifier of the test plug-in and / or the test script to perform automated testing based on the identifier of the test plug-in and / or the test script.
[0011] In combination with the second aspect, an embodiment of the present invention provides a first implementation of the second aspect, wherein the above method also includes: in response to the completion of the automated test, obtaining the result of the automated test; sending the result of the automated test to the message processor, so as to transmit the result of the automated test to the control machine via the message processor.
[0012] In combination with the second aspect, an embodiment of the present invention provides a second implementation of the second aspect, wherein the above method also includes: if it is determined that the identification of the controlled machine is inconsistent with the host identification configured by itself; then discarding the current comprehensive test instruction set.
[0013] In the third aspect, an embodiment of the present invention also provides an automated testing device for charging scenarios, wherein the device is applied to a control machine of a chaos test system, and the chaos test system also includes a controlled machine and a message processor; wherein the control machine and the controlled machine transmit information through the message processor; the control machine is a machine running a chaos experiment engine, and the controlled machine is a machine to be tested; the device includes: a response module for responding to scenario test instructions; wherein the scenario test instructions include an identifier of the controlled machine and information for characterizing the chaos experiment scenario to be tested; an extraction module for extracting, according to the scenario test instructions, the identifier of a test plug-in and / or a test script that matches the chaos experiment scenario information to be tested from a pre-configured database; a data processing module for assembling the identifier of the controlled machine, the identifier of the test plug-in and / or the test script, and generating a comprehensive test instruction set that matches the chaos experiment scenario information to be tested; a communication module for pushing the comprehensive test instruction set to the message processor, so as to push the comprehensive test instruction set to the controlled machine through the message processor.
[0014] In a fourth aspect, an embodiment of the present invention further provides an automated testing device for charging scenarios, wherein the device is applied to a controlled machine of a chaos testing system, and the chaos testing system further includes a control machine and a message processor; wherein the control machine and the controlled machine transmit information through the message processor; the control machine is a machine running a chaos experiment engine, and the controlled machine is a machine to be tested; the device includes: a receiving module, for receiving a comprehensive test instruction set sent by the controlled machine via the message processor; wherein the comprehensive test instruction set carries an identifier of the controlled machine, and an identifier of a test plug-in and / or a test script; a data acquisition module, for extracting the identifier of the controlled machine carried in the comprehensive test instruction set; an execution module, for determining whether the identifier of the controlled machine is consistent with the host identifier configured by itself; if so, extracting the identifier of the test plug-in and / or the test script to perform automated testing based on the identifier of the test plug-in and / or the test script.
[0015] In a fifth aspect, an embodiment of the present invention further provides an electronic device, comprising a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the automated testing method for charging scenarios of any of the above embodiments.
[0016] The embodiment of the present invention brings the following beneficial effects: an automated testing method and device for charging scenarios in the embodiment of the present invention, by designing a chaos test system, automatically responds to scenario test instructions when scenario testing is required, replaces the process of manually triggering the test, and significantly speeds up the test startup speed. The automated process reduces the delay of human operation, enables the test to be executed quickly, and improves the overall test efficiency. In addition, the knowledge of business use cases, business scenarios, and fault injection is precipitated into plug-ins and scripts, and when performing scenario testing, the identification of the controlled machine and the specific information of the chaos experiment scenario are extracted by parsing the instruction content, and the pre-configured database is connected to find the identification of the test plug-in and / or the corresponding test script matching the scenario according to the test situation. Subsequently, these data are organized according to the identification of the scenario to be tested and the controlled machine, and assembled into a structured comprehensive test instruction set. The comprehensive test instruction set is passed to the specified controlled machine through the message processor, thereby triggering the automated test process. The present invention strengthens the collaboration between development and operation and maintenance, and the automated process and message processing mechanism can efficiently schedule the controlled machine to execute test instructions, allocate resources on demand, and realize the standardization of the test process. Moreover, it can meet the testing needs of different scenarios, greatly reducing the time and workload of manual intervention and accelerating the testing cycle.
[0017] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0018] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 A flowchart of an automated testing method for charging scenarios provided by an embodiment of the present invention; Figure 2 A schematic diagram of information push provided by an embodiment of the present invention; Figure 3 A runtime architecture corresponding to a chaos test system provided by an embodiment of the present invention; Figure 4 A flowchart of another automated testing method for charging scenarios provided by an embodiment of the present invention; Figure 5 A schematic diagram of the structure of an automatic testing device for charging scenarios provided by an embodiment of the present invention; Figure 6 A schematic diagram of the structure of another automatic testing device for charging scenarios provided by an embodiment of the present invention; Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described in combination with the embodiments below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0022] As modern software systems become increasingly complex, the requirements for their reliability and resilience are also increasing. Traditional software testing methods often test the fault tolerance of the real operating environment under extreme conditions. In order to make up for this deficiency, the industry has proposed the concept of Chaos Engineering. Chaos Engineering is to evaluate the reliability of the system and discover potential problems by introducing controlled failure conditions in distributed systems, such as network interruptions, hardware failures, server downtime, etc. At this time, deploying a unified chaos experiment platform can realize flexible configuration of various scenarios, automatically execute experiments, collect results and analyze reports.
[0023] The current chaos experiment platform is represented by Chaosblade, which is open sourced by Alibaba Cloud. Chaosblade-box in Chaosblade is an open source containerized solution based on Kubernetes. It provides a full-process tool for injecting faults, recovering faults, system monitoring, and problem recording. It provides a Web UI to support visual experimental design, execution, and analysis; it uses Kubernetes' own fault injection mechanism without modifying the application code; it supports network failures, Pod failures, node failures, etc.; it integrates with tools such as Prometheus and Grafana to achieve monitoring and visualization. In principle, this tool is suitable for most software systems, but it is mainly for stand-alone deployment systems or sub-deployment systems deployed on the K8s platform. It has limited support for other systems that are not stand-alone or deployed on the K8s platform.
[0024] In the existing technology, chaos engineering relies heavily on manual intervention, and it takes at least three months to complete a full-scenario chaos engineering drill. In addition, current mainstream chaos engineering tools such as Chaosblade use the characteristics of containers and microservices, such as dynamic expansion and contraction, service discovery, etc., to achieve accurate injection and recovery of faults. However, for virtual machines or physical machines in traditional architectures, there is a lack of corresponding interfaces and mechanisms to efficiently and accurately trigger and control fault scenarios. Moreover, the traditional environment lacks a unified management and monitoring system, making it difficult to integrate fault injection tools with its monitoring system, log collection and other infrastructure. In non-container environments, more manual configuration and scripts may be required to achieve fault injection and recovery, which is not only inefficient, but may also introduce human errors, which is inconsistent with the automation and large-scale testing concept pursued by chaos engineering.
[0025] In summary, the incompatibility of technology stacks, integration complexity, differences in resource management, and reliance on manual operations together constitute technical barriers that prevent existing chaos engineering platforms from effectively covering traditional virtual machine and physical machine scenarios.
[0026] In this regard, an embodiment of the present invention provides an automated testing method and device for charging scenarios, which is applied to a control machine or a controlled machine of a chaos test system; the chaos test system also includes a controlled machine and a message processor; wherein the control machine and the controlled machine transmit information through the message processor; the control machine is a machine running a chaos experiment engine, and the controlled machine is a machine to be tested. The embodiment of the present invention strengthens the collaboration between development and operation and maintenance, and the automated process and message processing mechanism can efficiently schedule the controlled machine to execute test instructions, allocate resources on demand, and avoid idleness and waste of resources. Moreover, the time and workload of manual intervention are greatly reduced, and the test cycle is accelerated.
[0027] For ease of understanding, firstly, an automatic testing method for charging scenarios provided by an embodiment of the present invention and a control machine applied to a chaos testing system are described in detail. Figure 1 A flowchart of an automated testing method for a charging scenario provided by an embodiment of the present invention is shown. Figure 1 As shown, the method comprises the following steps: Step S102, responding to a scenario test instruction.
[0028] Step S104: extracting the identification of the test plug-in and / or test script matching the chaos experiment scenario information to be tested from a pre-configured database according to the scenario test instruction.
[0029] Step S106, assembling the identification of the controlled machine, the identification of the test plug-in and / or the identification of the test script to generate a comprehensive test instruction set matching the chaos experiment scenario information to be tested.
[0030] Step S108, pushing the comprehensive test instruction set to the message processor, so as to push the comprehensive test instruction set to the controlled machine through the message processor.
[0031] In specific implementation, the chaos test system is an automated testing tool designed to improve the resilience of distributed systems and cloud infrastructure. By deliberately introducing faults (such as server downtime, network delays, data loss, etc.) in the production environment, various fault conditions that may occur in the real world are simulated to evaluate and optimize the stability and fault recovery capabilities of the system. That is, actively look for potential weaknesses when the system is operating normally, rather than waiting until the real fault occurs to deal with it. It helps to discover and fix problems in advance and reduce the uncertainty and risk of the system when facing emergencies. However, the existing technology has more manual intervention, and it takes at least 3 months to complete a full-scenario chaos engineering exercise for one charge. In addition, there is a lack of accumulation of business use cases, business scenarios, fault injection, etc., and they have not been precipitated into tools, which affects the test efficiency. In this regard, the embodiment of the present invention precipitates knowledge such as business use cases, business scenarios, and fault injection into plug-ins and scripts to achieve standardization of the test process. This not only unifies the test standards, but also facilitates knowledge inheritance and reuse.
[0032] Among them, the embodiment of the present invention is to perform automated testing on the charging scenario, and use the chaos test system to automatically obtain the required test scripts and test plug-ins when testing is required, generate a comprehensive test instruction set based on these contents, and send it to the machine to be tested. In the specific implementation, after sending the comprehensive test instruction set, the machine to be tested is tested by simulating the corresponding test scenario, such as simulating the state of multiple terminals being charged, simulating the failure of injecting Redis downtime, etc.
[0033] Specifically, the test steps corresponding to the above test scenarios are: 1. Environment initialization step, simulating that multiple terminals are charging. 2. Fault injection: simulate the injection of Redis downtime failure. 3. Business verification, automatic login verification such as whether scheduled charging can be started. Based on this, the chaos test system simulates the corresponding test scenario for the machine to be tested based on the above comprehensive test instruction set, and tests the machine by verifying whether the current charging business of the machine is affected. For example, by automatically logging into the system and simulating clicking the scheduled charging button, it is verified whether the charging is started successfully. Among them, the selection of plug-ins or scripts is for different controlled targets, or determined according to the complexity of the business. Some are suitable for plug-ins, and some are more suitable for scripts. In some cases, the test scenario is jointly constituted by plug-ins and scripts. The above test steps can all be completed through one or more comprehensive test instructions. Together, they constitute a test scenario that is saved and can be executed with one click.
[0034] Among them, the scenario test instruction includes the identification of the controlled machine and the chaos experiment scenario information to be tested. After receiving the scenario test instruction, the control machine extracts the identification of the controlled machine and the specific information of the chaos experiment scenario by parsing the instruction content. Further, the pre-configured database is connected to find the identification of the test plug-in and / or test script that matches the scenario. Subsequently, these data are serialized according to the pre-defined data and assembled into a structured comprehensive test instruction set. The comprehensive test instruction set is passed to the specified controlled machine through the message processor, thereby triggering the automated test process. In the specific implementation, the controlled machine obtains the identification of the test plug-in or test script in the above-mentioned comprehensive test instruction set, and automatically obtains the plug-in or script from the public site according to the identification, thereby performing scenario testing.
[0035] The machines to be tested in the embodiments of the present invention include machines running the program or system to be tested, or machines running middleware that supports the functions of the system to be tested. In the embodiments of the present invention, the business system that supports the entire charging process runs on the machine to be tested. Correspondingly, the embodiments of the present invention are to send a comprehensive test instruction set to the charging behavior of these machines through a chaos test system, and perform automated testing in a manner that simulates test scenarios, thereby solving the problem of low efficiency of scenario testing in the prior art.
[0036] In summary, the embodiments of the present invention strengthen the collaboration between development and operation and maintenance. When testing is required, it can be assembled based on the configured scripts and plug-ins to meet the testing requirements of different scenarios, forming an automated execution test, which greatly reduces the time and workload of manual intervention and accelerates the testing cycle. The automated process and message processing mechanism can efficiently schedule the controlled machine to execute test instructions, allocate resources on demand, and avoid idleness and waste of resources. The existing chaos engineering platform does not support the active initiation of business tests, and does not support the pre-initialization of the business operating environment (simulated test environment). Business tests can only be triggered by manual clicks. The embodiments of the present invention pre-configure relevant test scripts and test plug-ins, and the chaos engine can actively complete the corresponding tests.
[0037] Correspondingly, the database of the embodiment of the present invention includes multiple test scripts and test plug-ins related to the chaos experiment scenario information to be tested; the test scripts include environment management scripts, fault injection scripts, and business test scripts; each test script contains a script definition. The automated testing method provided by the embodiment of the present invention is mainly divided into two parts: the management period and the operation period, and supports actively initiating business tests to meet business needs. For the management period, the embodiment of the present invention configures the database through the following steps to assemble operations into corresponding commands based on the database.
[0038] 1) Configure multiple test scripts and test plug-ins related to the chaos experiment scenario information to be tested for the chaos test system. The test scripts include environment management scripts, fault injection scripts, and business test scripts.
[0039] 2) Configure the script definitions corresponding to multiple test scripts.
[0040] 3) Build a database based on multiple test scripts, test plug-ins and script definitions.
[0041] Among them, the environment management script: ensure that the test environment is as consistent as possible with the production environment, such as simulating the actual layout of charging stations and equipment status. Fault injection script: write scripts according to the designed test scenarios to simulate specific fault conditions, such as simulating network delays, simulating charging pile fault conditions, etc. Business test script: write scripts to verify whether the business process can respond correctly under abnormal circumstances, such as verifying the refund mechanism after payment failure, exception handling process, etc. For the plug-in library: you can develop or select existing plug-ins to enhance testing capabilities, such as network simulation plug-ins, stress testing plug-ins, security scanning plug-ins, etc., to ensure that these plug-ins can be effectively combined with the test scenarios and quickly deployed and executed.
[0042] The management period of the embodiment of the present invention defines several key parts of the test process, including environment initialization, fault definition, and business definition. The operation period connects the defined processes in series, that is, assembles them according to the scenario logic, so that they can be executed automatically. Among them, the main function of the management period is to enter data related to the chaos experiment. It mainly includes entering environment management scripts and plug-ins, fault injection scripts and plug-ins, and business test scripts and plug-ins. The interfaces of several types of script entry plug-ins can be set the same, but the data types are inconsistent. On the basis of these data, continue to complete the environment initialization definition configuration, fault injection definition configuration, business test configuration, and finally complete the scenario definition configuration. Fault injection and business testing are connected in series in the scenario configuration to achieve a unified closed loop of the entire process. After configuring the relevant scripts or plug-ins in the business definition, the chaos engine can actively complete this part of the test.
[0043] In one embodiment, for the above test script, the following contents may be configured: 1) Environment management scripts: 1. Environment configuration: Define the infrastructure environment required for the experiment, including but not limited to cloud platform resources, container orchestration, network topology, etc. 2. Dependency management: Configure service dependencies in the experimental environment to ensure that all dependencies are started and configured in the correct order. 3. Resource provisioning: Automate the deployment of software stacks, library files, and service version control required for the experiment to ensure the consistency of the experimental environment. 4. Security and access control: Set security policies for the experimental environment, such as access rights, firewall rules, and encryption configuration. 5. Health check: Implement scripts to monitor the health of the environment, ensure that all services are online and functioning properly, and perform automatic repair operations when necessary.
[0044] 2) Fault injection script: 1. Fault type definition: Configure different types of faults to be injected, such as delays, interruptions, abnormal return values, resource exhaustion, etc. 2. Fault target location: Specify the target service or component for fault injection, as well as the level of fault action (such as network layer, application layer, etc.). 3. Fault trigger timing: Set the time point when the fault starts and ends, which can be absolute time, relative time, or based on specific event triggers. 4. Impact scope control: Limit the impact scope of the fault to avoid unnecessary interference with the production environment or non-target systems. 5. Fault recovery strategy: Configure the recovery mechanism after the fault is executed to ensure that the system can be restored to its initial state after the experiment.
[0045] 3) Business test scripts: 1. Test scenario design: Define the business processes or use cases that need to be executed under specific fault conditions, covering key business paths. 2. Performance indicator setting: Configure the performance indicators that need to be monitored and recorded during the test, such as response time, throughput, success rate, etc. 3. Data generation and preparation: Automatically generate or prepare the data sets required for the experiment to ensure the authenticity and representativeness of the test data. 4. Verification logic: Write logic to verify whether the system's behavior in the face of failures meets expectations, including fault detection and the effectiveness of countermeasures. 5. Result analysis and reporting: Design scripts to collect test results, analyze system performance, and generate detailed experimental reports for subsequent analysis and improvement.
[0046] Correspondingly, the test plug-in usually contains code logic for performing specific tasks, necessary configuration parameters, and interfaces for interacting with test scripts. Its role is to improve the automation level of the test, reduce manual intervention, and make the construction and execution of test scenarios more flexible and efficient, providing the test script with the ability to perform complex operations and simulate real-world failures. In one embodiment, the test plug-in includes the following: 1. Environment management plug-in: responsible for building, configuring or cleaning the test environment. For example, it can automatically deploy test applications, set network conditions (such as delay, packet loss), or adjust hardware resource limits (CPU, memory usage). 2. Fault injection plug-in: used to simulate various fault conditions to test the performance of the controlled machine under abnormal conditions. This may include simulating server crashes, network interruptions, disk full loads, process hangs, etc. to verify the fault tolerance and stability of the system. 3. Business test plug-in: Focus on verifying the business logic of the system to ensure that the core business processes can still be executed normally during the chaos experiment. This type of plug-in may include functions such as automated test case execution, transaction monitoring, and data verification.
[0047] Among them, when the embodiment of the present invention tests the controlled machine, it runs through the chaos experiment engine and encapsulates the test commands to be executed (including environment initialization, fault injection, and business testing) into a message, which contains parameters, command identifiers, command types (scripts or plug-ins), and execution target addresses (such as host names). After receiving the message, the controlled end determines whether it is a command that the current host needs to process. If not, it ignores it. If so, it analyzes the message, obtains the corresponding plug-in or script according to the command identifier, and then executes the plug-in or script and passes the corresponding parameters. The embodiment of the present invention uses plug-ins or scripts to complete the main functions of the chaos experiment, and the scripts are mainly used in systems such as Linux. Plug-ins mainly complete some complex functions, such as stopping a program from responding (for example, it is used to test whether the charging service will be affected after a program stops responding in a charging scenario).
[0048] In summary, an embodiment of the present invention provides an automated testing method for charging scenarios. By designing a chaotic testing system, it automatically responds to scenario testing instructions when scenario testing is required, replacing the process of manually triggering the test, and significantly speeding up the test startup speed. The automated process reduces human operation delays, enables tests to be executed quickly, and improves overall test efficiency. In addition, the embodiment of the present invention can accurately extract test plug-ins and corresponding test scripts according to scenario test instructions, ensuring a high degree of match between the test content and the scenario to be tested of the controlled machine. This reduces test errors caused by human mismatching and improves the accuracy and consistency of the test.
[0049] In addition, the embodiment of the present invention can quickly adapt to different test requirements and dynamically assemble a comprehensive test instruction set by centrally managing and configuring the database. Under the premise that the functions executed by the controlled machine are different and the test scenarios are diverse, the corresponding test scripts and test plug-ins can be extracted according to the chaos experiment scenario information to be tested, which simplifies the configuration work of complex test scenarios and makes test management more efficient and flexible. Moreover, the database of the embodiment of the present invention covers a variety of scripts such as environment management, fault injection, and business testing, ensuring all-round and multi-dimensional test coverage. Such a comprehensive test instruction set can more thoroughly test the stability and reliability of the controlled machine and strengthen the collaboration between development and operation and maintenance.
[0050] Furthermore, based on the above embodiment, the embodiment of the present invention also provides another automatic testing method for charging scenarios. Figure 2 A schematic diagram of information push is shown, referring to Figure 2 The control machine is the control machine of the chaos test system and is the main controller of the entire system. The command is further forwarded or processed by the message middleware. Among them, the embodiment of the present invention can test different controlled machines. Correspondingly, the message middleware can transmit information to multiple controlled machines, and each controlled machine will execute the test after receiving the corresponding instruction.
[0051] Among them, the message processor is equipped with an automatic operation and maintenance communication interface; by pushing the comprehensive test instruction set to the automatic operation and maintenance communication interface of the message processor, the comprehensive test instruction set is pushed to each controlled machine through the automatic operation and maintenance communication interface. The interaction between the chaos experiment engine of the embodiment of the present invention and the controlled machine depends on the self-developed automatic operation and maintenance system. The automatic operation and maintenance system is responsible for bridging between various isolated hosts and processing calls from other systems through agreed interfaces. Based on this, the automated testing method of the embodiment of the present invention is compatible with the system environments of different controlled machines.
[0052] Among them, the message middleware will also pass the test results back to the control machine. Correspondingly, the controller also receives the test results of the controlled machine transmitted by the message processor to record the test results. Among them, the test results include whether the test passes or fails. If it fails, the reason for failure is recorded. In this regard, the control machine coordinates tasks and monitors the status of other components. The message middleware serves as a communication channel for efficiently transmitting data and instructions between various parts, which helps to enhance the reliability and scalability of the system. In one embodiment, the message middleware can be RabbitMQ. It should be noted that the message middleware can be selected according to the specific needs of the system, such as factors such as message throughput, latency, persistence, availability, and community support.
[0053] In addition, in combination with the above embodiments, the embodiments of the present invention also define the program targeted by the test script and the controlled machine to be tested targeted by the test script during the management period. By specifying the program to be injected and the host to be tested in the fault injection configuration and scenario configuration, the flexibility of experiment execution is achieved.
[0054] Furthermore, the embodiment of the present invention also defines the scenario logic of the test plug-in and the test script during the management period. The scenario logic is determined according to the predefined test objectives and actual conditions and is used to organize and execute the test steps. It includes but is not limited to the following aspects: 1. Sequential logic: Determine the execution order of the test script and the plug-in, such as executing the environment preparation script (such as initialization, configuration environment) first, then performing fault injection, then performing business process testing, and finally performing recovery and verification. 2. Conditional branching: Determine the subsequent operation path based on the data collected during the test or specific conditions. For example, if the system performs normally after injecting network delay, the load test continues; if the system response times out, it directly jumps to the fault recovery process. 3. Concurrency and time control: In the scenario of multiple controlled machines or concurrent faults that need to be simulated, coordinate the start time and execution time of the test scripts on different controlled machines to ensure that complex concurrent faults can be accurately simulated. 4. Fault level and combination: According to the severity of the business potential risk point to be tested, adjust the fault intensity or combine multiple faults to trigger simultaneously to evaluate the performance of the system under extreme conditions. 5. Rollback and recovery strategy: Define the steps for safely and quickly restoring the controlled machine to the initial state or stable state after the test is completed, ensuring that the normal operation of the production environment is not affected. 6. Data dependency: Some test scenarios may depend on specific system states or data conditions. The scenario logic must ensure that these preconditions are met before the corresponding test steps can be started. By carefully designing the scenario logic, it can be ensured that chaos testing can effectively expose system weaknesses while controlling the risks of the test and avoiding unnecessary interference with the production environment. In summary, it is possible to manage and execute fault injection scenarios, business test scenarios, test environment management scenarios, etc. from the management period and the operation period.
[0055] In summary, each scenario in the embodiment of the present invention is configured before running, and the chaos experiment engine can actively initiate business testing when testing is needed, and realize rapid automated testing of different scenarios.
[0056] In one implementation, the embodiment of the present invention can select to create a new task to execute in the runtime interface of the chaos test system, first configure the environment to be initialized, and initialize the experimental environment to the same operating state as the production environment, such as simulating a certain test scenario, such as testing the working condition of the charging system under certain fault scenarios. After the experimental environment is initialized, an implementation scenario can be selected to execute, and correspondingly, the test environment is changed from the initialization state to the state of simulating multiple terminals being charged through the plug-in for further testing.
[0057] Among them, the system configuration may be modified, the fault state may be simulated, etc. during the experiment. The embodiment of the present invention also conducts a brief verification test on the test environment after the experiment is completed to confirm that all system components have resumed normal operation and restored to the initial state or a known good state to meet the requirements of the next experiment. Including resetting hardware configuration, clearing fault simulation, restoring network connection, etc., to ensure that the results of the new experiment will not be interfered with by the residual influence of the previous experiment, and to ensure the accuracy of the next experiment. The above-mentioned scenarios to be tested can be selected according to the test requirements, such as scanning code charging, swiping card charging, order settlement, interconnection services, etc.
[0058] In one implementation, the embodiment of the present invention also provides a runtime engine for the corresponding chaos experiment platform, sets a timed test, and uses the built-in function of the chaos engine runtime to automatically execute the selected scenario at the configured time when the timed time is met, so as to automatically execute the test. Among them, the scenario is executed according to the process of injecting faults and business tests, and the business indicators are monitored. In addition, the progress can also be automatically fed back and the results recorded.
[0059] Furthermore, the database of the embodiment of the present invention is provided with a plug-in interface, which supports plug-in configuration during the management period, so that the chaos test system and the plug-in are loosely coupled. Based on this, the chaos test system and the database can be released and updated independently. After the chaos experiment platform is deployed, without updating the platform, new test scripts can be configured through the above-mentioned plug-in interface according to the functions of the chaos experiment to expand the functions of the platform and realize various new testing requirements, including environment initialization, fault injection, etc. The pre-configured database design of the embodiment of the present invention allows new test scenarios and scripts to be added on demand, which can easily cope with changes in future test requirements and maintain the long-term applicability and advancement of the test system.
[0060] In summary, the embodiments of the present invention can implement automated testing for the charging industry to discover business potential risks in advance. Through high automation, precise scenario matching, flexible script management and enhanced test coverage, it significantly improves test efficiency, accuracy and management convenience, and promotes the modernization of the software quality assurance system.
[0061] Further, in combination with the above content, taking the verification of whether the failure of the log cluster program has an impact on the current charging service and the start-up charging service (scheduling charging) as an example, the workflow of the system of the embodiment of the present invention is introduced as follows: In terms of business processes, to verify whether the fault has an impact on the ongoing charging business, we first need to simulate the start of a certain number of charging businesses, and keep the state of charging. Then, we inject a fault to make the program of the log cluster hang and unable to provide external services. Then, we check whether the ongoing charging business is affected. Finally, we automatically log in to the system and simulate clicking the charging button to verify whether the charging is started successfully.
[0062] The above process requires configuring a plug-in in the environment management to simulate the startup of a certain amount of charging services. In the fault management, configure a plug-in to inject a hang fault into the log cluster program. In the business test management section, configure a plug-in to call the charging automation test. Then define a scenario in the scenario management interface to verify the scenario of this example, and associate the above-mentioned fault injection with the business test definition in the scenario.
[0063] Furthermore, in order to close the loop of the entire test, the environment can be automatically restored. When configuring the execution plug-in, a recovery plug-in is also configured, that is, the environment recovery plug-in is used to stop the charging business, the fault recovery plug-in is used to resolve the pseudo-death fault of the log cluster, and the business recovery plug-in is used to clean up the orders and other data generated by the test. Finally, the chaos test engine can automatically perform environment initialization, fault injection, and business testing according to the above-arranged process. It will automatically register problems and then restore the test environment. Among them, the recovery plug-in and the execution / injection plug-in have the same principle. Both use the automatic operation and maintenance system to distribute commands. The difference is that the distributed commands are related to the recovery work.
[0064] Furthermore, for the account service test scenario, the log cluster fault definition can also be reused. At the same time, the business test of scheduling charging can also be used in scenarios such as starting charging tests under Redis downtime. All are implemented by combining the corresponding scripts in the experimental scenario. In one embodiment, if the controlled machine 1 runs the Redis service, the chaos experiment engine needs to simulate the injection of a Redis downtime fault. Correspondingly, the engine will splice the following messages: HostName: Controller 1; Script: RedisOpt.sh; Param: Stop. Among them, HostName is used to locate the target host to which the message is to be pushed, and Script is associated with the script for performing Redis operations. Param is Stop, which indicates that Redis is to be stopped. After assembling the above message, push the message to the message middleware (RabbitMQ service), and the message middleware service will push the message to all controlled hosts. After the controlled machine receives the message, it identifies the HostName field in the message. If HostName does not match the current host, the message is discarded. If it matches, it means that it needs to be executed on the current machine. Then execute the corresponding plug-in script. After the execution is completed, the execution result is pushed back to the message middleware, and the message middleware pushes the message to the chaos experiment engine, which further records the experimental results.
[0065] In summary, a scenario of an embodiment of the present invention is equivalent to a combination of a series of operation and maintenance actions (such as plug-ins). During execution, each operation and maintenance action has a unique execution identifier to distinguish this operation and maintenance action. Each operation and maintenance action is associated with the number and parameters of a specific plug-in. The automatic operation and maintenance system only needs to call the plug-in to execute according to the number and parameters of the plug-in. After the automatic operation and maintenance is executed, the result will be associated with the unique execution number of the operation and maintenance action. Based on this, the chaos test system can understand whether the above execution action is successful and the corresponding result.
[0066] Correspondingly, Figure 3 The corresponding runtime architecture of the chaos test system corresponding to the embodiment of the present invention is shown. First, the script, definition and corresponding plug-in can be configured through the front-end page. The configuration content can be updated according to the actual situation and stored in the database to obtain the required script. In addition, environment management, task loading and execution and other operations can also be performed to realize the above-mentioned automated testing, and can meet the automated testing requirements of the charging industry or other industries for the operation behavior of the equipment (such as charging behavior). Among them, Figure 3The front end in the system includes PC and mobile terminals, which communicate with the SG service through the HTTP protocol. As a bridge between the front end and the chaos experiment engine, the SG service processes the requests of the front end and forwards them to the chaos experiment engine. The chaos experiment engine contains multiple modules, such as main process, state management, plug-in management, task loading, task execution, external communication, etc. The main process module is responsible for environment management, task status, use case status, command status, etc. The state management module is responsible for task status, plug-in download, plug-in update, plug-in execution, etc. The plug-in management module is responsible for plug-in download, plug-in update, plug-in execution, etc. The task loading module is responsible for task loading, task execution, result collection, etc. The external communication module is responsible for environment status, result collection, etc. Automatic operation and maintenance includes components such as OMP WebAPI, Sep Engine, and Smart Agent, which are responsible for the automatic operation and maintenance of the system. Figure 3 It also includes Redis cluster, memory, MySQL database, etc. to store system data. Figure 3 The entire architecture diagram shown shows the relationship and data flow between the various parts of the system, and the system functions are realized through the collaborative work of different modules and components.
[0067] Furthermore, the embodiment of the present invention provides another automatic testing method for charging scenarios, which is applied to a controlled machine of a chaos testing system. Figure 4 A flowchart of another automated testing method for charging scenarios is shown, referring to Figure 4 , the method comprises the following steps: Step S202, receiving a comprehensive test instruction set sent by the controlled machine via the message processor.
[0068] Step S204, extracting the identification of the controlled machine carried in the comprehensive test instruction set; Step S206, determining whether the ID of the controlled machine is consistent with the host ID configured by itself; Step S208: if yes, extract the identification of the test plug-in and / or the test script to perform automated testing based on the identification of the test plug-in and / or the test script.
[0069] In combination with the above embodiment, the controlled machine obtains the identification of the test plug-in or test script in the above comprehensive test instruction set, and automatically obtains the plug-in or script from the public site according to the identification, so as to perform the test of the corresponding test scenario based on the corresponding identification.
[0070] Furthermore, an embodiment of the present invention provides another automated testing method for charging scenarios, and its implementation principle and technical effects are the same as those of the aforementioned method embodiment. For the sake of brief description, for parts not mentioned in the method embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0071] Furthermore, in response to completion of the automated test, the embodiment of the present invention obtains the result of the automated test; and sends the result of the automated test to the message processor, so as to transmit the result of the automated test to the control machine via the message processor. Further, in Figure 1 Based on the method embodiment shown, the embodiment of the present invention also provides an automated testing device for charging scenarios. Figure 5 A schematic diagram of the structure of an automated testing device for charging scenarios provided by an embodiment of the present invention is shown. Figure 5 The device includes a response module 100 for responding to a scenario test instruction; wherein the scenario test instruction includes an identifier of a controlled machine and information for characterizing a chaos experiment scenario to be tested; an extraction module 200 for extracting an identifier of a test plug-in and / or a test script that matches the chaos experiment scenario information to be tested from a pre-configured database according to the scenario test instruction; wherein the test script includes an environment management script, a fault injection script, and a business test script; each test script includes a script definition; a data processing module 300 for assembling the identifier of the controlled machine, the identifier of the test plug-in and / or the test script, and generating a comprehensive test instruction set that matches the chaos experiment scenario information to be tested; and a communication module 400 for pushing the comprehensive test instruction set to a message processor, so as to push the comprehensive test instruction set to the controlled machine through the message processor.
[0072] An automatic testing device for charging scenarios provided by an embodiment of the present invention has its implementation principle and technical effects and Figure 1 The method embodiment shown is the same. For the sake of simplicity, the parts not mentioned in the device embodiment can be referred to the aforementioned Figure 1 The corresponding content in the method embodiment shown.
[0073] Furthermore, the message processor is equipped with an automatic operation and maintenance communication interface; the communication module 400 is also used to push the comprehensive test instruction set to the automatic operation and maintenance communication interface of the message processor, so as to push the comprehensive test instruction set to each controlled machine through the automatic operation and maintenance communication interface. The above-mentioned response module 100 is also used to receive the test results of the controlled machine transmitted by the message processor to record the test results.
[0074] Furthermore, the device also includes a configuration module for defining the program targeted by the test script and the controlled machine to be tested targeted by the test script.
[0075] Further, in Figure 4 Based on the method embodiment shown, the embodiment of the present invention also provides another automatic testing device for charging scenarios. Figure 6 A schematic diagram of the structure of an automated testing device for charging scenarios provided by an embodiment of the present invention is shown. Figure 6 The device includes: a receiving module 10, used to receive a comprehensive test instruction set sent by a controlled machine via a message processor; wherein the comprehensive test instruction set carries an identifier of the controlled machine, and an identifier of a test plug-in and / or a test script; a data acquisition module 20, used to extract the identifier of the controlled machine carried in the comprehensive test instruction set; an execution module 30, used to determine whether the identifier of the controlled machine is consistent with the host identifier configured by itself; if so, extract the identifier of the test plug-in and / or the test script to perform automated testing based on the identifier of the test plug-in and / or the test script.
[0076] Another automatic testing device for charging scenarios provided by the embodiment of the present invention has its implementation principle and technical effects and Figure 4 The method embodiment shown is the same. For the sake of simplicity, the parts not mentioned in the device embodiment can be referred to the aforementioned Figure 4 The corresponding content in the method embodiment shown.
[0077] Furthermore, the execution module 30 is also used to respond to the completion of the automated test, obtain the result of the automated test, and send the result of the automated test to the message processor, so as to transmit the result of the automated test to the control machine via the message processor. The execution module 30 is also used to discard the current comprehensive test instruction if it is determined that the identification of the controlled machine is inconsistent with the host identification configured by itself.
[0078] An embodiment of the present invention further provides an electronic device, comprising 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 above Figures 1 to 4 The embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon, and the computer program is executed by a processor to perform the above Figures 1 to 4 The embodiment of the present invention also provides a structural diagram of an electronic device, such as Figure 7 FIG. 1 is a schematic diagram of the structure of the electronic device, wherein the electronic device includes a processor 71 and a memory 70, the memory 70 stores computer executable instructions that can be executed by the processor 71, and the processor 71 executes the computer executable instructions to implement the above Figures 1 to 4 Any of the methods shown.
[0079] exist Figure 7In the illustrated embodiment, the electronic device further includes a bus 72 and a communication interface 73, wherein the processor 71, the communication interface 73 and the memory 70 are connected via the bus 72. The memory 70 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 73 (which may be wired or wireless), and the Internet, a wide area network, a local area network, a metropolitan area network, etc. may be used. The bus 72 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. It may also be an AMBA (Advanced Microcontroller Bus Architecture) bus, where AMBA defines three types of buses, including an APB (Advanced Peripheral Bus) bus, an AHB (Advanced High-performance Bus) bus, and an AXI (Advanced Xtensible Interface) bus. The bus 72 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0080] The processor 71 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 71. The above processor 71 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor 71 reads the information in the memory and combines its hardware to complete the above Figures 1 to 4 Any of the methods shown.
[0081] A computer program product of an automated testing method and device for a charging scenario provided by an embodiment of the present invention includes a computer-readable storage medium storing a program code, and the instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can refer to the method embodiment, which will not be repeated here. A person skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system described above can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here. In addition, in the description of the embodiment of the present invention, unless otherwise clearly specified and limited, the terms "installation", "connection" and "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected, or it can be indirectly connected through an intermediate medium, or it can be the internal connection of two components. For those skilled in the art, the specific meaning of the above terms in the present invention can be understood in specific circumstances. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, and other media that can store program codes. In the description of the present invention, it should be noted that the terms: center, top, bottom, left, right, vertical, horizontal, inside, outside, etc. indicate the orientation or position relationship based on the orientation or position relationship shown in the accompanying drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0082] Finally, it should be noted that the above embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art who is familiar with the technical field can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. An automated testing method for charging scenarios, It is characterized in that The method is applied to a control machine of a chaos test system, wherein the chaos test system further comprises a controlled machine and a message processor; wherein the control machine and the controlled machine transmit information through the message processor; the control machine is a machine running a chaos experiment engine, and the controlled machine is a machine to be tested; The method comprises: Responding to a scenario test instruction; wherein the scenario test instruction includes an identifier of the controlled machine and chaos experiment scenario information for characterizing the to-be-tested chaos experiment; According to the scenario test instruction, the identification of the test plug-in and / or test script matching the chaos experiment scenario information to be tested is extracted from a pre-configured database; the test script includes an environment management script, a fault injection script, and a business test script; each of the test scripts includes a script definition; Assembling the identification of the controlled machine, the test plug-in and / or the identification of the test script to generate a comprehensive test instruction set matching the chaos experiment scenario information to be tested; The comprehensive test instruction set is pushed to the message processor, so that the comprehensive test instruction set is pushed to the controlled machine through the message processor.
2. The method according to claim 1, It is characterized in that The message processor is configured with an automatic operation and maintenance communication interface; The step of pushing the comprehensive test instruction set to the message processor, so as to push the comprehensive test instruction set to the controlled machine through the message processor, comprises: The comprehensive test instruction set is pushed to the automatic operation and maintenance communication interface of the message processor, so as to push the comprehensive test instruction set to each of the controlled machines through the automatic operation and maintenance communication interface.
3. The method according to claim 1, It is characterized in that The method further comprises: The test result of the controlled machine transmitted by the message processor is received to record the test result.
4. The method according to claim 1, It is characterized in that The method further comprises: Define the program targeted by the test script and the controlled machine to be tested targeted by the test script.
5. An automated testing method for charging scenarios, It is characterized in that The method is applied to a controlled machine of a chaos test system, wherein the chaos test system further comprises a control machine and a message processor; wherein the control machine and the controlled machine transmit information through the message processor; the control machine is a machine running a chaos experiment engine, and the controlled machine is a machine to be tested; The method comprises: Receiving a comprehensive test instruction set sent by the controlled machine via the message processor; wherein the comprehensive test instruction set carries an identification of the controlled machine, and an identification of a test plug-in and / or a test script; Extracting the identification of the controlled machine carried in the comprehensive test instruction set; Determine whether the identification of the controlled machine is consistent with the host identification configured by itself; If yes, extract the identification of the test plug-in and / or the test script to perform automated testing based on the identification of the test plug-in and / or the test script.
6. The method according to claim 5, It is characterized in that The method further comprises: In response to the completion of the automated test, obtaining a result of the automated test; The result of the automated test is sent to the message processor, so that the result of the automated test is transferred to the control machine via the message processor.
7. The method according to claim 5, It is characterized in that The method further comprises: If it is determined that the identification of the controlled machine is inconsistent with the host identification configured by itself, the current comprehensive test instruction set is discarded.
8. An automated testing device for charging scenarios, It is characterized in that The device is applied to a control machine of a chaos test system, and the chaos test system also includes a controlled machine and a message processor; wherein the control machine and the controlled machine transmit information through the message processor; the control machine is a machine running a chaos experiment engine, and the controlled machine is a machine to be tested; The device comprises: A response module, used for responding to a scenario test instruction; wherein the scenario test instruction includes an identifier of a controlled machine and chaos experiment scenario information for characterizing the chaos experiment scenario to be tested; An extraction module is used to extract the identification of the test plug-in and / or test script matching the chaos experiment scenario information to be tested from a pre-configured database according to the scenario test instruction; the test script includes an environment management script, a fault injection script, and a business test script; each of the test scripts includes a script definition; A data processing module, used for assembling the identification of the controlled machine, the test plug-in and / or the identification of the test script, and generating a comprehensive test instruction set matching the chaos experiment scene information to be tested; The communication module is used to push the comprehensive test instruction set to the message processor, so as to push the comprehensive test instruction set to the controlled machine through the message processor.
9. An automated testing device for charging scenarios, It is characterized in that The device is applied to a controlled machine of a chaos test system, and the chaos test system further comprises a control machine and a message processor; wherein the control machine and the controlled machine transmit information through the message processor; the control machine is a machine running a chaos experiment engine, and the controlled machine is a machine to be tested; The device comprises: A receiving module, used for receiving a comprehensive test instruction set sent by the controlled machine via the message processor; wherein the comprehensive test instruction carries an identification of the controlled machine, and an identification of a test plug-in and / or a test script; A data acquisition module, used to extract the identification of the controlled machine carried in the comprehensive test instruction set; An execution module, used for determining whether the identification of the controlled machine is consistent with the host identification configured by itself; If yes, extract the identification of the test plug-in and / or the test script to perform automated testing based on the identification of the test plug-in and / or the test script.
10. An electronic device, It is characterized in that The electronic device includes a processor and a memory, the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the automated testing method for charging scenarios as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for testing application programs
CN105743725A
Application program testing method and device, readable storage medium and terminal equipment
CN109840205A
Test method and device based on fault injection, computer equipment and storage medium
CN111831569A
Test method and device for control panel, control panel and storage medium
CN115525539A
Interface chain test method and device
CN117555784A
