CN111694724B - Test method and device of distributed form system, electronic equipment and storage medium - Google Patents
Test method and device of distributed form system, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN111694724B CN111694724B CN201910197457.9A CN201910197457A CN111694724B CN 111694724 B CN111694724 B CN 111694724B CN 201910197457 A CN201910197457 A CN 201910197457A CN 111694724 B CN111694724 B CN 111694724B
- Authority
- CN
- China
- Prior art keywords
- abnormal
- file system
- local file
- exception
- parameters
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The embodiment of the invention discloses a testing method and device of a distributed form system, electronic equipment and a storage medium, wherein the method comprises the following steps: responding to the call of a process to be detected in the distributed form system to a target rewriting operation function in a preloading library, and acquiring abnormal parameters of a local file system; acquiring local file system abnormal operation information corresponding to the target rewriting operation function from the abnormal parameters; and feeding back the abnormal operation information of the local file system to the process to be detected in the distributed table system. According to the test scheme of the distributed form system, which is provided by the embodiment of the invention, the high-cost abnormal structure of the distributed file system is converted into the low-cost abnormal structure of the local file system, so that the cost of the abnormal structure is reduced, the accuracy of the abnormal structure is improved, and the scene coverage of the automatic abnormal test scheme is enlarged.
Description
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a testing method and device of a distributed form system, electronic equipment and a storage medium.
Background
With the continuous development of internet technology, a single Database cannot meet the requirements of high performance and large capacity storage of mass data, so a distributed table storage system scheme adopting a hierarchical architecture system is gradually known, for example, HBase (Hadoop Database) is an open source implementation, the distributed table system of the hierarchical architecture is usually deployed on a distributed file system, all system metadata and actual data are stored in an underlying distributed file system, and a table layer only needs to focus on distributed index services. For example: the Master, regionServer of HBase all use the resources of the underlying distributed file system HDFS (Hadoop FileSystem ).
However, this hierarchical architecture results in the stability of the distributed form system being strongly dependent on the stability of the underlying distributed file system, and the risk is amplified layer by layer, with a little fluctuation of the underlying distributed file system, which may have a great impact on the upper form services. For example: the HDFS has a small read-write latency, and the HBase service may not be available to the overall system. Therefore, various abnormal conditions may occur in the bottom distributed file system, and the upper table service needs to implement fault-tolerant processing as much as possible, otherwise, the system cannot stably run for a long time. For example: after the capacity of the distributed file system is full, the table layer should be forbidden to write; after the expansion is completed, the table layer service should be automatically restored. Therefore, the exception test of the distributed table system and the lower storage layer of the layered architecture is a large core in the whole quality assurance work.
However, in the existing test schemes of the distributed form system, it is difficult to comprehensively test anomalies possibly existing in the coverage distributed file system, and it is high in cost, even if part of the scenes cannot be accurately constructed, and the test process cannot be fully automated.
Disclosure of Invention
The embodiment of the invention provides a testing method, a testing device, electronic equipment and a storage medium of a distributed form system, which are used for solving the technical problems that the existing testing scheme of the distributed form system is difficult to comprehensively test and cover possible anomalies of a distributed file system, the anomaly cost for constructing a specific scene is high, part of scenes cannot be accurately constructed, the testing process cannot be fully automated and the like.
In a first aspect, an embodiment of the present invention provides a method for testing a distributed table system, including:
responding to the call of a process to be detected in the distributed form system to a target rewriting operation function in a preloading library, and acquiring abnormal parameters of a local file system;
acquiring local file system abnormal operation information corresponding to the target rewriting operation function from the abnormal parameters;
feeding back abnormal operation information of the local file system to a process to be detected in the distributed form system;
the distributed form system is started based on a mode of a preloading library and is deployed in the local file system, the preloading library comprises a plurality of rewriting operation functions, and each rewriting operation function is obtained by rewriting based on the local file system operation function of an application layer.
In a second aspect, an embodiment of the present invention further provides a testing apparatus for a distributed table system, including:
the abnormal parameter acquisition module is used for responding to the call of a process to be detected in the distributed form system to a target rewriting operation function in the preloading library and acquiring abnormal parameters of the local file system;
the abnormal operation information acquisition module is used for acquiring the abnormal operation information of the local file system corresponding to the target rewriting operation function from the abnormal parameters;
the first feedback module is used for feeding back abnormal operation information of the local file system to a process to be detected in the distributed form system;
the distributed form system is started based on a mode of a preloading library and is deployed in the local file system, the preloading library comprises a plurality of rewriting operation functions, and each rewriting operation function is obtained by rewriting based on the local file system operation function of an application layer.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a method of testing a distributed table system according to any of the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention further provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method for testing a distributed table system according to any of the embodiments of the present invention.
According to the testing method, the device, the electronic equipment and the storage medium of the distributed form system, the process to be tested in the distributed form system is started based on the starting mode of the pre-loading library, the process to be tested is enabled to call the target rewriting operation function in the pre-loading library, the plurality of rewriting operation functions included in the pre-loading library are obtained by rewriting based on the local file system operation function of the system application layer, the purpose is to enable the target rewriting operation function to respond to the call of the process to be tested, obtain the abnormal parameters of the local file system appointed by a tester in advance, obtain the abnormal operation information of the local file system corresponding to the target rewriting operation function from the abnormal parameters and feed the abnormal operation information back to the process to be tested, and accordingly the distributed form system can conduct abnormal processing on the abnormal process to be tested. Therefore, when the distributed form system is subjected to the abnormal test, only the local file system is required to be subjected to the abnormal structure, the abnormal structure cost is reduced, and according to the test requirement, any storage resource of the local file system can be subjected to the accurate abnormal structure, so that the scene coverage of an automatic abnormal test scheme is enlarged, and the automatic test is realized.
Drawings
Fig. 1 is a flow chart of a testing method of a distributed table system according to a first embodiment of the present invention;
fig. 2 is a flow chart of a testing method of a distributed table system according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a testing device of a distributed table system according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a flowchart of a testing method for a distributed table system according to an embodiment of the present invention, where the present embodiment is applicable to a case of automatic anomaly testing for a distributed table system with a hierarchical architecture, and the method may be performed by a testing device for a corresponding distributed table system, where the device may be implemented in software and/or hardware, and may be configured on an electronic device, such as a computer terminal or a server.
As shown in fig. 1, the method for testing a distributed table system according to the embodiment of the present invention may include:
s110, responding to the call of the process to be tested in the distributed form system to the target rewriting operation function in the preloading library, and obtaining the abnormal parameters of the local file system.
The distributed form system is started based on a mode of a preloading library and is deployed in the local file system, the preloading library comprises a plurality of rewriting operation functions, and each rewriting operation function is obtained by rewriting based on the local file system operation function of an application layer.
Specifically, in order to adapt to different underlying storage resources, the distributed table system encapsulates a storage adaptation layer, and uses the same interface to implement operation call of different storages. Taking HBase as an example, the storage adaptation layer can be deployed on the HDFS cluster, or can be deployed in a single-machine system by using a local hard disk, the directory structures and interface calling modes of the single-machine environment and the cluster environment are completely consistent, and only a few differences exist in a few characteristics. In the embodiment of the invention, the distributed form system is deployed in the local file system by utilizing the storage adaptation layer, for example, the local disk of the electronic equipment of the distributed form system is deployed, so that the high-cost abnormal structure of the distributed form system is converted into the low-cost abnormal structure of the local file system, and the test cost is reduced.
In a Linux environment, an application layer typically uses a series of system functions, such as a local file system operation function, to actually operate a local file system, for example, a system function create is used to create a file, a system function write is used to write data, and the system functions are numerous and related to an actual service, so that they will not be described in detail herein. The distributed form system is started based on a mode of a pre-loading library, namely the pre-loading library is automatically loaded when the distributed form system is started, the pre-loading library comprises a plurality of rewriting operation functions, each rewriting operation function is obtained by rewriting based on the local file system operation function, and the purpose is to enable the rewriting operation function to respond to the call of a process to be tested to obtain the abnormal parameters of the local file system.
Preferably, the rewriting operation function is a HOOK system function corresponding to a local file system operation function obtained by rewriting the local file system operation function of the application layer by using a HOOK mechanism. HOOK is a program segment for processing messages, and is hung into the system through a system call. Whenever a particular message is sent, the hooking program captures the message before the destination window is reached, i.e., the hooking function gains control first. The hook function can process (change) the message, can continue to transmit the message without processing, and can forcedly end the transmission of the message. Through the HOOK mechanism, the rewriting operation function can respond to the call of the process to be tested to acquire the abnormal parameters of the local file system to complete the abnormal construction so as to realize the abnormal test of the distributed form system.
The abnormal parameters are preset for business scenes and test requirements. The exception parameters may include at least one local file system exception operation information associated with the local file system operation function and an exception construction condition. For example, in a specific business scenario, different processes in the tested distributed table system are required to process, and according to test requirements, it may be specified, for example, for which process or processes to construct an exception, for which specific scenario when the exception is constructed, that is, for which condition is satisfied, the exception is constructed, and for whom to construct the exception, which information may form the exception constructing condition. For example, the exception parameters may be written in terms of "name of exception function-exception probability-exception error code or operation tamper time" or "name of exception function-inode remaining percentage or storage space remaining percentage".
Common local file system anomalies include capacity full, inode (index node) exhaustion, read-write failure, read-write data errors, slow read-write, and the like, so different anomaly parameters can be written according to different test requirements, and the same type of local file system operation function can also correspond to a plurality of anomaly operation information, wherein the anomaly operation information refers to anomaly information fed back to a process to be tested, and for example, the local file system anomaly operation information related to a local file system operation function open can comprise two types of open file errors and open file tamper. Preferably, it can also be written as an exception parameter in JSON format.
In one embodiment, the exception parameters may be written to a shared memory local to the electronic device by the HTTP server, and the rewrite operation function may be responsive to a call to the process under test to obtain the exception parameters from the shared memory. This approach is simple to operate and easy to integrate into automated testing.
Specifically, the obtaining the abnormal parameters of the local file system from the shared memory includes:
acquiring a file lock of the shared memory, wherein the file lock is used for locking read operation and write operation of programs except a target rewriting operation function on the shared memory;
acquiring abnormal parameters of a local file system from the shared memory;
and releasing the file lock.
Here, the process of writing the exception parameters into the shared memory through the HTTP server and the process of obtaining the exception parameters from the shared memory by the target overwrite operation function may occur simultaneously in time. Therefore, in order to ensure the ordering of the exception configuration, it is necessary to lock the read operation and the write operation of the program other than the target rewrite operation function to the shared memory when the exception parameters are acquired according to the file lock mode, then read the exception parameters from the shared memory, and then release the file lock so that other exception parameters can be written to the shared memory continuously through the HTTP server.
S120, acquiring the abnormal operation information of the local file system corresponding to the target rewriting operation function from the abnormal parameters.
For example, if the target overwrite operation function is a rewritten read function, obtaining local file system exception operation information corresponding to the target overwrite operation function from exception parameters, such as read_error and error code 5, or read_pun and pun time 0.2s; if the target rewriting operation function is a rewritten statfs function, the abnormal operation information of the local file system corresponding to the target rewriting operation function is obtained from the abnormal parameters, such as the storage space remaining percentage and the inode remaining percentage of the local file system. The target overwrite operation function is read and sta fs of overwrite, which are only examples, but may be other overwrite operation functions corresponding to the native file system operation function based on the application layer, which is not limited herein.
S130, feeding back abnormal operation information of the local file system to the process to be detected in the distributed table system.
The local file system abnormal operation information corresponding to the target rewriting operation function obtained in S120 is fed back to the process to be tested, so that the local file system abnormal structure for the process to be tested is realized. And then the distributed form system performs corresponding exception handling for the process to be tested for exception. Therefore, whether the processing of the distributed form system accords with the expectations or not during the abnormal period can be verified according to the processing result of the distributed form system on the abnormal process to be detected.
It should be noted that, for the stability test problem of the distributed table system of the hierarchical architecture, the prior art mainly adopts the following 3 schemes:
the method comprises the steps of A, putting various management types of operation on a distributed file system layer, writing an automatic test Case to cover a use scene of an upper table service, and carding out a scene with damage to the distributed table system service;
the scheme B is that a storage system integrated test environment is built together, business scenes and tolerable abnormal conditions of respective systems are put in layers, certain background pressure is put in at the same time, and the stability of the system is tested and verified from the whole perspective;
and C, aiming at file system abnormality which cannot be covered by the distributed form system, preparing an operation plan and performing exercise regularly.
However, the three system integration test schemes described above mainly have the following problems: (1) Firstly, the possible abnormality of the coverage distributed file system is difficult to comprehensively test, and the abnormality of a small number of nodes or modules can not affect the service of an upper table system under normal conditions because of the great degree of fault tolerance in design; (2) In the second scheme, the construction of the anomaly of the specific scene is relatively high in cost, for example: constructing a scene of error checking of the bottom layer data crc, reading correct data through a specific tool, constructing part of data in the data after backup, recharging the data into a file path of the previous data, and recovering the backup data after the abnormal test is finished; (3) partial scenes cannot be constructed accurately, for example: constructing a file system, wherein the read-write speed is slow and exceeds the overtime time limit of a table layer, and the scene cannot be accurately constructed in a mode of increasing the pressure by a pressure measuring tool; (4) the testing process is not fully automated.
Compared with the existing distributed form system stability test scheme aiming at the layered architecture, the technical scheme of the embodiment of the invention starts the process to be tested in the distributed form system based on the starting mode of the preloaded library, so that the process to be tested calls the target rewriting operation function in the preloaded library, and a plurality of rewriting operation functions included in the preloaded library are obtained by rewriting based on the local file system operation function of the system application layer, and the purpose is to enable the target rewriting operation function to respond to the call of the process to be tested, obtain the abnormal parameters of the local file system pre-designated by a tester, obtain the abnormal operation information of the local file system corresponding to the target rewriting operation function from the abnormal parameters and feed the abnormal operation information back to the process to be tested, so that the distributed form system can perform abnormal processing on the abnormal process to be tested. Therefore, when the distributed form system is subjected to the abnormal test, only the local file system is required to be subjected to the abnormal structure, so that the abnormal structure cost is reduced, and according to the test requirement, all storage resources of the local file system can be subjected to the accurate abnormal structure, so that the scene coverage of an automatic abnormal test scheme is enlarged.
Example two
Fig. 2 is a flow chart of a testing method of a distributed table system according to a second embodiment of the present invention. The method for testing the distributed table system according to the embodiment of the present invention may include, as shown in fig. 2, optimizing the present embodiment based on the above embodiment:
s210, responding to the call of a process to be detected in the distributed form system to a target rewriting operation function in a preloading library, and acquiring abnormal parameters of a local file system.
The distributed form system is started based on a mode of a preloading library and is deployed in the local file system, the preloading library comprises a plurality of rewriting operation functions, and each rewriting operation function is obtained by rewriting based on the local file system operation function of an application layer.
In the embodiment of the invention, the exception parameters comprise exception construction conditions besides at least one piece of local file system exception operation information related to a local file system operation function. In a specific business scenario, many processes are required to process, so that a target process requiring abnormal construction in a plurality of processes can be judged through abnormal construction conditions. The abnormal construction condition comprises an abnormal effective process identifier or an abnormal effective process name and process path, an abnormal operation type, an abnormal file list and an abnormal occurrence probability. The process identifier of the exception effective is preferably a process ID, and because the process ID can uniquely identify one process, the process ID can be used for designating the process needing to construct the exception; the process name and the process path which are in abnormal effect can jointly identify a process, so that the process needing to be constructed abnormal can be specified through the process name and the process path which are in abnormal effect; the abnormal operation types comprise write failure, write slow, read failure, table building failure and the like; the abnormal file list is used for storing files which need to be subjected to abnormal processing of the process to be tested, and can be set according to actual testing requirements.
S220, judging whether the process to be tested in the distributed form system meets the abnormal construction condition according to the abnormal parameters, if so, executing S230-S240, otherwise, executing S250.
Judging whether the process to be tested meets the abnormal construction condition according to the abnormal parameters, and judging whether the process to be tested is matched with the abnormal effective process identification or the abnormal effective process name and process path, the abnormal operation type, the abnormal file list and the abnormal occurrence probability in sequence.
Specifically, the determination may be performed according to the following determination flow:
s1, acquiring a process ID of a process to be detected or a process name and a process path of the process to be detected, matching the process ID with an abnormally effective process identifier or the abnormally effective process name with the process path, if the matching is successful, indicating that the current process to be detected is a target process to be constructed abnormally, continuing to execute S2, if the matching is failed, indicating that the process to be detected does not need abnormal construction, and directly executing S250.
S2, judging whether the abnormal operation types are matched, for example, if the operation executed by the current process to be tested is a read operation, and if the abnormal operation types matched with the process paths through the process identification of abnormal effectiveness or the process name of abnormal effectiveness are write failures, the abnormal operation types are not matched, and executing S250; if the abnormal operation types match, continuing to execute S3.
S3, judging whether the file in the local file system to be operated by the process to be tested is located in the abnormal file list, if so, continuing to execute S4, otherwise, executing S250.
S4, judging whether the abnormal occurrence probability meets parameter setting, such as abnormal occurrence probability or storage space remaining percentage. If yes, determining that the process to be tested meets the abnormal construction condition, and executing S230-S240 to complete abnormal construction; otherwise, S250 is performed.
S230, acquiring the abnormal operation information of the local file system corresponding to the target rewriting operation function from the abnormal parameters.
S240, feeding back abnormal operation information of the local file system to the process to be detected in the distributed table system.
S250, feeding back normal operation information of the local file system corresponding to the target rewriting operation function to a process to be detected in the distributed table system.
If the process to be tested does not meet the abnormal construction condition, the normal operation information of the local file system corresponding to the target rewriting operation function is fed back to the process to be tested, for example, the process to be tested reads a certain file in the local file system, and detailed information corresponding to the file is fed back to the process to be tested.
On this basis, two specific exception test examples are provided by way of example:
scheme one, fuzzy test.
Simultaneously randomly putting various operations in the distributed form system to actually operate the local file system, such as operations of creating a table, reading and writing data, deleting the table, data arrangement, snapshot, splitting, merging and the like; the metadata, WAL (Write-Ahead log) and actual data of the distributed form system are randomly selected to be released abnormally, the released abnormally is randomly selected from various system operation functions, the abnormal type and the abnormal value are also selected in a reasonable range, for example, the file of/home/disk 1/data/master.data in the local file system is compacted, and the compaction time is 0.02s (namely the abnormal value). In the whole fuzzy test, the system is checked to see if the system crashes in various business scenes and abnormal scenes, after the abnormal recovery is verified, the system can be recovered normally, and the defect point of the fault-tolerant processing of the system is found.
The test scheme has the advantages of higher input-output ratio, more new problems can be extracted by long-term automatic test, and the scheme has the disadvantage that regression test of the problems cannot be accurately performed.
Scheme two, accurate anomaly testing.
The scheme is a supplement to the fuzzy test and is used for accurately verifying whether the problems found by the fuzzy test, the on-line problems and the like are repaired. Taking HBase as an example, a typical accurate anomaly test procedure is as follows: performing table construction operation in a distributed table system, responding to the call of a table construction process to a Linux system function related to the table construction operation, enabling the function to select an abnormal parameter with delay of 30s and duration of 2 minutes from abnormal parameters of a local file system, wherein a path corresponding to the parameter is a path in which a Wal log is located, thereby realizing the exception of putting write delay of 30s and duration of 2 minutes into the path in which the Wal log is located, and reading and writing data verification from a table layer: verifying whether the treatment of Hbase during the abnormality is in line with expectations, and verifying whether the Hbase is recovered to normal after the abnormality is recovered.
The test scheme can finely control the abnormal file, the abnormal operation type, the abnormal value and the duration of the storage layer, and is convenient for quick regression of the known problems.
According to the technical scheme provided by the embodiment of the invention, the high-cost abnormal structure of the distributed file system is converted into the low-cost abnormal structure of the local file system, and the influence range can be accurately controlled in the abnormal structure process by judging whether the process to be tested meets the abnormal structure condition, so that the feedback of abnormal information on the specified tested business can be realized, no influence is caused on an operating system, hardware or other services on the same machine, and the process to be tested does not need to be changed.
Example III
Fig. 3 is a schematic structural diagram of a testing device of a distributed table system according to a third embodiment of the present invention. As shown in fig. 3, the apparatus includes:
the abnormal parameter obtaining module 310 is used for responding to the call of a process to be detected in the distributed form system to a target rewriting operation function in the preloading library and obtaining the abnormal parameters of the local file system;
an abnormal operation information obtaining module 320, configured to obtain local file system abnormal operation information corresponding to a target overwrite operation function from the abnormal parameters;
the first feedback module 330 is configured to feed back the abnormal operation information of the local file system to the process to be tested in the distributed table system.
The distributed form system is started based on a mode of a preloading library and is deployed in the local file system, the preloading library comprises a plurality of rewriting operation functions, and each rewriting operation function is obtained by rewriting based on the local file system operation function of an application layer.
In the embodiment of the invention, when the process to be tested calls the target rewriting operation function in the preloading library, the abnormal operation information acquisition module acquires the local file system abnormal operation information corresponding to the target rewriting operation function from the abnormal parameter acquisition module and feeds back the information to the process to be tested through the first feedback module, so that the abnormal structure of the process to be tested is realized, and the high-cost distributed file system abnormal structure is changed into the low-cost and accurate local file system abnormal structure.
On the basis of the embodiment, the rewriting operation function is a HOOK system function corresponding to a local file system operation function obtained by rewriting the local file system operation function of an application layer by using a HOOK mechanism.
On the basis of the above embodiment, the abnormal parameter acquisition module includes:
the acquisition unit is used for acquiring the abnormal parameters of the local file system from the shared memory, wherein the abnormal parameters are written into the shared memory through the HTTP server.
On the basis of the above embodiment, the acquiring unit is specifically configured to:
acquiring a file lock of the shared memory, wherein the file lock is used for locking read operation and write operation of processes except for a target rewriting operation function on the shared memory;
acquiring abnormal parameters of a local file system from the shared memory;
and releasing the file lock.
On the basis of the embodiment, the exception parameters at least comprise an exception construction condition and at least one local file system exception operation information related to the local file system operation function;
correspondingly, the abnormal operation information acquisition module comprises:
the judging unit is used for judging whether the process to be detected in the distributed form system meets the abnormal construction condition according to the abnormal parameters;
and the abnormal operation information acquisition unit is used for acquiring the abnormal operation information of the local file system corresponding to the target rewriting operation function from the abnormal parameters when the judging unit determines that the abnormal construction condition is met.
On the basis of the embodiment, the exception construction condition at least comprises an exception effective process identifier or an exception effective process name and process path, an exception operation type, an exception file list and an exception occurrence probability.
On the basis of the above embodiment, the apparatus further includes:
and the second feedback module is used for feeding back the normal operation information of the local file system corresponding to the target rewriting operation function to the process to be detected in the distributed form system when the judging unit determines that the abnormal construction condition is not met.
The testing device of the distributed form system provided by the embodiment of the invention can execute the testing method of the distributed form system provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executing method.
Example IV
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. Fig. 4 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 4 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 4, the electronic device 12 is in the form of a general purpose computing device. Components of the electronic device 12 may include, but are not limited to: one or more processors or processors 16, a memory 28, a bus 18 connecting the various system components, including the memory 28 and the processor 16.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the embodiments described herein.
The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the electronic device 12, and/or any devices (e.g., network card, modem, etc.) that enable the electronic device 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 over the bus 18. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 12, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processor 16 executes programs stored in the memory 28 to perform various functional applications and data processing, for example, to implement a method for testing a distributed table system according to an embodiment of the present invention, including:
responding to the call of a process to be detected in the distributed form system to a target rewriting operation function in a preloading library, and acquiring abnormal parameters of a local file system;
acquiring local file system abnormal operation information corresponding to the target rewriting operation function from the abnormal parameters;
feeding back abnormal operation information of the local file system to a process to be detected in the distributed form system;
the distributed form system is started based on a mode of a preloading library and is deployed in the local file system, the preloading library comprises a plurality of rewriting operation functions, and each rewriting operation function is obtained by rewriting based on the local file system operation function of an application layer.
Example five
Embodiments of the present invention provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are used to perform a method of testing a distributed table system, the method comprising:
responding to the call of a process to be detected in the distributed form system to a target rewriting operation function in a preloading library, and acquiring abnormal parameters of a local file system;
acquiring local file system abnormal operation information corresponding to the target rewriting operation function from the abnormal parameters;
feeding back abnormal operation information of the local file system to a process to be detected in the distributed form system;
the distributed form system is started based on a mode of a preloading library and is deployed in the local file system, the preloading library comprises a plurality of rewriting operation functions, and each rewriting operation function is obtained by rewriting based on the local file system operation function of an application layer.
Of course, a storage medium containing computer-executable instructions provided in an embodiment of the present invention is not limited to the method operations described above, but may also perform related operations in testing of the distributed table system provided in any embodiment of the present invention.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having 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 portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.
Claims (12)
1. A method for testing a distributed form system, the method comprising:
responding to the call of a process to be detected in the distributed form system to a target rewriting operation function in a preloading library, and acquiring abnormal parameters of a local file system;
acquiring local file system abnormal operation information corresponding to the target rewriting operation function from the abnormal parameters;
feeding back abnormal operation information of the local file system to a process to be detected in the distributed form system;
the distributed form system is started based on a mode of a preloading library and is deployed in the local file system, the preloading library comprises a plurality of rewriting operation functions, and the rewriting operation functions are HOOK system functions corresponding to the local file system operation functions, which are obtained by rewriting the local file system operation functions of an application layer by using a HOOK mechanism;
the obtaining the abnormal parameters of the local file system includes:
and acquiring the abnormal parameters of the local file system from the shared memory, wherein the abnormal parameters are written into the shared memory through an HTTP server.
2. The method of claim 1, wherein the obtaining the exception parameters of the local file system from the shared memory comprises:
acquiring a file lock of the shared memory, wherein the file lock is used for locking read operation and write operation of processes except for a target rewriting operation function on the shared memory;
acquiring abnormal parameters of a local file system from the shared memory;
and releasing the file lock.
3. The method according to claim 1, wherein the exception parameters include at least an exception construction condition and at least one local file system exception operation information related to the local file system operation function;
correspondingly, obtaining the local file system abnormal operation information corresponding to the target rewriting operation function from the abnormal parameters comprises the following steps:
judging whether a process to be detected in the distributed form system meets the abnormal construction condition or not according to the abnormal parameters;
and if so, acquiring the local file system abnormal operation information corresponding to the target rewriting operation function from the abnormal parameters.
4. A method according to claim 3, wherein the exception construction condition includes at least an exception effective process identification or an exception effective process name and process path, as well as an exception operation type, an exception file list and an exception occurrence probability.
5. A method according to claim 3, wherein the method further comprises:
and if the abnormal construction condition is not met, feeding back normal operation information of the local file system corresponding to the target rewriting operation function to the process to be detected in the distributed table system.
6. A test apparatus for a distributed form system, the apparatus comprising:
the abnormal parameter acquisition module is used for responding to the call of a process to be detected in the distributed form system to a target rewriting operation function in the preloading library and acquiring abnormal parameters of the local file system;
the abnormal operation information acquisition module is used for acquiring the abnormal operation information of the local file system corresponding to the target rewriting operation function from the abnormal parameters;
the first feedback module is used for feeding back abnormal operation information of the local file system to a process to be detected in the distributed form system;
the distributed form system is started based on a mode of a preloading library and is deployed in the local file system, the preloading library comprises a plurality of rewriting operation functions, and the rewriting operation functions are HOOK system functions corresponding to the local file system operation functions, which are obtained by rewriting the local file system operation functions of an application layer by using a HOOK mechanism;
wherein, the abnormal parameter acquisition module comprises:
the acquisition unit is used for acquiring the abnormal parameters of the local file system from the shared memory, wherein the abnormal parameters are written into the shared memory through the HTTP server.
7. The apparatus according to claim 6, wherein the acquisition unit is specifically configured to:
acquiring a file lock of the shared memory, wherein the file lock is used for locking read operation and write operation of processes except for a target rewriting operation function on the shared memory;
acquiring abnormal parameters of a local file system from the shared memory;
and releasing the file lock.
8. The apparatus of claim 6, wherein the exception parameters include at least an exception configuration condition and at least one local file system exception operation information associated with the local file system operation function;
correspondingly, the abnormal operation information acquisition module comprises:
the judging unit is used for judging whether the process to be detected in the distributed form system meets the abnormal construction condition according to the abnormal parameters;
and the abnormal operation information acquisition unit is used for acquiring the abnormal operation information of the local file system corresponding to the target rewriting operation function from the abnormal parameters when the judging unit determines that the abnormal construction condition is met.
9. The apparatus of claim 8, wherein the exception build condition comprises at least an exception-effective process identification or an exception-effective process name and process path, as well as an exception operation type, an exception file list, and an exception occurrence probability.
10. The apparatus of claim 8, wherein the apparatus further comprises:
and the second feedback module is used for feeding back the normal operation information of the local file system corresponding to the target rewriting operation function to the process to be detected in the distributed form system when the judging unit determines that the abnormal construction condition is not met.
11. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of testing a distributed table system as recited in any of claims 1-5.
12. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements a method of testing a distributed table system according to any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910197457.9A CN111694724B (en) | 2019-03-15 | 2019-03-15 | Test method and device of distributed form system, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910197457.9A CN111694724B (en) | 2019-03-15 | 2019-03-15 | Test method and device of distributed form system, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111694724A CN111694724A (en) | 2020-09-22 |
CN111694724B true CN111694724B (en) | 2023-05-05 |
Family
ID=72475898
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910197457.9A Active CN111694724B (en) | 2019-03-15 | 2019-03-15 | Test method and device of distributed form system, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111694724B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113849098A (en) * | 2021-11-29 | 2021-12-28 | 北京蔚领时代科技有限公司 | Hook-based method and device for remotely setting cursor |
CN116069638B (en) * | 2023-01-19 | 2023-09-01 | 蔷薇大树科技有限公司 | Method for simulating distributed abnormal state based on kernel mode |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104008420A (en) * | 2014-05-26 | 2014-08-27 | 中国科学院信息工程研究所 | Distributed outlier detection method and system based on automatic coding machine |
CN108959055A (en) * | 2018-07-25 | 2018-12-07 | 郑州云海信息技术有限公司 | Readwrite performance test method, device and the equipment of xfs file system |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9678816B2 (en) * | 2012-06-29 | 2017-06-13 | Vmware, Inc. | System and method for injecting faults into code for testing thereof |
NL2009756C2 (en) * | 2012-11-05 | 2014-05-08 | Realworld Holding B V | Method and arrangement for collecting timing data related to a computer application. |
CN104461865A (en) * | 2014-11-04 | 2015-03-25 | 哈尔滨工业大学 | Cloud environment distributed file system reliability test suite |
CN105426310B (en) * | 2015-11-27 | 2018-06-26 | 北京奇虎科技有限公司 | A kind of method and apparatus for the performance for detecting target process |
CN106227656B (en) * | 2016-07-18 | 2018-07-17 | 中国科学院软件研究所 | A kind of data contention sample detecting method based on hardware and thread-local sequential |
CN107239405B (en) * | 2017-08-03 | 2020-04-28 | 四川长虹电器股份有限公司 | Automatic testing method based on Android multi-browser kernel |
CN108334447A (en) * | 2017-12-31 | 2018-07-27 | 江苏易润信息技术有限公司 | A kind of system and method for test processes computer software exception |
CN108563562A (en) * | 2018-03-22 | 2018-09-21 | 平安科技(深圳)有限公司 | Test method, device, computer equipment and the storage medium of distributed system |
-
2019
- 2019-03-15 CN CN201910197457.9A patent/CN111694724B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104008420A (en) * | 2014-05-26 | 2014-08-27 | 中国科学院信息工程研究所 | Distributed outlier detection method and system based on automatic coding machine |
CN108959055A (en) * | 2018-07-25 | 2018-12-07 | 郑州云海信息技术有限公司 | Readwrite performance test method, device and the equipment of xfs file system |
Also Published As
Publication number | Publication date |
---|---|
CN111694724A (en) | 2020-09-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10073683B2 (en) | System and method for providing software build violation detection and self-healing | |
CN106775602B (en) | Code publishing method and device | |
CN111158741B (en) | Method and device for monitoring dependency relationship change of service module on third party class library | |
US11429488B2 (en) | Data recovery method based on snapshots, device and storage medium | |
US10635575B2 (en) | Testing of enterprise resource planning systems | |
CN108874441B (en) | Board card configuration method, device, server and storage medium | |
CN111694724B (en) | Test method and device of distributed form system, electronic equipment and storage medium | |
CN111694684B (en) | Abnormal construction method and device of storage device, electronic device and storage medium | |
CN110063042A (en) | A kind of response method and its terminal of database failure | |
CN115982049A (en) | Abnormity detection method and device in performance test and computer equipment | |
CN113094251A (en) | Embedded system testing method and device, computer equipment and storage medium | |
CN107729541A (en) | A kind of data processing method, device and computer-readable recording medium | |
CN110620800B (en) | Method and device for synchronously processing configuration data of power secondary system across safety zones | |
KR102194974B1 (en) | System for monitoring and controling electric power system for process verification | |
CN112751782A (en) | Flow switching method, device, equipment and medium based on multi-activity data center | |
CN117201517A (en) | Cloud migration system, method, electronic equipment and storage medium | |
CN112650613B (en) | Error information processing method and device, electronic equipment and storage medium | |
CN111625853B (en) | Snapshot processing method, device and equipment and readable storage medium | |
CN113467941A (en) | Method and device for sharing information | |
US20160275002A1 (en) | Image capture in application lifecycle management for documentation and support | |
CN114840350A (en) | System interaction method and system based on task processing unified management engine | |
CN113204360B (en) | System upgrading method and device | |
CN110008114B (en) | Configuration information maintenance method, device, equipment and readable storage medium | |
CN116820946B (en) | Method and device for automatically testing compatibility of target software | |
CN113687859B (en) | Branch management method and device for software development, electronic equipment and 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |