Method and device for testing distributed storage system

By generating automated chaos test cases and simulating extreme conditions to test distributed storage systems, it solves the problem of difficulty in discovering potential problems and loopholes in existing technologies, and improves test coverage and efficiency.

CN118733437APending Publication Date: 2024-10-01JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410706456.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing technology makes it difficult to effectively test distributed storage systems under extreme and uncertain conditions, making potential problems and vulnerabilities difficult to discover.

Method used

By generating automated chaos test cases, using the correlation in the standard parts library, randomly injecting faults and abnormal operations, simulating extreme conditions, and testing the fault tolerance and recovery mechanism of the distributed storage system.

Benefits of technology

Significantly improves test coverage, can discover edge cases and abnormal states that are ignored in traditional methods, improves test efficiency and quality, and reduces the risk of system failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733437A_ABST
    Figure CN118733437A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a method and device for testing a distributed storage system, and the method comprises the steps: obtaining a target standard component library of a target storage scene under the condition that the distributed storage scene is the target storage scene, and recording M standard components and the incidence relation among the M standard components in the target standard component library, m is an integer greater than or equal to 1, and the M standard components are obtained by layering a target storage scene according to functional characteristics; according to the incidence relation among the M standard components in the target standard component library, an automatic chaos test case is generated, and the automatic chaos test case comprises the selected standard component in the M standard components; and testing the distributed storage system through the automatic chaos test case. Through the method and the device, the problem that potential problems and vulnerabilities in a system are difficult to discover in related technologies is solved, and the effect of improving the test efficiency is further achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computers, and in particular, to a method and device for testing a distributed storage system. Background Art

[0002] Distributed storage is a storage system that stores data on multiple nodes in different geographical locations. This storage system is usually highly available, scalable, and fault-tolerant, ensuring that data can still be reliably accessed when a node fails or the network is interrupted. With the rapid development of information technology, distributed storage systems are playing an increasingly important role in processing massive amounts of data. Currently, the automated operation of distributed storage has been widely used in IT companies, cloud computing, big data, virtualization, and other fields.

[0003] Traditional methods for testing distributed storage are mainly manual testing or using automated testing tools. However, these methods mainly focus on verifying the system's deterministic functions and lack testing of the system under extreme and uncertain conditions, which makes it difficult to discover and solve potential problems that may arise in the complex and changing actual operating environment.

[0004] There is currently no effective solution to the above problems. Summary of the invention

[0005] The embodiments of the present application provide a method and apparatus for testing a distributed storage system, so as to at least solve the problem that potential problems and vulnerabilities in the system in the related art are difficult to be discovered.

[0006] According to one embodiment of the present application, a method for testing a distributed storage system is provided, comprising: when a distributed storage scenario is a target storage scenario, obtaining a target standard parts library of the target storage scenario, wherein the target standard parts library records M standard parts and association relationships between the M standard parts, wherein M is an integer greater than or equal to 1, and the M standard parts are obtained by layering the target storage scenario according to functional characteristics; according to the association relationship between the M standard parts in the target standard parts library, generating an automated chaos test case, wherein the automated chaos test case includes a standard part selected from the M standard parts; and testing the distributed storage system through the automated chaos test case.

[0007] In an exemplary embodiment, according to the association relationship between the M standard parts in the target standard parts library, an automated chaotic test case is generated, including at least one of the following: when a first standard part among the M standard parts is selected, a standard part having a dependency relationship with the first standard part is determined among the M standard parts, and the standard part having the dependency relationship is selected, wherein the association relationship includes the dependency relationship; when a second standard part among the M standard parts is selected, a standard part having a mutually exclusive relationship with the second standard part is determined among the M standard parts, and the standard part having the mutually exclusive relationship is excluded, wherein the association relationship includes the mutually exclusive relationship.

[0008] In an exemplary embodiment, the distributed storage system is tested through the automated chaos test case, including: determining the unselected standard parts among the M standard parts, and restoring the unselected standard parts to the default stage; randomly injecting faults and simulating abnormal operations in the distributed storage system according to predefined fault models and / or abnormal conditions; executing the standard parts in the automated chaos test case in sequence according to the hierarchical relationship between the standard parts in the automated chaos test case and the serial numbers of the standard parts in the automated chaos test case; when the standard part currently being executed is the current standard part, executing the current standard part in the following manner: when it is determined that the preparation phase operation of the functional characteristic layer of the current standard part is completed, performing the test operation and verification operation of the current standard part; after sequentially executing the standard parts in the automated chaos test case, performing the verification operation on the standard parts in the automated chaos test case.

[0009] In an exemplary embodiment, before obtaining the target standard parts library of the target storage scenario, the method also includes: determining N storage scenarios in a distributed storage scenario, wherein N is an integer greater than or equal to 1, and the target storage scenario is any storage scenario among the N storage scenarios; constructing a standard parts library for each storage scenario in the N storage scenarios to obtain N standard parts libraries, wherein the N standard parts libraries include the target standard parts library; constructing a standard parts library for a current storage scenario in the N storage scenarios, including: classifying the current storage scenario according to functional characteristics, and dividing each storage scenario into levels in a dependency order; setting standard parts for each level according to the functional attributes of the current storage scenario, wherein the standard parts are used to represent the functional characteristics of the current storage scenario, and each level includes one or more standard parts; constructing a standard parts library for the current storage scenario according to the association relationship between the levels of the storage scenario and the standard parts of each level; wherein the N storage scenarios include: file storage, object storage, block storage, and distributed file system.

[0010] In an exemplary embodiment, when the current storage scenario is object storage, the current storage scenario is classified according to functional characteristics, and each storage scenario is divided into levels in a dependency order, including: dividing the object storage into a cluster-level characteristic layer, a user-level characteristic layer, a bucket-level characteristic layer, and an object-level characteristic layer according to the functional attributes of the object storage; when the current storage scenario is file storage, the current storage scenario is classified according to functional characteristics, and each storage scenario is divided into levels in a dependency order, including: a cluster-level characteristic layer, a directory-level characteristic layer, and a file-level characteristic layer; when the current storage scenario is block storage, the current storage scenario is classified according to functional characteristics, and each storage scenario is divided into levels in a dependency order, including: a cluster-level characteristic layer, a volume-level characteristic layer, and a data-level characteristic layer; when the current storage scenario is a big data file system, the current storage scenario is classified according to functional characteristics, and each storage scenario is divided into levels in a dependency order, including: a cluster-level characteristic layer, a big data-level characteristic layer, and a component-level characteristic layer.

[0011] In an exemplary embodiment, standard parts are set for each layer according to the functional attributes of the current storage scenario, including: when the current storage scenario is object storage, at least one of the following standard parts is set for the cluster-level feature layer: load balancing, data redundancy; at least one of the following standard parts is set for the user-level feature layer: user quota, access control list; at least one of the following standard parts is set for the bucket-level feature layer: bucket multi-version, bucket life cycle; at least one of the following standard parts is set for the object-level feature layer: object basic business, append write; when the current storage scenario is file storage, the cluster-level feature layer includes at least one of the following standard parts: shared service settings, access design services; the directory-level feature layer includes at least one of the following standard parts: directory snapshot, directory management The file-level feature layer includes at least one of the following standard parts: network file system sharing, general Internet file system sharing; when the current storage scenario is block storage, the annotation parts of the cluster-level feature layer include: cloud platform docking service settings; the volume-level feature layer includes at least one of the following standard parts: snapshot standard parts, recycle bin standard parts; the data-level feature layer includes at least one of the following standard parts: cloud computing platform standard parts, containerized application platform standard parts; when the current storage scenario is a distributed file system, the cluster-level feature layer includes at least one of the following standard parts: distributed file system service settings, permission service settings; the distributed file system level feature layer includes at least one of the following standard parts: system management; the standard parts of the component-level feature layer are: component support.

[0012] In an exemplary embodiment, after the distributed storage system is tested by the automated chaos test case, the method further includes: persistently storing the test results and operation logs in a database; and displaying the test results on an automated chaos test result page.

[0013] According to another embodiment of the present application, a device is provided, including: an acquisition module, for acquiring a target standard parts library of the target storage scenario when the distributed storage scenario is the target storage scenario, wherein the target standard parts library records M standard parts and the association relationship between the M standard parts, wherein M is an integer greater than or equal to 1, and the M standard parts are obtained by layering the target storage scenario according to functional characteristics; a generation module, for generating an automated chaos test case according to the association relationship between the M standard parts in the target standard parts library, wherein the automated chaos test case includes the selected standard parts from the M standard parts; and a testing module, for testing the distributed storage system through the automated chaos test case.

[0014] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0015] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0016] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0017] Through the present application, when the distributed storage scenario is the target storage scenario, a target standard parts library of the target storage scenario is obtained, wherein the target standard parts library records M standard parts and the association relationship between the M standard parts, M is an integer greater than or equal to 1, and the M standard parts are obtained by layering the target storage scenario according to functional characteristics; according to the association relationship between the M standard parts in the target standard parts library, an automated chaos test case is generated, wherein the automated chaos test case includes the standard parts selected from the M standard parts; and the distributed storage system is tested through the automated chaos test case.

[0018] Since the random selection and permutation of standard parts automatically generates standardized test case generation and execution processes, it helps to establish unified test specifications, improve the repeatability and maintainability of test activities, and cover more potential test scenarios, including those edge cases and abnormal states that are easily overlooked in traditional test methods, thereby significantly improving test coverage. Therefore, it can solve the problem that potential problems and vulnerabilities in the system in related technologies are difficult to be discovered, achieving the effect of improving test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a hardware structure block diagram of a server device of a method for testing a distributed storage system according to an embodiment of the present application;

[0020] Figure 2 is a flowchart of a method for testing a distributed storage system according to an embodiment of the present application;

[0021] Figure 3 This is an automatic chaotic test case generation process according to an embodiment of the present application;

[0022] Figure 4 This is a multi-round automated chaos test case execution process according to an embodiment of the present application;

[0023] Figure 5 This is a single-round automated chaos test execution process according to an embodiment of the present application;

[0024] Figure 6 is a flowchart of result display and statistical analysis according to an embodiment of the present application;

[0025] Figure 7 is a flow chart of automated chaos testing according to an embodiment of the present application;

[0026] Figure 8 It is a structural block diagram of an apparatus for testing a distributed storage system according to an embodiment of the present application. DETAILED DESCRIPTION

[0027] For better understanding, some terms in this application are explained below:

[0028] Test scenarios: V3 projects: files, objects, blocks, HDFS; V7 projects: files; the hierarchical division, standard parts formulation, standard parts operations, and standard parts scripts of the V3 and V7 project file scenarios should be highly consistent.

[0029] Layer: In each test scenario, functional features are classified and can be divided into layers in the order of dependency. For example, in object storage, it can be divided into: cluster-level feature layer, user-level feature layer, bucket-level feature layer, and object-level feature layer; the relationship between the four layers is that the latter depends on the former.

[0030] Standard parts: The specific functional features in each layer are called standard parts. For example, in object storage, the cluster-level feature layer includes standard parts such as object storage port, single bucket 100 billion settings, CTDB, etc.; the user-level feature layer includes standard parts such as user quota, user ACL, user key pair, etc.; the bucket-level feature layer includes standard parts such as bucket multi-version, bucket recycle bin, bucket quota, etc.

[0031] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0033] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a method for testing a distributed storage system in an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 The server device includes a processor 102 (only one is shown) (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the server device may also include a transmission device 106 and an input / output device 108 for communication functions. A person skilled in the art can understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0034] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for testing a distributed storage system in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0035] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0036] In this embodiment, a method for testing a distributed storage system is provided. Figure 2 is a flow chart of a method for testing a distributed storage system according to an embodiment of the present application. Figure 2 As shown, the process includes the following steps:

[0037] Step S202, when the distributed storage scenario is a target storage scenario, a target standard parts library of the target storage scenario is obtained, wherein the target standard parts library records M standard parts and association relationships between the M standard parts, where M is an integer greater than or equal to 1, and the M standard parts are obtained by layering the target storage scenario according to functional characteristics;

[0038] The above-mentioned distributed storage scenario refers to a storage method in which data is stored on multiple storage nodes and works together and exchanges data through the network. In the distributed storage scenario, data is stored on multiple nodes in a dispersed manner, which can achieve functions such as data redundancy backup, load balancing, and high availability. Common distributed storage scenarios include distributed file systems, distributed databases, object storage, etc. Distributed storage scenarios can improve data security and reliability, as well as data access speed and throughput, and are suitable for scenarios of large-scale data storage and processing.

[0039] The above-mentioned target storage scenario can be a storage scenario of the system to be tested, such as file storage, object storage, block storage and HDFS (Hadoop Distributed File System), etc. The above-mentioned target standard parts library can be a standard parts library of the target storage scenario. The standard parts library can contain multiple standard parts, each standard part includes properties such as test operations, verification operations and restore default operations. At the same time, the above-mentioned standard parts library also includes the association relationship between multiple standard parts, and the association relationship can be the level of each standard part.

[0040] Step S204, generating an automated chaotic test case according to the association relationship between the M standard parts in the target standard parts library, wherein the automated chaotic test case includes the standard parts selected from the M standard parts;

[0041] The above-mentioned chaotic test cases can be test cases for testing the system to be tested. Through the chaos engine of the platform layer, the standard parts in each layer are randomly selected and arranged in sequence according to the hierarchical dependency order, and the test cases are automatically generated. For example, each distributed storage scenario contains X standard parts layers, and there is a relationship between the lower layer and the upper layer between the X standard parts layers; each standard part layer contains a different number of standard parts, and the standard parts in 1,..., X standard parts layers are randomly selected and arranged in sequence to generate automated chaotic test cases. It should be noted that in the process of generating test cases, it is necessary to ensure that the selected standard parts meet the dependency relationship and avoid selecting mutually exclusive standard parts. By randomly selecting and arranging and combining standard parts to automatically generate test cases, more potential test scenarios can be covered, including those edge cases and abnormal states that are easily overlooked in traditional testing methods, thereby significantly improving the test coverage.

[0042] Optionally, when a first standard component among the M standard components is selected, a standard component having a dependency relationship with the first standard component is determined among the M standard components, and the standard component having the dependency relationship is selected, wherein the association relationship includes the dependency relationship; and when a second standard component among the M standard components is selected, a standard component having a mutually exclusive relationship with the second standard component is determined among the M standard components, and the standard component having the mutually exclusive relationship is excluded, wherein the association relationship includes the mutually exclusive relationship.

[0043] For example, if a standard part needs to be tested under a certain user quota, a valid user quota standard part must be selected before selecting the standard part; if another standard part is mutually exclusive with the user access control list (ACL) function, the standard part cannot be selected at the same time as the user ACL function.

[0044] As an optional implementation, Figure 3 This is an automatic chaotic test case generation process according to an embodiment of the present application, such as Figure 3 As shown, firstly, the target standard parts library of the target storage scenario is determined, and the full set of standard parts for the target storage scenario is obtained according to the target standard parts library, including the X layers of the target storage scenario and all the standard parts in each layer; in the full set of standard parts, standard parts of each layer are randomly selected according to the dependency data and mutually exclusive data of the standard parts, and chaotic test cases are generated according to the selected standard parts that meet the requirements and the dependency relationship between each layer.

[0045] Step S206, testing the distributed storage system through the automated chaos test case.

[0046] Specifically, unselected standard parts among the M standard parts are determined, and the unselected standard parts are restored to the default stage; faults are randomly injected and abnormal operations are simulated in the distributed storage system according to predefined fault models and / or abnormal conditions; each standard part in the automated chaotic test case is executed in sequence according to the hierarchical relationship between the standard parts in the automated chaotic test case and the serial number of each standard part in the automated chaotic test case; when the currently executed standard part is the current standard part, the current standard part is executed in the following manner: when it is determined that the preparation phase operation of the functional characteristic layer of the current standard part is completed, the test operation and verification operation of the current standard part are executed; after sequentially executing each standard part in the automated chaotic test case, verification operations are performed on each standard part in the automated chaotic test case.

[0047] The above-mentioned fault models and abnormal conditions can be faults or abnormalities existing in the real environment, such as network delays, service interruptions, permission changes, etc. During the test execution process, according to the predefined fault models and abnormal conditions, random fault injection and simulation of abnormal operations can simulate the uncertainty and complexity in the real environment, so as to observe the system's response and recovery capabilities. By simulating various abnormal conditions and random faults, the fault tolerance and recovery mechanism of the distributed storage system can be effectively tested, the robustness of the system is enhanced, and the system can be ensured to operate stably in the face of uncertainty and complexity in the real world.

[0048] After generating chaos test cases and injecting fault models and / or abnormal conditions, the automation bottom layer performs specific test operations and verification operations based on the generated test cases and fault injection plan. Figure 4 This is a multi-round automated chaos test case execution process according to an embodiment of the present application, such as Figure 4 As shown, the specific process is as follows:

[0049] S401, custom setting of the execution round K for this time, which can perform automated chaos testing continuously for a long time in multiple rounds;

[0050] S402, according to the set execution round K, execute in sequence, wherein for each round of automated chaotic testing, first restore the default stage of all standard parts in the "unselected standard parts" set, and then execute each layer of standard parts in the dependency order (hierarchical relationship); before executing each layer of standard parts, first execute the preparation phase operation of the layer; after the preparation phase of the layer is completed, execute its test operation and verification operation; continue to perform a round of pure verification phase operation on all standard parts;

[0051] S403, after executing K rounds of testing, display the test results, and annotate and statistically analyze the test results.

[0052] It should be noted that during the test process, the system will automatically record the operation log and test results. For example, it can record the start time, end time, return status code and other information of each operation.

[0053] As an optional implementation, Figure 5 This is a single-round automated chaos test execution process according to an embodiment of the present application, such as Figure 5 As shown, the specific process is as follows:

[0054] S501, perform traversal operation on the standard parts of each layer:

[0055] According to the standard parts layer sequence number, the standard parts layer is traversed from 1 to X in sequence, and the standard parts in the layer are processed;

[0056] S502, performing an environment recovery operation on each standard component:

[0057] Retrieve the "unselected standard parts set" and execute the [Restore Default Operation] of the feature one by one for the standard parts whose restore default flag is True; if the execution of this stage fails, terminate this round of execution and proceed to the next round;

[0058] S503, performing preparation operations on the test data of each layer:

[0059] Each layer of standard parts has one such attribute and does not belong to any standard part. Before the first standard part of each layer is executed, the [preparation operation] of the layer is executed first; if the execution of this stage fails, the subsequent execution of this round is terminated and the next round is entered;

[0060] S504, perform testing and verification operations on the selected standard parts:

[0061] Each standard component has test attributes and verification attributes. When executing each selected standard component, first execute its [test operation], then execute its [verification operation], and write the test and verification data into the persistent test data; continue to execute S503 and S504 until each layer of selected standard components has been tested and verified;

[0062] S505, perform verification operation on the selected standard part again:

[0063] For the standard parts in the "selected standard parts set", perform the [verification operation] again. In this stage, only the [verification operation] is performed, and the [test operation] is not performed, and the verification data is written into the persistent test data.

[0064] Through the above steps, when the distributed storage scenario is the target storage scenario, the target standard parts library of the target storage scenario is obtained, wherein the target standard parts library records M standard parts and the association relationship between the M standard parts, M is an integer greater than or equal to 1, and the M standard parts are obtained by layering the target storage scenario according to functional characteristics; according to the association relationship between the M standard parts in the target standard parts library, an automated chaos test case is generated, wherein the automated chaos test case includes the selected standard parts from the M standard parts; the distributed storage system is tested through the automated chaos test case. The problem that potential problems and vulnerabilities in the system in the related technology are difficult to be discovered is solved, the test quality and efficiency of the distributed storage system are improved, and the risk of system failure in the production environment is reduced.

[0065] In addition, the need for manual testing is greatly reduced through automated test case generation, automated test case execution and analysis of test results, which greatly improves test efficiency and reduces test costs.

[0066] The execution subject of the above steps may be a server, a terminal, etc., but is not limited thereto.

[0067] As an optional implementation, before obtaining the target standard parts library of the target storage scenario, the method also includes: determining N storage scenarios in a distributed storage scenario, wherein N is an integer greater than or equal to 1, and the target storage scenario is any storage scenario among the N storage scenarios; constructing a standard parts library for each storage scenario in the N storage scenarios to obtain N standard parts libraries, wherein the N standard parts libraries include the target standard parts library; constructing a standard parts library for a current storage scenario in the N storage scenarios, including: classifying the current storage scenario according to functional characteristics, and dividing each storage scenario into levels in a dependency order; setting standard parts for each level according to the functional attributes of the current storage scenario, wherein the standard parts are used to represent the functional characteristics of the current storage scenario, and each level includes one or more standard parts; constructing a standard parts library for the current storage scenario according to the association relationship between the levels of the storage scenario and the standard parts of each level; wherein the N storage scenarios include: file storage, object storage, block storage, and distributed file system.

[0068] Before obtaining the target standard parts library, it is necessary to create a standard parts library for each storage scenario, which can be file storage, object storage, block storage, and distributed file system, etc. Classify each storage scenario according to functional characteristics, and divide each storage scenario into levels according to dependencies, and then set standard parts for each level according to the functional attributes of each storage scenario, so as to create a standard parts library. For example, the level of the object storage system may include cluster-level feature layer, user-level feature layer, bucket-level feature layer, and object-level feature layer. Standard parts are defined in each level, and each standard part represents a specific functional feature. For example, the cluster-level feature layer may include standard parts such as load balancing and data redundancy, and the user-level feature layer may include standard parts such as user quotas and access control lists (ACLs). Each level contains preparation operations for the level, and preparation operations are used to set up the test environment and prepare test data. By creating a standard parts library for all possible side storage scenarios, we can ensure that the storage scenarios cover all application scenarios of the system. At the same time, by establishing a standard parts library for all storage scenarios, we can further help generate automated test cases and execution processes, help establish unified test specifications, and improve the repeatability and maintainability of test activities.

[0069] As an optional implementation, when the current storage scenario is object storage, the current storage scenario is classified according to functional characteristics, and each storage scenario is divided into levels in a dependency order, including: dividing the object storage into a cluster-level feature layer, a user-level feature layer, a bucket-level feature layer, and an object-level feature layer according to the functional attributes of the object storage; when the current storage scenario is file storage, the current storage scenario is classified according to functional characteristics, and each storage scenario is divided into levels in a dependency order, including: a cluster-level feature layer, a directory-level feature layer, and a file-level feature layer; when the current storage scenario is block storage, the current storage scenario is classified according to functional characteristics, and each storage scenario is divided into levels in a dependency order, including: a cluster-level feature layer, a volume-level feature layer, and a data-level feature layer; when the current storage scenario is a big data file system, the current storage scenario is classified according to functional characteristics, and each storage scenario is divided into levels in a dependency order, including: a cluster-level feature layer, a big data-level feature layer, and a component-level feature layer.

[0070] The above-mentioned levels can be multiple levels divided in various storage scenarios. There is a dependency order between the levels. For example, in the object storage scenario, it can be divided into: cluster-level feature layer, user-level feature layer, bucket-level feature layer, and object-level feature layer. There is a relationship of the latter depending on the former among these four levels.

[0071] Optionally, the levels of the file storage system include a cluster-level feature layer, a directory-level feature layer, and a file-level feature layer, wherein; the levels of the block storage system include a cluster-level feature layer, a volume-level feature layer, and a data-level feature layer; the levels of the HDFS (big data file system) storage system include a cluster-level feature layer, a Hadoop-level feature layer (big data-level feature layer), and a component-level feature layer.

[0072] As an optional implementation, standard parts are set for each layer according to the functional attributes of the current storage scenario, including: when the current storage scenario is object storage, at least one of the following standard parts is set for the cluster-level feature layer: load balancing, data redundancy; at least one of the following standard parts is set for the user-level feature layer: user quota, access control list; at least one of the following standard parts is set for the bucket-level feature layer: bucket multiple versions, bucket life cycle; at least one of the following standard parts is set for the object-level feature layer: object basic business, append write; when the current storage scenario is file storage, the cluster-level feature layer includes at least one of the following standard parts: shared service settings, access design services; the directory-level feature layer includes at least one of the following standard parts: directory snapshot, directory management The file-level feature layer includes at least one of the following standard parts: network file system sharing, general Internet file system sharing; when the current storage scenario is block storage, the annotation parts of the cluster-level feature layer include: cloud platform docking service settings; the volume-level feature layer includes at least one of the following standard parts: snapshot standard parts, recycle bin standard parts; the data-level feature layer includes at least one of the following standard parts: cloud computing platform standard parts, containerized application platform standard parts; when the current storage scenario is a distributed file system, the cluster-level feature layer includes at least one of the following standard parts: distributed file system service settings, permission service settings; the distributed file system level feature layer includes at least one of the following standard parts: system management; the standard parts of the component-level feature layer are: component support.

[0073] Optionally, in the object storage scenario, the standard parts of the cluster-level feature layer may be load balancing, data redundancy, etc.; the standard parts of the user-level feature layer may be user quotas, access control lists, etc.; the standard parts of the bucket-level feature layer may be bucket multi-versions, bucket lifecycles, etc.; the standard parts of the object-level feature layer may be object basic services, append writes, etc. In the file storage scenario, the standard parts of the cluster-level feature layer may be shared service settings, access design services, etc.; the standard parts of the directory-level feature layer may be directory snapshots, directory management, etc.; the standard parts of the file-level feature layer may be NFS sharing (network file system sharing), CIFS sharing (common Internet file system sharing), etc. In the block storage scenario, the standard parts of the cluster-level feature layer may be cloud platform docking service settings, etc.; the standard parts of the volume-level feature layer may be snapshot standards, recycle bins, etc.; the standard parts of the data-level feature layer may be Openstack (cloud computing platform) standards, K8S (containerized application platform) standards, etc. In the HDFS (distributed file) storage scenario, the standard parts of the cluster-level feature layer can be the service settings of the distributed file system (Ranger service settings), permission service settings (Kerbors service settings), etc.; the standard parts of the Hadoop-level feature layer can be SSM system management, etc.; the standard parts of the component-level feature layer can be component support (Hive component support, Spark component support), etc.

[0074] As an optional implementation, after the distributed storage system is tested through the automated chaos test case, the method further includes: persistently storing the test results and operation logs in a database; and displaying the test results on an automated chaos test result page.

[0075] After the test is completed, the test results and operation logs are persistently stored in the database and displayed on the automated chaos test result page to analyze and locate potential problems and vulnerabilities in the system. Automated chaos testing can detect potential defects and vulnerabilities in the system at an early stage, allowing the R&D team to repair them in time and reduce the impact of defects in the production environment.

[0076] As an optional implementation, Figure 6 is a flowchart of the result display and statistical analysis according to the embodiment of the present application, such as Figure 6As shown, the results displayed on the above page include the results of restoring the defaults, the results of preparing the operation, the results of the test verification, etc. After the system is subjected to chaos testing, the test results can be automatically counted by the automated chaos testing system, and the standard parts selection supplement layer can be introduced to continuously optimize the standard parts selection frequency; or by introducing manual annotation feedback, the random combination correction layer can be added to continuously confirm and clean the rationality of the random combination. By continuously optimizing the standard parts selection frequency and the random combination correction layer, the selection of test cases can be optimized, and the test efficiency can be further improved. At the same time, repeated test cases and invalid test scenarios can be effectively reduced, thereby improving the test quality and reducing the possibility of vulnerabilities.

[0077] As an optional implementation, Figure 7 is a flowchart of an automated chaos test according to an embodiment of the present application, such as Figure 7 As shown, the specific process is as follows:

[0078] S701, select the target standard parts library of the target storage scenario, and select the standard parts operation;

[0079] S702, setting the number of execution cycles;

[0080] S703, determining whether the operation of selecting standard parts in each layer is random, and whether to arrange and combine the selected standard parts;

[0081] S704, generating an execution order of the standard parts according to the selection method and the sorting method of the standard parts;

[0082] S705, the automation bottom layer performs test and verification operations on the selected standard parts according to the execution order, and writes the test and verification data into the persistence layer;

[0083] S706, obtaining and displaying test results.

[0084] Through the above steps, the need for manual testing is greatly reduced, the testing efficiency is greatly improved, the testing cost is reduced, and the repeatability and maintainability of testing activities are improved; at the same time, more potential testing scenarios are covered, and potential defects and vulnerabilities in the system can be discovered at an early stage, allowing the R&D team to repair them in time and reduce the impact of defects in the production environment.

[0085] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0086] In the present embodiment, a device for testing a distributed storage system is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made are not repeated here. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0087] Figure 8 is a structural block diagram of an apparatus for testing a distributed storage system according to an embodiment of the present application, such as Figure 8 As shown, the device includes: an acquisition module 802, which is used to acquire a target standard parts library of the target storage scenario when the distributed storage scenario is the target storage scenario, wherein the target standard parts library records M standard parts and the association relationship between the M standard parts, and M is an integer greater than or equal to 1, and the M standard parts are obtained by layering the target storage scenario according to functional characteristics; a generation module 804, which is used to generate an automated chaos test case according to the association relationship between the M standard parts in the target standard parts library, wherein the automated chaos test case includes the selected standard parts from the M standard parts; a testing module 806, which is used to test the distributed storage system through the automated chaos test case.

[0088] In an exemplary embodiment, the device is also used for, when a first standard component among the M standard components is selected, determining a standard component among the M standard components that has a dependency relationship with the first standard component, and selecting the standard component with the dependency relationship, wherein the association relationship includes the dependency relationship; and when a second standard component among the M standard components is selected, determining a standard component among the M standard components that has a mutually exclusive relationship with the second standard component, and excluding the standard component with the mutually exclusive relationship, wherein the association relationship includes the mutually exclusive relationship.

[0089] In an exemplary embodiment, the device is also used to determine the unselected standard parts among the M standard parts, and restore the unselected standard parts to the default stage; randomly inject faults and simulate abnormal operations in the distributed storage system according to predefined fault models and / or abnormal conditions; execute the standard parts in the automated chaotic test case in sequence according to the hierarchical relationship between the standard parts in the automated chaotic test case and the serial numbers of the standard parts in the automated chaotic test case; when the standard part currently being executed is the current standard part, execute the current standard part in the following manner: when it is determined that the preparation phase operation of the functional characteristic layer of the current standard part is completed, perform the test operation and verification operation of the current standard part; after sequentially executing the standard parts in the automated chaotic test case, perform the verification operation on the standard parts in the automated chaotic test case.

[0090] In an exemplary embodiment, the device is also used to determine N storage scenarios in a distributed storage scenario, wherein N is an integer greater than or equal to 1, and the target storage scenario is any storage scenario among the N storage scenarios; construct a standard parts library for each storage scenario in the N storage scenarios to obtain N standard parts libraries, wherein the N standard parts libraries include the target standard parts library; classify the current storage scenario according to functional characteristics, and divide each storage scenario into levels in a dependency order; set standard parts for each level according to the functional attributes of the current storage scene, wherein the standard parts are used to represent the functional characteristics of the current storage scene, and each level includes one or more standard parts; construct a standard parts library for the current storage scene based on the association relationship between the levels of the storage scene and the standard parts of each level; wherein the N storage scenarios include: file storage, object storage, block storage, and distributed file system.

[0091] In an exemplary embodiment, the device is also used to classify the current storage scenario according to functional characteristics when the current storage scenario is object storage, and divide the various storage scenarios into levels in a dependency order, including: dividing the object storage into a cluster-level feature layer, a user-level feature layer, a bucket-level feature layer, and an object-level feature layer according to the functional attributes of the object storage; when the current storage scenario is file storage, classify the current storage scenario according to functional characteristics, and divide the various storage scenarios into levels in a dependency order, including: a cluster-level feature layer, a directory-level feature layer, and a file-level feature layer; when the current storage scenario is block storage, classify the current storage scenario according to functional characteristics, and divide the various storage scenarios into levels in a dependency order, including: a cluster-level feature layer, a volume-level feature layer, and a data-level feature layer; when the current storage scenario is a big data file system, classify the current storage scenario according to functional characteristics, and divide the various storage scenarios into levels in a dependency order, including: a cluster-level feature layer, a big data level feature layer, and a component-level feature layer.

[0092] In an exemplary embodiment, the device is also used to set at least one of the following standard parts for the cluster-level feature layer when the current storage scenario is object storage: load balancing, data redundancy; set at least one of the following standard parts for the user-level feature layer: user quota, access control list; set at least one of the following standard parts for the bucket-level feature layer: bucket multiple versions, bucket life cycle; set at least one of the following standard parts for the object-level feature layer: object basic services, append write; when the current storage scenario is file storage, the cluster-level feature layer includes at least one of the following standard parts: shared service settings, access design services; the directory-level feature layer includes at least one of the following standard parts: directory snapshots, directory management, etc.; the file-level The feature layer includes at least one of the following standard parts: network file system sharing, general Internet file system sharing; when the current storage scenario is block storage, the annotation parts of the cluster-level feature layer include: cloud platform docking service settings; the volume-level feature layer includes at least one of the following standard parts: snapshot standard parts, recycle bin standard parts; the data-level feature layer includes at least one of the following standard parts: cloud computing platform standard parts, containerized application platform standard parts; when the current storage scenario is a distributed file system, the cluster-level feature layer includes at least one of the following standard parts: distributed file system service settings, permission service settings; the distributed file system level feature layer includes at least one of the following standard parts: system management; the standard parts of the component-level feature layer are: component support.

[0093] In an exemplary embodiment, the device is also used to persistently store the test results and operation logs in a database; the automated chaos test result page displays the test results.

[0094] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0095] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0096] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0097] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0098] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0099] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0100] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0101] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0102] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for testing a distributed storage system, characterized in that: include: In the case where the distributed storage scenario is a target storage scenario, a target standard parts library of the target storage scenario is obtained, wherein the target standard parts library records M standard parts and association relationships between the M standard parts, where M is an integer greater than or equal to 1, and the M standard parts are obtained by layering the target storage scenario according to functional characteristics; Generate an automated chaotic test case according to the association relationship between the M standard parts in the target standard parts library, wherein the automated chaotic test case includes the standard parts selected from the M standard parts; The distributed storage system is tested through the automated chaos test case.

2. The method according to claim 1, characterized in that Generating an automated chaotic test case according to the association relationship between the M standard parts in the target standard parts library includes at least one of the following: In the case where a first standard component among the M standard components is selected, determining a standard component having a dependency relationship with the first standard component among the M standard components, and selecting the standard component having the dependency relationship, wherein the association relationship includes the dependency relationship; When a second standard component among the M standard components is selected, standard components having a mutually exclusive relationship with the second standard component are determined among the M standard components, and the standard components having the mutually exclusive relationship are excluded, wherein the association relationship includes the mutually exclusive relationship.

3. The method according to claim 1, characterized in that The distributed storage system is tested through the automated chaos test cases, including: Determine the unselected standard parts among the M standard parts, and restore the unselected standard parts to a default stage; According to predefined fault models and / or abnormal conditions, randomly injecting faults and simulating abnormal operations in the distributed storage system; According to the hierarchical relationship between the standard parts in the automated chaotic test case, and according to the serial number of each standard part in the automated chaotic test case, the standard parts in the automated chaotic test case are executed in sequence; When the currently executed standard part is the current standard part, the current standard part is executed in the following manner: When it is determined that the preparation phase of the functional characteristic layer of the current standard component is completed, performing a test operation and a verification operation of the current standard component; After sequentially executing each standard component in the automated chaotic test case, a verification operation is performed on each standard component in the automated chaotic test case.

4. The method according to any one of claims 1 to 3, characterized in that Before acquiring the target standard parts library of the target storage scenario, the method further includes: Determine N storage scenarios in the distributed storage scenario, wherein N is an integer greater than or equal to 1, and the target storage scenario is any storage scenario among the N storage scenarios; Constructing a standard parts library for each of the N storage scenarios to obtain N standard parts libraries, wherein the N standard parts libraries include the target standard parts library; Building a standard parts library for a current storage scene in the N storage scenes includes: Classifying the current storage scenarios according to functional characteristics, and dividing the storage scenarios into levels according to dependency order; Setting standard parts for each level according to the functional attributes of the current storage scene, wherein the standard parts are used to represent the functional characteristics of the current storage scene, and each level includes one or more standard parts; Building a standard parts library for the current storage scene according to the association relationship between the levels of the storage scene and the standard parts of each level; Among them, the N storage scenarios include: file storage, object storage, block storage and distributed file system.

5. The method according to claim 4, characterized in that In the case where the current storage scenario is object storage, the current storage scenario is classified according to functional characteristics, and each storage scenario is divided into layers in a dependency order, including: dividing the object storage into a cluster-level characteristic layer, a user-level characteristic layer, a bucket-level characteristic layer, and an object-level characteristic layer according to the functional attributes of the object storage; In the case where the current storage scenario is file storage, the current storage scenario is classified according to functional characteristics, and each storage scenario is divided into levels in a dependency order, including: a cluster-level characteristic layer, a directory-level characteristic layer, and a file-level characteristic layer; In the case where the current storage scenario is block storage, the current storage scenario is classified according to functional characteristics, and each storage scenario is divided into levels in a dependency order, including: a cluster-level characteristic layer, a volume-level characteristic layer, and a data-level characteristic layer; In the case where the current storage scenario is a big data file system, the current storage scenario is classified according to functional characteristics, and each storage scenario is divided into levels in a dependency order, including: a cluster-level feature layer, a big data-level feature layer, and a component-level feature layer.

6. The method according to claim 5, characterized in that Standard parts are set for each level according to the functional attributes of the current storage scene, including: In the case where the current storage scenario is object storage, at least one of the following standard parts is set for the cluster-level feature layer: load balancing, data redundancy; at least one of the following standard parts is set for the user-level feature layer: user quota, access control list; at least one of the following standard parts is set for the bucket-level feature layer: bucket multi-version, bucket life cycle; at least one of the following standard parts is set for the object-level feature layer: object basic business, append write; In the case where the current storage scenario is file storage, the cluster-level feature layer includes at least one of the following standard parts: shared service settings, access design services; the directory-level feature layer includes at least one of the following standard parts: directory snapshots, directory management and other standard parts; the file-level feature layer includes at least one of the following standard parts: network file system sharing, general Internet file system sharing; In the case where the current storage scenario is block storage, the annotation parts of the cluster-level feature layer include: cloud platform docking service settings; the volume-level feature layer includes at least one of the following standard parts: snapshot standard parts, recycle bin standard parts; the data-level feature layer includes at least one of the following standard parts: cloud computing platform standard parts, containerized application platform standard parts; When the current storage scenario is a distributed file system, the cluster-level feature layer includes at least one of the following standard parts: service settings and permission service settings of the distributed file system; the distributed file system-level feature layer includes at least one of the following standard parts: system management; the component-level feature layer includes: component support.

7. The method according to claim 1, characterized in that After the distributed storage system is tested by the automated chaos test case, the method further includes: Store test results and operation logs persistently in the database; The automated chaos test result page displays the test results.

8. A device for testing a distributed storage system, characterized in that: include: an acquisition module, for acquiring a target standard parts library of the target storage scene when the distributed storage scene is a target storage scene, wherein the target standard parts library records M standard parts and association relationships between the M standard parts, where M is an integer greater than or equal to 1, and the M standard parts are obtained by layering the target storage scene according to functional characteristics; A generation module is used to generate an automated chaos test case according to the association relationship between the M standard parts in the target standard parts library, wherein the automated chaos test case includes the standard parts selected from the M standard parts; a testing module is used to test the distributed storage system through the automated chaos test case.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 7 when executed by a processor.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 7 are implemented.