CN115904941A - Chaos testing method and device, electronic equipment and storage medium - Google Patents

Chaos testing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115904941A
CN115904941A CN202211338365.6A CN202211338365A CN115904941A CN 115904941 A CN115904941 A CN 115904941A CN 202211338365 A CN202211338365 A CN 202211338365A CN 115904941 A CN115904941 A CN 115904941A
Authority
CN
China
Prior art keywords
test
chaotic
resource
user
testing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211338365.6A
Other languages
Chinese (zh)
Inventor
王业鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202211338365.6A priority Critical patent/CN115904941A/en
Publication of CN115904941A publication Critical patent/CN115904941A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Medical Treatment And Welfare Office Work (AREA)

Abstract

The invention discloses a chaotic testing method, a chaotic testing device, electronic equipment and a storage medium. The method comprises the following steps: under the condition that the testing user passes the testing permission verification, platform service resources are obtained based on the testing information of the testing user; when the resource state change of the platform service resource is detected, determining a chaotic test resource based on the platform service resource; generating a test case of the cluster service platform based on the chaotic test resources and the test information, and testing the cluster service platform based on the test case. The technical scheme disclosed by the invention solves the problem that the fault injection of one project influences the conditions of other projects deployed on the same node in the test process of the prior art, achieves the aim of protecting the system from being influenced during chaotic test, and improves the safety of the system operation.

Description

Chaos testing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a chaotic test method and apparatus, an electronic device, and a storage medium.
Background
When a distributed system is gradually complicated, and the system is gradually clouded, the stability of the system is greatly challenged. The chaotic test can actively find out weak links in the system and check the coping method of the system under the sudden condition, thereby enabling the system to be more robust.
At present, the chaos test is widely applied, and a good chaos test tool becomes the key of the test. In the existing chaos testing tool, fault injection can be performed for a node (node), a pod (pod) and a container (container), and as a fault at the node (node) level affects not only a target system to be tested, all systems deployed on the whole node (node) can be affected. Therefore, an authority verification module is needed to ensure that the test is normally carried out and other systems are not influenced.
Current rights management schemes are non-zero, i.e., one, in that a user can only use and cannot use two rights. Any node, pod and container based fault injection can be created as long as the user has access rights, and no right control is subdivided down. This open management approach may cause unnecessary impact on other systems deployed on the same node, thereby affecting the security of the system during the testing process.
Disclosure of Invention
The invention provides a chaotic test method, a chaotic test device, electronic equipment and a storage medium, which are used for solving the problem that the fault injection of one project influences the conditions of other projects deployed on the same node in the test process of the prior art, achieving the aim of protecting the operation of a system from being influenced during chaotic test and improving the safety of the operation of the system.
In a first aspect, an embodiment of the present invention provides a chaotic testing method, including:
under the condition that the test user passes the test permission verification, platform service resources are obtained based on the test information of the test user;
determining chaotic test resources based on the platform service resources when detecting the resource state change of the platform service resources;
generating a test case of the cluster service platform based on the chaotic test resources and the test information, and testing the cluster service platform based on the test case.
Optionally, the method further includes:
when a test instruction of a test user is received, obtaining test information of the test user;
and acquiring a preset authority verification mechanism, and performing test authority verification on the test information based on the authority verification mechanism to determine whether the test user passes the test authority verification.
Optionally, the test information includes a test location and a test namespace scope;
the step of verifying the test permission of the test information based on the permission verification mechanism to determine whether the test user has the test permission comprises the following steps:
sequentially carrying out authority verification on the testing position and the testing namespace scope based on the authority verification mechanism;
and if the testing position and the testing name space scope pass the verification, indicating that the testing user passes the testing authority verification.
Optionally, the method further includes:
if the test position is not verified, generating first test prompt information based on a preset test position threshold value so that the test user generates a test position meeting the test position threshold value;
and if the test namespace scope is not verified, generating second test prompt information based on a preset test namespace scope threshold value so that the test user generates the test namespace scope which meets the test namespace scope threshold value.
Optionally, the method further includes:
acquiring a preset monitoring mechanism, and monitoring platform service resources in the cluster service platform based on the monitoring mechanism;
and determining whether the resource state of the platform service resource changes or not based on the monitoring result.
Optionally, the creating of the chaotic test resource based on the platform service resource includes:
and acquiring event operation corresponding to the resource state change, and performing corresponding operation on the platform service resource based on the event operation to obtain the chaotic test resource.
Optionally, the generating a test case of the cluster service platform based on the chaotic test resource and the test information, and testing the cluster service platform based on the test case include:
determining a plurality of test positions of the cluster service platform based on the test information, and injecting test faults into each test position respectively based on the chaotic test resources;
and generating a test case of the cluster service platform based on each test fault, and testing the cluster service platform based on the test case.
In a second aspect, an embodiment of the present invention further provides a chaos testing apparatus, where the apparatus includes:
the platform service resource obtaining module is used for establishing platform service resources based on the test information of the test user under the condition that the test user is determined to have the test authority;
the chaotic test resource acquisition module is used for creating chaotic test resources based on the platform service resources when detecting the resource state change of the platform service resources;
and the chaotic test module is used for generating a test case of the cluster service platform based on the chaotic test resources and the test information and testing the cluster service platform based on the test case.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the chaotic test method according to any of the embodiments of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where computer instructions are stored, and the computer instructions are configured to, when executed by a processor, implement the chaos testing method according to any one of the embodiments of the present invention.
According to the technical scheme provided by the embodiment of the invention, under the condition that the test user is confirmed to pass the test permission verification, platform service resources are obtained based on the test information of the test user; determining chaotic test resources based on the platform service resources when detecting the resource state change of the platform service resources; and generating a test case of the cluster service platform based on the chaotic test resources and the test information, and testing the cluster service platform based on the test case. According to the technical scheme, before the chaotic test is carried out based on the test user, the test authority is verified based on the test position to be carried out of the test user, namely whether the test position of the test user for the chaotic test exceeds a preset range is determined. When the test user passes the test verification, the test user is allowed to carry out the chaos test, the problem that the fault injection of one project influences the conditions of other projects deployed on the same node in the test process of the prior art is solved, the purpose of protecting the system from being influenced in the chaos test is achieved, and the safety of the system operation is improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a chaos testing method according to an embodiment of the invention;
FIG. 2 is a flow chart of a rights verification provided according to an embodiment of the invention;
FIG. 3 is a flow chart of determining resources according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a chaos testing apparatus according to a second embodiment of the invention;
fig. 5 is a schematic structural diagram of an electronic device implementing the chaotic test method according to the embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
It is understood that before the technical solutions disclosed in the embodiments of the present disclosure are used, the type, the use range, the use scene, etc. of the personal information related to the present disclosure should be informed to the user and obtain the authorization of the user through a proper manner according to the relevant laws and regulations.
For example, in response to receiving an active request from a user, a prompt message is sent to the user to explicitly prompt the user that the requested operation to be performed would require the acquisition and use of personal information to the user. Thus, the user can autonomously select whether to provide personal information to software or hardware such as an electronic device, an application program, a server, or a storage medium that performs the operations of the disclosed technical solution, according to the prompt information.
As an optional but non-limiting implementation manner, in response to receiving an active request from the user, the manner of sending the prompt information to the user may be, for example, a pop-up window, and the prompt information may be presented in a text manner in the pop-up window. In addition, a selection control for providing personal information to the electronic device by the user's selection of "agreeing" or "disagreeing" can be carried in the popup.
It is understood that the above notification and user authorization process is only illustrative and is not intended to limit the implementation of the present disclosure, and other ways of satisfying the relevant laws and regulations may be applied to the implementation of the present disclosure.
It will be appreciated that the data referred to in this disclosure, including but not limited to the data itself, the acquisition or use of the data, should comply with the requirements of the applicable laws and regulations and related regulations.
Example one
Fig. 1 is a flowchart of a chaos testing method according to an embodiment of the present invention, where the embodiment is applicable to a chaos testing situation for a cluster service platform, and the method can be executed by a chaos testing apparatus, where the chaos testing apparatus can be implemented in hardware and/or software, and the chaos testing apparatus can be configured in a cloud server. As shown in fig. 1, the method includes:
s110, under the condition that the testing user passes the testing authority verification, platform service resources are obtained based on testing information of the testing user.
In the current chaos test, the user authority set by the test user is limited to a non-one, namely zero authority management mode, that is, if the user can access the current system, the user can perform the chaos test at any test position of the current system, but in the test mode, if the user performs the chaos test at a node position in the current system, other applications running at the test node are caused to run to generate faults, so that the continuity and the safety of the system running are influenced. In order to solve the above problem, in the technical scheme of the embodiment of the present invention, before the test user performs the chaos test, the test authority is verified based on the test position of the test user to be performed, that is, it is determined whether the test position of the test user performing the chaos test exceeds a preset range. When the test user passes the test verification, the test position of the test user to be tested does not exceed the preset range, and the test user is allowed to carry out the chaotic test at the test position of the test user to be tested.
Specifically, the authority verification may be performed on the test user based on a preset test management service of the cluster service platform, and after the test user passes the verification, the chaotic test may be performed on the cluster service platform based on the preset test management service. Optionally, the cluster service platform may be kubernets, and correspondingly, the preset test management service may be an operator component in kubernets. Specifically, the operator component is obtained by writing in Go language.
Optionally, the method for performing permission verification on a test user based on a preset test management service in the embodiment of the present invention may include: when a test instruction of a test user is received, obtaining test information of the test user; and acquiring a preset authority verification mechanism, and performing test authority verification on the test information based on the authority verification mechanism to determine whether the test user passes the test authority verification.
In this embodiment, the test user may be a user performing a chaotic test on the system, and the test information may also be understood as test information for performing the chaotic test on the system, and optionally, the test information may be obtained based on test document generated in advance. Specifically, the test information may include information such as a test position where the test user performs the test.
Specifically, the test user processes the obtained test information through yaml to create a user resource for generating the custom resource. It should be noted that the user resource may be an initial platform service resource that needs to be adjusted. Namely, after resource adjustment is carried out on user resources, platform service resources for carrying out the chaos test can be obtained. Furthermore, an authority verification mechanism in the preset test management service is obtained based on the user resources, and test authority verification is carried out on the test information based on the authority verification mechanism.
In an embodiment, the test information includes a test location and a test namespace scope. Correspondingly, the method for verifying the test authority of the test information comprises the following steps: sequentially carrying out authority verification on the testing position and the testing name space scope based on an authority verification mechanism; and if the testing position and the testing name space scope pass the verification, the testing user passes the testing authority verification.
It should be noted that the test locations include a level of the test locations injected with the test faults in the cluster service platform. The cluster service platform of this embodiment includes nodes (nodes), pods (pod), and containers (container) that are ordered in order from high to low.
Specifically, a test position where a fault needs to be injected in test information is obtained, and the authority verification mechanism performs first-level test authority verification on the test position based on a test position threshold preset in the authority verification mechanism. Optionally, if the test location is within the test location threshold range, it indicates that the current test user passes the authorization verification for the test location. For example, whether the test position is within the test position threshold may be understood as: when the test position threshold is a pod (pod), when the test position of the test user is a container (container) or a pod (pod), the test user passes the authority verification of the test position; otherwise, when the test position of the test user is a node (node), the test user fails the authority verification for the test position.
It should be noted that, if the test location fails to be verified, the first test prompt information is generated based on a preset test location threshold, so that the test user generates a test location meeting the test location threshold.
Specifically, when the test user receives the first test prompt message, the test user may modify the test position of the test user based on the test position threshold in the first test prompt message to generate a test position within the test position threshold range, so that the test position can be verified; of course, the test user may also regenerate the test position within the test position threshold range, and perform subsequent chaotic tests based on the test position.
Optionally, when the test user passes the permission verification for the test location, the test namespace scope is tested for the test user to perform the second-level test permission verification.
Specifically, whether a test namespace scope corresponding to the test position exists or not is searched in the cluster service platform. Optionally, if the test namespace exists, the test user passes the authority verification of the test namespace scope; otherwise, if the test namespace scope does not exist, the test namespace scope is judged to be verified.
It should be noted that, if the test namespace scope is not verified, the second test prompt message is generated based on the preset test namespace scope threshold, so that the test user generates the test namespace scope meeting the test namespace scope threshold.
The preset test namespace scope threshold value can be understood as the namespace scope existing in the cluster service platform. Specifically, when the test user receives the second test prompt message, the test namespace scope of the test user can be modified based on the test namespace scope threshold in the second test prompt message to generate the test namespace scope within the test namespace scope threshold range, so that the test namespace scope can be verified through the test namespace scope. Of course, the test user can also regenerate the test namespace scope within the threshold range of the test namespace scope and perform subsequent chaotic tests based on the test namespace scope.
Optionally, when both the test location and the test namespace scope pass the verification, it is indicated that the test user passes the test permission verification; otherwise, if any one of the test position or the test namespace scope fails to pass the verification, it indicates that the test user passes the test permission verification, that is, the test user does not have the permission to perform the chaotic test.
Optionally, when the test user passes the test permission verification, that is, when the test user has the test permission, finiizers is set for the previously created user resource to obtain the created platform service resource, that is, the paas blade is obtained.
S120, when the resource state change of the platform service resources is detected, determining chaotic test resources based on the platform service resources.
In the embodiment of the present invention, the chaotic test resource may be a resource for injecting a test fault when performing a chaotic test. Specifically, chaos testing resources in kubernets can be understood as chaos blade.
In practical application, after the platform service resource is created, the preset test management service of the cluster service platform monitors the platform service resource to acquire the change condition of the resource state of the platform service resource. In this embodiment, the resource creation of the platform service resource also belongs to one of the resource state changes, and specifically, the other state change types further include resource modification of the platform service resource and resource deletion of the platform resource service resource.
Optionally, the method for monitoring platform service resources in this embodiment may include: acquiring a preset monitoring mechanism, and monitoring platform service resources in the cluster service platform based on the monitoring mechanism; and determining whether the resource state of the platform service resource changes or not based on the monitoring result.
The preset monitoring mechanism may be understood as a loop processing (receiving) mechanism of the operator. In practical applications, when the PaaSBlade is created, the controller in the operator monitors the creation operation and then enters a loop processing (receiver) mechanism. When the cyclic processing monitors that the platform service resource is subjected to the operation of adding and deleting, the resource state of the platform service resource is changed.
On the basis of the above embodiment, when the resource state changes, the chaotic test resource is determined based on the changed platform service resource. Optionally, the method for creating the chaotic test resource based on the platform service resource in this embodiment may include: and acquiring event operation corresponding to the resource state change, and performing corresponding operation on the platform service resource based on the event operation to obtain the chaotic test resource.
The event operation may include a delete operation, an acquire operation, and the like. Specifically, after the event operation corresponding to the state change is determined, the event result corresponding to the operation result after the event operation is judged, the obtaining mode of obtaining the chaotic test resource is determined based on the event result, and the chaotic test resource is obtained based on the obtaining mode.
For example, the event operation corresponding to the change of the resource state is determined as the acquisition operation. Further, whether the obtaining operation is successfully obtained or not is determined, and if the obtaining operation is successfully obtained, chaotic test resources are directly obtained based on the obtaining result; otherwise, if the acquisition is unsuccessful, the chaotic test resource is established based on the platform service resource.
S130, generating a test case of the cluster service platform based on the chaotic test resource and the test information, and testing the cluster service platform based on the test case.
In this embodiment of the present invention, a method for testing a cluster service platform may include: determining a plurality of test positions of the cluster service platform based on the test information, and respectively injecting test faults into the test positions based on the chaotic test resources; and generating a test case of the cluster service platform based on each test fault, and testing the cluster service platform based on the test case.
Specifically, the test position included in the test information is acquired, and the corresponding test position is determined based on the test position. Illustratively, if the test level comprises pods (pod) and containers (container), determining test pods (pod) needing to be tested based on the test information, determining the test containers (container) needing to be tested in the test pods (pod), using the determined test pods (pod) and test containers (container) as test positions for injecting test faults, injecting the test faults in each position, generating test cases of the cluster service platform based on the injected test faults and other test information, and testing the test cases to complete the chaotic test of the cluster service platform.
According to the technical scheme provided by the embodiment of the invention, under the condition that the test user passes the test permission verification, platform service resources are obtained based on the test information of the test user; determining chaotic test resources based on the platform service resources when the resource state change of the platform service resources is detected; and generating a test case of the cluster service platform based on the chaotic test resource and the test information, and testing the cluster service platform based on the test case. According to the technical scheme, before the chaotic test is carried out based on the test user, the test authority is verified based on the test position to be carried out of the test user, namely, whether the test position of the test user for the chaotic test exceeds a preset range or not is determined. When the test user passes the test verification, the test user is allowed to carry out the chaos test, the problem that the fault injection of one project influences the conditions of other projects deployed on the same node in the test process of the prior art is solved, the purpose of protecting the system from being influenced in the chaos test is achieved, and the safety of the system operation is improved.
On the basis of the above embodiment, the embodiment of the present invention also provides a preferred embodiment. The preferred embodiment describes the chaos testing method in detail by taking kubernets as an example of the cluster service platform in the embodiment of the present invention. Optionally, the chaos testing method in the preferred embodiment of the present invention includes the following steps: the method comprises the steps of firstly not granting the user the authority of using the ChaosBlade tool, and then opening the authority of authorizing the user to use the PaaS blade tool. When a user creates and uses a PaaS blade tool object through a yacl file, authority check is carried out on a fault injection test to be created by the user, and after the authority check is passed, a PaaS blade tool creates and uses a ChaoS blade tool object to carry out fault injection; and when the check fails, directly refuting the user request back, informing the reason of the failure, and asking the user to retry after modifying the yaml file.
Optionally, a method for checking the authority of the user may be as shown in fig. 2. Specifically, the user needs to create CRD of the custom resource by yaml. After the resources are created, the PaaS blade utilizes a webhook mechanism of an operator to carry out validity verification on the resources, and finally finalizers are set. Specifically, the valid verification step includes: determining a fault injection position based on resources created by a user, and verifying whether the fault injection position meets a verification condition; if not, feeding back error information to the user; and if so, carrying out name space scope verification. Verifying whether the namespace scope verification meets the verification condition; if the user identification information is in accordance with the user identification information, the user identification information passes verification, and if the user identification information is not in accordance with the user identification information, error information is fed back to the user.
Optionally, a method for obtaining chaos blade based on paas blade may be shown in fig. 3. Specifically, the processing flow of paas blade is a loop operation (reconcile), and when the monitored resource is subjected to an add/delete operation, the controller obtains information of the monitored resource, so as to perform further processing. The method comprises the following specific steps: 1. when a trigger condition occurs, acquiring a user-defined resource object of the PaaS blade operator according to a name (namespace) and a resource name (name); 2. checking whether the acquisition is successful; 3. if the unsuccessful certification is the deletion operation, jumping to the step 1; 4. if the acquisition is successful, checking whether the operation is a deleting operation; 5. if the operation is deletion, firstly deleting other resources created by the resources, such as the customized resources of a ChaosBlade tool, then updating the state of the PaaSBlade customized resource object, and jumping to the step 1; 6. if the operation is not the deleting operation, acquiring a customized resource object of the ChaosBlade according to the name (namespace) and the name (name) of the resource; 7. if the acquisition is successful, jumping to the step 9; 8. if the acquisition is unsuccessful, a custom resource of a ChaosBlade tool is created; 9. updating the state of the PaaS blade custom resource object; and 10, returning to the starting point of the loop (reconcile) and waiting for the next trigger.
Example two
Fig. 4 is a schematic structural diagram of a chaos testing apparatus according to a third embodiment of the present invention. As shown in fig. 4, the apparatus includes: a platform service resource obtaining module 210, a chaotic test resource obtaining module 220 and a chaotic test module 230; wherein the content of the first and second substances,
a platform service resource obtaining module 210, configured to obtain a platform service resource based on test information of a test user when the test user is determined to have a test permission;
a chaotic test resource obtaining module 220, configured to determine a chaotic test resource based on the platform service resource when a resource state change of the platform service resource is detected;
the chaotic test module 230 is configured to generate a test case for the cluster service platform based on the chaotic test resource and the test information, and test the cluster service platform based on the test case.
On the basis of the foregoing embodiments, optionally, the apparatus further includes:
the test information acquisition module is used for acquiring the test information of the test user when receiving the test instruction of the test user;
and the test permission verification module is used for acquiring a preset permission verification mechanism and carrying out test permission verification on the test information based on the permission verification mechanism so as to determine whether the test user passes the test permission verification.
On the basis of the foregoing embodiments, optionally, the test information includes a test location and a test namespace scope;
a test authority verification module comprising:
the authority verification unit is used for sequentially verifying the authorities of the test position and the test namespace scope based on the authority verification mechanism;
and the permission verification result acquisition unit is used for indicating that the test user passes the test permission verification if the test position and the test namespace scope pass the verification.
On the basis of the foregoing embodiments, optionally, the apparatus further includes:
the first test prompt information generation module is used for generating first test prompt information based on a preset test position threshold value if the test position fails to be verified, so that the test user generates a test position meeting the test position threshold value;
and the second test prompt information generation module is used for generating second test prompt information based on a preset test namespace scope threshold value if the test namespace scope fails to be verified, so that the test user generates a test namespace scope which meets the test namespace scope threshold value.
On the basis of the foregoing embodiments, optionally, the apparatus includes:
the resource monitoring module is used for acquiring a preset monitoring mechanism and monitoring platform service resources in the cluster service platform based on the monitoring mechanism;
and the resource state determining module is used for determining whether the resource state of the platform service resource changes or not based on the monitoring result.
On the basis of the foregoing embodiments, optionally, the chaotic test resource obtaining module 220 includes:
and the chaotic test resource obtaining unit is used for obtaining event operation corresponding to the change of the resource state and carrying out corresponding operation on the platform service resource based on the event operation to obtain the chaotic test resource.
On the basis of the foregoing embodiments, optionally, the chaotic test module 230 includes:
the test fault injection unit is used for determining a plurality of test positions of the cluster service platform based on test information and respectively injecting test faults into each test position based on the chaotic test resources;
and the test unit is used for generating a test case of the cluster service platform based on each test fault and testing the cluster service platform based on the test case.
The chaos testing device provided by the embodiment of the invention can execute the chaos testing method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
EXAMPLE III
FIG. 5 illustrates a schematic diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to the bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as the chaotic test method.
In some embodiments, the chaotic test method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as the memory unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the chaotic test method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the chaotic test method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the Internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A chaos test method is applied to a cluster service platform, and comprises the following steps:
under the condition that the test user passes the test permission verification, platform service resources are obtained based on the test information of the test user;
when the resource state change of the platform service resource is detected, determining a chaotic test resource based on the platform service resource;
generating a test case of the cluster service platform based on the chaotic test resources and the test information, and testing the cluster service platform based on the test case.
2. The method of claim 1, further comprising:
when a test instruction of a test user is received, obtaining test information of the test user;
and acquiring a preset authority verification mechanism, and performing test authority verification on the test information based on the authority verification mechanism to determine whether the test user passes the test authority verification.
3. The method of claim 2, wherein the test information comprises a test location and a test namespace scope;
the verifying the test authority of the test information based on the authority verification mechanism to determine whether the test user has the test authority includes:
sequentially carrying out authority verification on the test position and the test namespace scope based on the authority verification mechanism;
and if the testing position and the testing name space scope pass the verification, the testing user passes the testing authority verification.
4. The method of claim 3, further comprising:
if the test position is not verified, generating first test prompt information based on a preset test position threshold value so that the test user generates a test position meeting the test position threshold value;
and if the test namespace scope fails to pass the verification, generating second test prompt information based on a preset test namespace scope threshold value so that the test user generates the test namespace scope which meets the test namespace scope threshold value.
5. The method of claim 1, further comprising:
acquiring a preset monitoring mechanism, and monitoring platform service resources in the cluster service platform based on the monitoring mechanism;
determining whether a resource status of the platform service resource changes based on the monitoring result.
6. The method of claim 1, wherein creating chaotic test resources based on the platform service resources comprises:
and acquiring event operation corresponding to the resource state change, and performing corresponding operation on the platform service resource based on the event operation to obtain the chaotic test resource.
7. The method of claim 1, wherein generating a test case of the cluster service platform based on the chaotic test resource and the test information, and testing the cluster service platform based on the test case comprises:
determining a plurality of test positions of the cluster service platform based on the test positions, and respectively injecting test faults into each test position based on the chaotic test resources;
and generating a test case of the cluster service platform based on each test fault, and testing the cluster service platform based on the test case.
8. A chaotic test device, comprising:
the platform service resource obtaining module is used for obtaining platform service resources based on the test information of the test user under the condition that the test user is determined to have the test authority;
the chaotic test resource acquisition module is used for determining chaotic test resources based on the platform service resources when detecting the resource state change of the platform service resources;
and the chaotic test module is used for generating a test case of the cluster service platform based on the chaotic test resources and the test information and testing the cluster service platform based on the test case.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the chaotic test method of any one of claims 1-7.
10. A computer readable storage medium having stored thereon computer instructions for causing a processor, when executed, to implement the chaos testing method of any one of claims 1-7.
CN202211338365.6A 2022-10-28 2022-10-28 Chaos testing method and device, electronic equipment and storage medium Pending CN115904941A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211338365.6A CN115904941A (en) 2022-10-28 2022-10-28 Chaos testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211338365.6A CN115904941A (en) 2022-10-28 2022-10-28 Chaos testing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115904941A true CN115904941A (en) 2023-04-04

Family

ID=86475330

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211338365.6A Pending CN115904941A (en) 2022-10-28 2022-10-28 Chaos testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115904941A (en)

Similar Documents

Publication Publication Date Title
CN110058920B (en) Virtual machine performance detection method and device, electronic equipment and storage medium
CN111708650A (en) High-availability analysis method and system for business application system
CN114328132A (en) Method, device, equipment and medium for monitoring state of external data source
CN115904941A (en) Chaos testing method and device, electronic equipment and storage medium
CN116303069A (en) Test method, device, upper computer, system and medium of vehicle-mounted terminal
CN115296979B (en) Fault processing method, device, equipment and storage medium
CN111367934A (en) Data consistency checking method, device, server and medium
CN116089197A (en) Fault equipment switching exercise method, device, equipment and storage medium
CN115203158A (en) Data comparison method, device, equipment and storage medium
CN114401121A (en) Application program login method and device, electronic equipment and readable storage medium
CN114091909A (en) Collaborative development method, system, device and electronic equipment
CN116032970B (en) Gateway security starting method and device, electronic equipment and storage medium
CN112733123B (en) Authorization management method and distributed management system
CN116001705B (en) Vehicle data monitoring method, device, equipment and storage medium
CN102457379A (en) User authentication system
CN117492822B (en) Change contrast method, device, electronic equipment and storage medium
CN114928540B (en) Preemption method and device, electronic equipment and storage medium
CN116431499A (en) Automatic test method and device, electronic equipment and storage medium
CN118111720A (en) National standard test system, method, device, equipment and medium for new energy vehicle
CN115309717A (en) Database loading method, device, equipment, medium and computer program product
CN116238569A (en) Main and standby platform switching method, device, equipment, system and medium
CN112800573A (en) Reliability analysis method and device
CN113114693A (en) Account state display method and device
CN115270672A (en) Verification method, device, equipment and storage medium of TCAM (ternary content addressable memory) encapsulation module
CN115878086A (en) Application program operation processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination