CN108563562A - Test method, device, computer equipment and the storage medium of distributed system - Google Patents

Test method, device, computer equipment and the storage medium of distributed system Download PDF

Info

Publication number
CN108563562A
CN108563562A CN201810239756.XA CN201810239756A CN108563562A CN 108563562 A CN108563562 A CN 108563562A CN 201810239756 A CN201810239756 A CN 201810239756A CN 108563562 A CN108563562 A CN 108563562A
Authority
CN
China
Prior art keywords
target detection
module
test
mouthfuls
distributed system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810239756.XA
Other languages
Chinese (zh)
Inventor
吴逸明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201810239756.XA priority Critical patent/CN108563562A/en
Priority to PCT/CN2018/091911 priority patent/WO2019178957A1/en
Publication of CN108563562A publication Critical patent/CN108563562A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3495Performance evaluation by tracing or monitoring for systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • G06F11/3419Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment by assessing time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • G06F11/3433Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment for load management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a kind of test method of distributed system, device, computer equipment and storage mediums.The test method of the distributed system includes:Distributed system test request is obtained, the distributed system test request includes target detection module, target detection type and target detection time;The communicating link data of the target detection module is obtained, the communicating link data includes I/O mouthfuls of quantity of target;If the target I/O mouthfuls of quantity is more than I/O mouthfuls of quantity of free time within the target detection time, obtains and show that idle I/O mouthfuls of quantity is greater than or equal to the free time section of the target I/O mouthfuls of quantity;The adjustment testing time is obtained, if present system time reaches the adjustment testing time, the communication link of the target detection module is taken over, the target detection module is tested based on the target detection type.The test method of the distributed system ensure that the convenience of distributed system test and improve the testing efficiency of distributed system.

Description

Test method, device, computer equipment and the storage medium of distributed system
Technical field
The present invention relates to system testing fields more particularly to a kind of test method of distributed system, device, computer to set Standby and storage medium.
Background technology
Distributed system is one and is distributed hardware and software component on a network computer, and is carried out by message transmission Communication and the system coordinated.And the software test link to the system can be related to after distributed system builds completion, so And the Software Testing Models (such as V models, W models, H models and X models etc.) of current main-stream are primarily directed to non-distributed What system was designed, although there is certain applicability in the test of distributed system, with distributed system technology Development and test request raising, these Software Testing Models oneself through cannot meet distributed system test the needs of.Meanwhile Since distributed system has the characteristics that component network, lower deployment cost are high, the existing test method for distributed system is just Victory is not high, and testing efficiency is relatively low.
Invention content
The embodiment of the present invention provides a kind of test method of distributed system, device, computer equipment and storage medium, with Solve the problems, such as the test method convenience of existing distributed system and inefficient.
In a first aspect, the embodiment of the present invention provides a kind of test method of distributed system, include the following steps:
Distributed system test request is obtained, the distributed system test request includes target detection module, target survey Try type and target detection time;
The communicating link data of the target detection module is obtained, the communicating link data includes I/O mouthfuls of quantity of target;
If the target I/O mouthfuls of quantity is greater than or equal to I/O mouthfuls of quantity of free time within the target detection time, obtain And show that idle I/O mouthfuls of quantity is greater than or equal to the free time section of the target I/O mouthfuls of quantity;
The adjustment testing time is obtained, if present system time reaches the adjustment testing time, takes over the target detection mould The communication link of block tests the target detection module based on the target detection type.
Second aspect, the embodiment of the present invention provide a kind of test device of distributed system, including:
Distributed system test request acquisition module, for obtaining distributed system test request, the distributed system Test request includes target detection module, target detection type and target detection time;
Communicating link data acquisition module, the communicating link data for obtaining the target detection module, the communication Link data includes I/O mouthfuls of quantity of target;
Free time section acquisition module, if within the target detection time target I/O mouthfuls of quantity be more than or Equal to idle I/O mouthfuls of quantity, then obtains and show that idle I/O mouthfuls of quantity is greater than or equal to the free time of the target I/O mouthfuls of quantity Period;
Test module is adjusted, for obtaining the adjustment testing time, if present system time reaches the adjustment testing time, is connect The communication link for managing the target detection module tests the target detection module based on the target detection type.
The third aspect, the embodiment of the present invention provide a kind of computer equipment, including memory, processor and are stored in institute The computer program that can be run in memory and on the processor is stated, the processor executes real when the computer program Now as described in relation to the first aspect the test method of distributed system the step of.
Fourth aspect, the embodiment of the present invention provide a kind of computer readable storage medium, the computer-readable storage medium Matter is stored with computer program, and distributed system as described in relation to the first aspect is realized when the computer program is executed by processor The step of test method.
In the test method of distributed system provided in an embodiment of the present invention, device, computer equipment and storage medium, After obtaining distributed system test request, sentenced by I/O mouthfuls of quantity of target and target detection time of target detection module Whether disconnected target detection module has enough idle I/O mouthfuls to carry out corresponding test assignment within the target detection time. Do not have enough idle I/O mouthfuls in the target detection time when carrying out corresponding test assignment, to pass through the corresponding sky of display The mode of not busy period is reminded, so that user can intuitively select the suitable testing time, to successfully carry out The test of distributed system improves the convenience of distributed system test.Pass through the communication link of take over target detection module Mode, test system can save the time spent in test process in environmental preparation with simulation distribution formula system environments, Also save a large amount of machine resources simultaneously.Target detection module is tested based on target detection type again, is improved point The testing efficiency of cloth system.
Description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below by institute in the description to the embodiment of the present invention Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the present invention Example, for those of ordinary skill in the art, without having to pay creative labor, can also be according to these attached drawings Obtain other attached drawings.
Fig. 1 is a flow chart of the test method of the distributed system in the embodiment of the present invention 1;
Fig. 2 is a flow chart of a specific implementation mode of step S40 in Fig. 1;
Fig. 3 is a flow chart of another specific implementation mode of step S40 in Fig. 1;
Fig. 4 is a flow chart of a specific implementation mode of step S51 in Fig. 3;
Fig. 5 is a flow chart of another specific implementation mode of step S51 in Fig. 3;
Fig. 6 is a schematic diagram of the test device of the distributed system provided in the embodiment of the present invention 2;
Fig. 7 is a schematic diagram of the computer equipment provided in the embodiment of the present invention 4.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation describes, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, the every other implementation that those of ordinary skill in the art are obtained without creative efforts Example, shall fall within the protection scope of the present invention.
Embodiment 1
Fig. 1 shows the flow chart of the test method of distributed system in the present embodiment.The test method of the distributed system It applies among various terminals or system, to solve the test method convenience of existing distributed system and inefficient Problem.As shown in Figure 1, the test method of the distributed system includes the following steps that (illustratively, the embodiment is using a test System executes following steps):
S10:Distributed system test request is obtained, distributed system test request includes target detection module, target survey Try type and target detection time.
Wherein, distributed system test request refers to the initiation request tested distributed system.Distributed system Include multiple modules, when needing to test some module therein, a distributed system test request can be triggered. Distributed system test request includes target detection module, target detection type and target detection time.Wherein, target detection mould Block is for being directed toward or identifying module that needs to be tested in distributed system.And target detection type refers to for distributed system The specific test-types of target detection module that needs to be tested, target detection type may include in system:Performance test, can By property test, pressure test or functional test etc..And the target detection time refers to preset need in distributed system Time for being tested of target detection module.Optionally, the target detection time includes initial time and end time, alternatively, The target detection time includes initial time and test time.
S20:The communicating link data of target detection module is obtained, communicating link data includes I/O mouthfuls of quantity of target.
Wherein, the physical channel in network between two nodes is known as communication link.Communicating link data is for weighing The data communicated between target detection module and other modules.I/O mouthfuls of quantity of target refer to for the target detection mould Block carries out testing required I/O mouthfuls of quantity.Specifically, it can be determined according to the quantity of the communication link of target detection module Corresponding target I/O mouthfuls of quantity.In a specific embodiment, target I/O mouthfuls of quantity can be equal to target detection module The quantity of communication link.Optionally, in order to improve testing efficiency, I/O mouthfuls of quantity of target can also be more than target detection module The quantity of communication link.
S30:If target I/O mouthfuls of quantity is greater than or equal to I/O mouthfuls of quantity of free time within the target detection time, obtains and show Show that idle I/O mouthfuls of quantity is greater than or equal to the free time section of I/O mouthfuls of quantity of target.
Judge idle I/O of the test system within the target detection time according to target detection time and target I/O quantity Whether mouth quantity meets the requirements.If target I/O mouthfuls of quantity is more than I/O mouthfuls of quantity of free time within the target detection time, illustrate In the target detection time, the test system not enough idle I/O mouthfuls supports the distributed system test request.At this point, It obtains and I/O mouthfuls of quantity of free time, should with basis more than or equal to the free time section of I/O mouthfuls of quantity of target in display measurement system Free time section adjusts the time tested the distributed system.
Preferably, the sky in test system in different time sections can be embodied by establishing I/O mouthfuls of free time tables Not busy I/O mouthfuls of quantity.Specifically, the I/O mouthfuls of free time table includes time interval and corresponding I/O mouthfuls of quantity of free time.Wherein, when Between section can be divided according to the difference of idle I/O mouthfuls of quantity.For example, for 24 hours, it is assumed that total I/O in test system Mouth quantity is 20.If 8:00-10:Between 00,15 I/O mouthful are occupied there are one test request, and the interior survey of other times Idle I/O mouthfuls of quantity of test system are 20.Then time interval can be divided by the I/O mouthfuls of free time table:[00:00,8: 00]、[8:00,10:00] and [10:00,24:00], in this way, corresponding I/O mouthfuls of free time table can be:
One I/O mouthfuls of free time table of table
It can be visually known the corresponding free time in different time intervals by I/O mouthfuls of free time tables shown in table one I/O mouthfuls of quantity.If for example, in distributed system test request, I/O mouthfuls of quantity of target of target detection module are 10, and target Testing time is 9:00-11:00.At this point, test system can obtain and show that idle I/O mouthfuls of quantity is greater than or equal to 10 skies Not busy period, i.e., [00:00,8:00] and [10:00,24:00].
S40:The adjustment testing time is obtained, if present system time reaches adjustment testing time, take over target detection mould The communication link of block tests target detection module based on target detection type.
After showing that idle I/O mouthfuls of quantity is greater than or equal to free time section of I/O mouthful quantity of target, user can be with The target detection time is adjusted according to free time section, is greater than or equal to the sky of I/O mouthfuls of quantity of target in idle I/O mouthfuls of quantity Select a predetermined time section as the adjustment testing time within the not busy period, when test system obtains adjustment test immediately Between.
Present system time refers to the time that system is currently shown, and present system time reach adjustment the testing time it is specific It can refer to the initial time that present system time reaches the adjustment testing time.If present system time reaches adjustment test Between, then the communication link of take over target detection module, tests target detection module based on target detection type.
The communication link of take over target detection module refers to being communicated between take over target detection module and other modules Each communication link.Specifically, taking over (with take over client and service for communication link can be realized in the following way For the communication link at device end):A module is inserted between client and server.First, the module simulation server End starts identical port and is monitored;Then, the connection request that client is sent out is intercepted and captured, and establishes connection, at this moment the module It is server end for client, can so obtains the data packet that client sends over;Meanwhile in module The address at configuration server end sends connection request when having received the data packet that client sends over to server end, and Connection is established, the module is exactly client for server end at this time;Finally, the module from client receiving Data forward a packet to server end.After the complete request of server-side processes, returned data packet is sent out in the connection established by front Give client.The take over work of a communication link is just completed through the above steps, while can also be realized in link The control of communication data.
After the communication link for having taken over target detection module, so that it may to be based on target detection type to target detection mould Block is tested.By taking over for the communication link to target detection module, test system can simulate the distributed system ring Border saves the time spent in test process in environmental preparation, while also saving a large amount of machine resources.Target is surveyed The detailed process that die trial block is tested can be set according to the difference of target detection type.
Preferably, after obtaining the adjustment testing time, further include:Generate corresponding adjustment test assignment.Wherein, it adjusts Test assignment refers to the test assignment being adjusted the target detection time, and a distributed system test request just corresponds to a survey Trial is engaged in.It includes adjustment I/O mouthfuls of quantity of testing time and target to adjust test assignment.After generating adjustment test assignment, root I/O mouthfuls of free time tables are updated according to adjustment test assignment.I/O mouthfuls of free time tables are updated in real time by this mode, It ensure that the accuracy of I/O mouthfuls of free time tables.
In the test method of distributed system provided in this embodiment, after obtaining distributed system test request, lead to It looks over so as to check and marks I/O mouthfuls of quantity of target and the target detection time of test module to judge target detection module within the target detection time Whether there are enough idle I/O mouthfuls to carry out corresponding test assignment.Do not have enough skies within the target detection time Not busy I/O mouthfuls come when carrying out corresponding test assignment, is reminded by way of showing corresponding free time section, so as to Family can intuitively select the suitable testing time, to successfully carry out the test of distributed system, improve test just Victory.By way of the communication link of take over target detection module, test system can be saved with simulation distribution formula system environments The time in environmental preparation is spent in test process, while also saving a large amount of machine resources.It is based on target detection again Type tests target detection module, improves the testing efficiency of distributed system.
In a specific embodiment, in the communicating link data for obtaining target detection module, communicating link data packet After the step of including I/O mouthfuls of quantity of target, the test method of distributed system further includes:
If target I/O mouthfuls of quantity is less than I/O mouthfuls of quantity of free time within the target detection time, reach in present system time When the target detection time, the communication link of take over target detection module carries out target detection module based on target detection type Test.
If target I/O mouthfuls of quantity is less than I/O mouthfuls of quantity of free time within the target detection time, illustrate in the target detection time Built-in test system is that have enough idle I/O mouthfuls to support the distributed system test request, therefore can be in current system Between the communication link of target detection module is taken over when reaching the target detection time, and based on target detection type to target Test module is tested.The detailed process that target detection module is tested can according to the difference of target detection type and It is set.
Preferably, if target I/O mouthfuls of quantity is less than I/O mouthfuls of quantity of free time within the target detection time, target survey is generated Trial is engaged in.Wherein, target detection task refers to the test assignment generated based on distributed system test request.Target detection is appointed Business includes I/O mouthfuls of quantity of target detection time and target.And I/O mouthfuls of free time tables are updated according to target detection task.Pass through This mode is in real time updated I/O mouthfuls of free time tables, ensure that the accuracy of I/O mouthfuls of free time tables.
In this embodiment, I/O mouthfuls of quantity of target are not more than I/O mouthfuls of current idle within the acquisition target detection time After the result of quantity, distributed system is tested according to the corresponding target detection time, and to I/O mouthfuls of free times Table carries out real-time update, ensure that the convenience and accuracy of distributed system test.
In a specific embodiment, the communication link of take over target detection module, as shown in Fig. 2, specifically include with Lower step:
S41:Port snoop is started to target detection module.
Port snoop refers to a kind of information record operated by terminal/module.In a distributed system, target detection mould Block, which needs to establish with corresponding up-stream module and downstream mold each module in the block, to be communicated to connect.Therefore for therein every One module, which is required for starting corresponding port, to be monitored, and establishes the mapping relations between port and purpose module.Wherein, Purpose module refers to the respective modules that target detection module will establish communication connection.Up-stream module and downstream module are surveyed with target On the basis of die trial block, the mode of its relating module is distinguished according to the flow direction of communication data.Number is communicated in target detection module Module according to the upstream of flow direction is up-stream module, and the module in the downstream of target detection module communication data flow direction is downstream mold Block.The detailed process of step S41 is as follows:
(1) the port number N for needing to monitor is determined.
Determine that the port number N that needs are monitored optionally needs to monitor by the communicating link data of target detection module I/O mouthfuls of quantity of port number N and target it is identical.Preferably, the port number N monitored in determining needs can pass through LISTEN_NUM To realize.For example, the port number if desired monitored is 5, then configuration information can be:#define LISTEN_NUM 5.
(2) mapping relations of port and the ip and port of purpose module are established.
By establishing the mapping relations of port and the ip and port of purpose module, to establish target detection module and upstream mould Data communication between block or target detection module and downstream module.Wherein, in the ip and port for establishing port and purpose module Mapping relations when, purpose module must be consistent with the ip and port of corresponding up-stream module or downstream module, otherwise, Wu Fajian Vertical contact between target detection module and up-stream module or target detection module and downstream module.Specifically, it is each port Configure ip the and port information of corresponding purpose module, and ip the and port information of the purpose module of each port and the port pair Ip the and port information of the up-stream module or downstream module answered is identical.
(3) start port snoop, wait for the Connection Service of up-stream module.
After the foundation of the mapping relations of port and the ip and port of purpose module finishes, just starts port snoop, carry out Port snoop task in real time waits for the Connection Service of up-stream module and then triggers corresponding process.
S42:It is established between target detection module and up-stream module based on idle I/O mouthfuls and target detection module and downstream Communication link between module.
Wherein, communication link establishment of connection, including both sides connection:(1) receive the connection request of up-stream module, and It establishes and connects with up-stream module;(2) connection request is sent out to corresponding downstream module, and establishes and connects with corresponding downstream module It connects.
When establishing connection with up-stream module, target detection module is equivalent to server end, and up-stream module is equivalent to client End.After target detection module establishes connection with up-stream module, a handle fd1 will produce.When establishing connection with downstream module, Target detection module is the equal of client, by carrying out the mapping relations established in system snoop procedure online, according to Port finds the ip and port of purpose module, is initiated the connection to corresponding downstream module, generates handle upon establishment of a connection fd2.By establishing the connection of these two aspects, contact can be established between up-stream module and downstream module, and then realize mould The effect of quasi- upstream and downstream communication link.
Specifically, it is established between target detection module and up-stream module by idle I/O mouthfuls and target detection module Communication link between downstream module.Optionally, a corresponding communication link is established using I/O mouthfuls of a free time.For example, If being communicated between target detection module and 1 up-stream module and target detection module and 5 downstream modules, can adopt Target detection module and 1 up-stream module and target detection module and 5 downstream modules are established respectively with 6 I/O mouthfuls of free time Between communication link.
In this embodiment, by starting port snoop, the quantity of purpose module for needing to take over and right is determined After the ip and port of each purpose module answered, based on idle I/O mouthfuls establish between target detection module and up-stream module with And the communication link between target detection module and downstream module, facilitate the forwarding and recording of subsequent communication data, ensure that The accuracy and efficiency that communication link is taken over.
In a specific embodiment, target detection module is tested based on target detection type, such as Fig. 3 institutes Show, specifically includes following steps:
S51:Based on target detection type, the communication data of target detection module is recorded.
For different target detection types, the communication data of required recording is different.To target detection Under the premise of the communication link of module takes over, it is based on target detection type, corresponding communication data is selected to be recorded.Tool Body, according to different target detection types, selects different test datas to be inputted, to trigger between different modules Data interaction, and record corresponding communication data using the I/O mouths for having taken over corresponding communication link.
In the communication data for needing to record, includes the data of both direction, i.e., be sent to test system from up-stream module Request data and the response data of test system is returned to from downstream module, so can be to different directions in data recording Data be identified, and recorded respectively.
Specifically, recording the process of the communication data of target detection module can be:Test system is getting upstream mould After the request data that block is sent, the request data is identified and preserves, and the request data is forwarded to corresponding downstream module In.Downstream module can respond the request data, and carry out relevant processing, locate after receiving corresponding request data After reason is completed, downstream module can return to corresponding response data.Test system banner simultaneously preserves the response data, and should Response data is forwarded in corresponding up-stream module.Through the above steps, that is, it realizes and downstream module is sent to up-stream module Request data and downstream module return to the recording respectively of the response data of up-stream module.
In a specific embodiment, the communication data for recording target detection module further includes turning to communication data Hair.When corresponding communication link is established and connected, two handles fd1 and fd2 are will produce.Such as:By idle I/O mouthfuls of A and upper Module connection is swum, handle fd1 is generated.It is connected with up-stream module by idle I/O mouthfuls of B, generates handle fd2.The two handles are all There are corresponding read/write events, it is possible to the forwarding of communication data is realized using the two handles.Specific communication data Forwarding steps are as follows:
(1) handle fd1 is read out:After idle I/O mouthfuls of A establishes connection with up-stream module, handle fd1 is read out Operation, with from up-stream module read requests data.
(2) handle fd2 is written:For the request data read from up-stream module, pass through idle I/O mouthfuls of B's Handle fd2 writes in downstream module.
(3) handle fd2 is read out:Downstream module is returned after receiving corresponding request data and having handled request It returns in corresponding response data to handle fd2, handle fd2 is read at this time, read number of responses from downstream module According to.
(4) handle fd1 is written:By carrying out response of the write operation to return to downstream module to handle fd1 Data forwarding is to up-stream module.
S52:Target detection module is tested based on communication data, obtains test result.
According to target detection type and corresponding communication data is selected to test target detection module, obtains test knot Fruit.For example, if test-types are performance test, pressure survey tool and the up-stream module recorded can be used to issue target survey The communication data of die trial block applies pressure to tested module, and the operating status of monitoring objective test module and properties refer to Mark, and analyzed, finally obtain test result.Wherein, pressure survey tool refers to the tool for carrying out pressure test.
In this embodiment, the corresponding communication data of target detection module is recorded according to target detection type, and Target detection module is tested according to the communication data of recording, obtains test result.Ensureing distributed system test Convenience while, do not need simulation distribution formula system environments, save spent in test process in environmental preparation when Between, while a large amount of machine resources are also saved, improve the testing efficiency of distributed system.
In a specific embodiment, it is based on target detection type, the communication data of target detection module is recorded, such as schemes Shown in 4, following steps are specifically included:
S511:If target detection type is performance test, send in test data to up-stream module.
Wherein, performance test is to simulate a variety of normal, peak values and abnormal load conditions by the testing tool of automation To test the property indices of system.Load testing and pressure test belong to performance test, and the two can combine It carries out.By load testing, determines the performance of the system under various workloads, that is, test when load gradually increases, system The situation of change of property indices.Pressure test is the bottleneck or unacceptable performance point by a determining system, To obtain the test for the maximum service rank that system can provide.
It sends and pressure survey tool upstream module application pressure may be used in test data to up-stream module.Wherein, pressure is surveyed Tool refers to the tool for carrying out pressure test.And pressure test is to simulate hardware environment and the user's use of practical application The system loading of process, for a long time or super large load ground testing results software, to test the performance of system under test (SUT), reliability and steady It is qualitative etc..Specifically, Webbench, Siege or Http_load equipressure may be used and survey tool upstream module application pressure.
S512:Recording up-stream module is sent to the upstream communication data of target detection module and downstream module returns to target The downstream communication data of test module.
After sending test data to up-stream module, up-stream module is based on test data and sends corresponding upstream communication number According to in target detection module, which is recorded.Specifically, which can be saved in In corresponding upstream communication data file.Target detection module, can be to the upstream communication after receiving upstream communication data Data are responded, and carry out relevant processing, after processing is completed, can be sent data in corresponding downstream module, downstream Module can correspondingly return in downstream communication data to target detection module, be recorded to the downstream communication data.Specifically, The downstream communication data can be saved in corresponding downstream communication data file.
In a specific embodiment, the communication data for recording target detection module further includes turning to communication data Hair.Specific forwarding step is similar with the forwarding of communication data in step S51, and details are not described herein.
In this embodiment, by sending test data to up-stream module, to trigger between disparate modules into It communicates to row data, the recording of data is completed while realizing data forwarding, the data during follow-up test is facilitated to obtain It takes, saves a large amount of machine resources, improve the convenience and efficiency of distributed system test.
In a specific embodiment, it is based on target detection type, the communication data of target detection module is recorded, such as schemes Shown in 5, following steps are specifically included:
S511’:If target detection type is reliability test, the injection network abnormality test logic into communication link, And scheduled link in communication link is controlled by control command and is interacted.
Wherein, reliability test is software systems before the deadline and under defined environmental condition, completes regulation The ability of function.Under normal circumstances, its reliability is measured by being tested software systems.Usually, pass through following two Kind of mode measures its reliability:(1) under prescribed conditions, it is specified that in the time, software does not cause the probability of thrashing;(2) Within period stipulated time, the ability of required function is executed in predefined conditions.
In reliability test, Network Abnormal test logic is injected into the communication link that test system is taken over, and lead to Crossing the mode that scheduled link interacts in control command control communication link goes test respectively to be communicated under network abnormal situation The interaction data of link, to achieve the purpose that realize reliability test.Wherein, Network Abnormal test logic refers to specific The test logic that network parameter is modified and is monitored to key node.For example, the ability of load-balancing of distributed system Be largely fixed the reliability of system, for the test of system load balancing, including the equilibrium of the node visit frequency and The test of two dimensions of equilibrium of node amount of communication data.In the test of visitation frequency equilibrium, can in source code pitching pile Some identification informations are implanted into, by sending pressure and counting these marks come the frequency of each node visit of analysis system.It is saving In the test of point amount of communication data equilibrium, by recording each server network interface card performance data when sending pressure, network interface card is analyzed Whether energy data are uniform to test hot spot data dispersion.
Specifically, the injection of Network Abnormal test logic can be realized by using hook technologies.It replaces by ranging The function called in sequence, implantation include the function of test logic.There are mainly of two types for the function being wherein replaced:
(1) functions such as strcmp, fopen in GNU C java standard libraries are directed to, write corresponding API, and be compiled into so Dynamic base specifies the loading priority of so dynamic bases by the way that LD_PRELOAD environmental variances are arranged, to reach the original mark of covering The purpose of quasi- library API.
(2) it is directed to user-defined function, operation at the API comprising test logic is jumped to by changing symbol table, Different test logics is encapsulated in so file, is loaded into using tool to control.
In this embodiment, abnormality test logic is increased newly by mechanism of so, code general geological coodinate system is high, avoids frequent Update and adjustment, and while forwarding communication data packet, communication data can be easily recorded, can directly it meet reliable The application demand of data recording and test in property test process.
In the communication link taken over after injection network abnormality test logic, controlled in communication link by control command Scheduled link interacts.For example, control command can be presented as that control targe test module continues to each downstream module Send communication data or by press survey tool upstream module send pressure, and by the Network Abnormal test logic of injection come Modification network parameter simultaneously monitors key node in real time.
S512’:It records interaction data packet interactive between scheduled link in communication link and is tested by Network Abnormal The abnormality test data packet of logic.
In this step, the recording process and step of interaction data packet interactive between scheduled link in communication link Rapid S512 is similar, and details are not described herein.And in reliability test when carrying out data recording, it is also necessary to different by network The abnormality test data packet of normal test logic is recorded and is kept separately divides for the reliability to distributed system Analysis.
If for example, pitching pile is implanted into some identification informations in source code, can hand between scheduled link in a communication link These frequencys for identifying and then carrying out each node visit of analysis system are counted when mutually.In the test of data volume equilibrium, by Each server network interface card performance data transmission situation is recorded when sending pressure, analysis network interface card performance data is disperseed to test hot spot data Whether uniformly.Further, it can be analyzed by recording the interaction data packet of interaction between scheduled link in communication link Whether network exchange, data out of order or data tampering situations such as will appear when Network Abnormal.
In this embodiment, by the injection network abnormality test logic into communication link, and pass through control command Scheduled link interacts in control communication link, and records corresponding data packet, is preferably carried out in order to subsequently reliable Property test, improve distributed system test convenience.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit It is fixed.
Embodiment 2
Fig. 6 shows the test device with the one-to-one distributed system of the test method of distributed system in embodiment 1 Functional block diagram.As shown in fig. 6, the test device of the distributed system include distributed system test request acquisition module 10, Communicating link data acquisition module 20, free time section acquisition module 30 and adjustment test module 40.Wherein, distributed system is surveyed Try acquisition request module 10, communicating link data acquisition module 20, free time section acquisition module 30 and adjustment test module 40 Corresponding with the test method of distributed system in embodiment 1 step of realization function correspond, to avoid repeating, this implementation Example is not described in detail one by one.
Distributed system test request acquisition module 10, for obtaining distributed system test request, distributed system is surveyed Examination request includes target detection module, target detection type and target detection time.
Communicating link data acquisition module 20, the communicating link data for obtaining target detection module, communication chain way According to including I/O mouthfuls of quantity of target.
Free time section acquisition module 30, if being used for the target I/O mouthfuls of quantity within the target detection time is greater than or equal to sky Not busy I/O mouthfuls of quantity then obtains and shows that idle I/O mouthfuls of quantity is greater than or equal to the free time section of I/O mouthfuls of quantity of target.
Test module 40 is adjusted, for obtaining the adjustment testing time, if present system time reaches the adjustment testing time, The communication link of take over target detection module tests target detection module based on target detection type.
Preferably, the test device of the distributed system further includes target detection module 50.
Target detection module 50, if being used for the target I/O mouthfuls of quantity within the target detection time is less than I/O mouthfuls of quantity of free time, Then when present system time reaches the target detection time, the communication link of take over target detection module is based on target detection class Type tests target detection module.
Preferably, adjustment test module 40 includes that port snoop unit 41 and communication link establish unit 42.
Port snoop unit 41, for starting port snoop to target detection module.
Communication link establishes unit 42, for be based on idle I/O mouthfuls establish between target detection module and up-stream module with And the communication link between target detection module and downstream module.
Preferably, adjustment test module 40 further includes communication data recording elements 51 and test result acquiring unit 52.
Communication data recording elements 51 record the communication data of target detection module for being based on target detection type.
Test result acquiring unit 52 tests target detection module for being based on communication data, obtains test knot Fruit.
Preferably, communication data recording elements 51 include:Test data transmission sub-unit 511 and performance test data are recorded Subelement 512.
Test data transmission sub-unit 511 sends test data to upper if being performance test for target detection type It swims in module.
Performance test data records subelement 512, and the upstream that target detection module is sent to for recording up-stream module leads to Letter data and downstream module return to the downstream communication data of target detection module.
Preferably, communication data recording elements 51 further include:Interaction data transmission sub-unit 511 ' and reliability test number According to recording subelement 512 '.
Interaction data transmission sub-unit 511 ', if being reliability test for target detection type, into communication link Injection network abnormality test logic, and scheduled link in communication link is controlled by control command and is interacted.
Reliability Test Data records subelement 512 ', the friendship for recording interaction between scheduled link in communication link Mutual data packet and the abnormality test data packet Jing Guo Network Abnormal test logic.
Preferably, in target detection module 50, the communication link of take over target detection module is based on target detection type pair Specific implementation unit/subelement that target detection module is tested is consistent with adjustment test module 40, and details are not described herein.
Embodiment 3
The present embodiment provides a computer readable storage medium, computer journey is stored on the computer readable storage medium Sequence realizes the test method of distributed system in embodiment 1 when the computer program is executed by processor, to avoid repeating, this In repeat no more.Alternatively, being realized when the computer program is executed by processor in embodiment 2 in the test device of distributed system The function of each module/unit, to avoid repeating, which is not described herein again.
It is to be appreciated that the computer readable storage medium may include:The computer program code can be carried Any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic disc, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal and telecommunications letter Number etc..
Embodiment 4
Fig. 7 is the schematic diagram for the computer equipment that one embodiment of the invention provides.As shown in fig. 7, the calculating of the embodiment Machine equipment 60 includes:Processor 61, memory 62 and it is stored in the calculating that can be run in memory 62 and on processor 61 Machine program 63.Processor 61 realizes the step of the test method of distributed system in above-described embodiment 1 when executing computer program 63 Such as step S10 to S40 shown in FIG. 1 suddenly,.Alternatively, processor 61 is realized when executing computer program 63 in above-described embodiment 2 The function of each module/unit in the test device of distributed system, such as the acquisition module of distributed system test request shown in Fig. 6 10, communicating link data acquisition module 20, free time section acquisition module 30 and the function of adjusting test module 40.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each work( Can unit, module division progress for example, in practical application, can be as needed and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device are divided into different functional units or module, more than completion The all or part of function of description.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although with reference to aforementioned reality Applying example, invention is explained in detail, it will be understood by those of ordinary skill in the art that:It still can be to aforementioned each Technical solution recorded in embodiment is modified or equivalent replacement of some of the technical features;And these are changed Or replace, the spirit and scope for various embodiments of the present invention technical solution that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of test method of distributed system, which is characterized in that include the following steps:
Distributed system test request is obtained, the distributed system test request includes target detection module, target detection class Type and target detection time;
The communicating link data of the target detection module is obtained, the communicating link data includes I/O mouthfuls of quantity of target;
If the target I/O mouthfuls of quantity is greater than or equal to I/O mouthfuls of quantity of free time within the target detection time, obtains and show Show that idle I/O mouthfuls of quantity is greater than or equal to the free time section of the target I/O mouthfuls of quantity;
The adjustment testing time is obtained, if present system time reaches the adjustment testing time, takes over the target detection module Communication link tests the target detection module based on the target detection type.
2. the test method of distributed system as described in claim 1, which is characterized in that obtain the target detection described The communicating link data of module, the communicating link data include the steps that the distributed system after I/O mouthfuls of quantity of target Test method further include:
If the target I/O mouthfuls of quantity is less than I/O mouthfuls of quantity of free time within the target detection time, in present system time When reaching the target detection time, the communication link of the target detection module is taken over, is based on the target detection type pair The target detection module is tested.
3. the test method of distributed system as claimed in claim 1 or 2, which is characterized in that described to take over the target survey The communication link of die trial block, specifically includes following steps:
Port snoop is started to target detection module;
It is established between the target detection module and up-stream module based on idle I/O mouthfuls and the target detection module and downstream Communication link between module.
4. the test method of distributed system as claimed in claim 3, which is characterized in that described to be based on the target detection class Type tests the target detection module, includes the following steps:
Based on target detection type, the communication data of target detection module is recorded;
Target detection module is tested based on the communication data, obtains test result.
5. the test method of distributed system as claimed in claim 4, which is characterized in that it is described to be based on target detection type, The communication data for recording target detection module, includes the following steps:
If the target detection type is performance test, send in test data to up-stream module;
Recording up-stream module is sent to the upstream communication data of target detection module and downstream module returns to target detection module Downstream communication data.
6. the test method of distributed system as claimed in claim 4, which is characterized in that it is described to be based on target detection type, The communication data for recording target detection module, includes the following steps:
If the target detection type is reliability test, the injection network abnormality test logic into the communication link, and Scheduled link in the communication link is controlled by control command to interact;
Record interaction data packet interactive between scheduled link in the communication link and by Network Abnormal test logic Abnormality test data packet.
7. a kind of test device of distributed system, which is characterized in that including:
Distributed system test request acquisition module, for obtaining distributed system test request, the distributed system test Request includes target detection module, target detection type and target detection time;
Communicating link data acquisition module, the communicating link data for obtaining the target detection module, the communication link Data include I/O mouthfuls of quantity of target;
Free time section acquisition module, if within the target detection time target I/O mouthfuls of quantity be greater than or equal to Idle I/O mouthfuls of quantity then obtains and shows that idle I/O mouthfuls of quantity is greater than or equal to the free time of the target I/O mouthfuls of quantity Section;
Test module is adjusted, for obtaining the adjustment testing time, if present system time reaches the adjustment testing time, takes over institute The communication link for stating target detection module tests the target detection module based on the target detection type.
8. the test device of distributed system as claimed in claim 7, which is characterized in that the adjustment test module, including:
Port snoop unit, for starting port snoop to target detection module;
Communication link establishes unit, for be based on idle I/O mouthfuls establish between the target detection module and up-stream module and Communication link between the target detection module and downstream module.
9. a kind of computer equipment, including memory, processor and it is stored in the memory and can be in the processor The computer program of upper operation, which is characterized in that the processor realized when executing the computer program as claim 1 to The step of test method of any one of 6 distributed systems.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, feature to exist In the test side of realization distributed system as described in any one of claim 1 to 6 when the computer program is executed by processor The step of method.
CN201810239756.XA 2018-03-22 2018-03-22 Test method, device, computer equipment and the storage medium of distributed system Pending CN108563562A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810239756.XA CN108563562A (en) 2018-03-22 2018-03-22 Test method, device, computer equipment and the storage medium of distributed system
PCT/CN2018/091911 WO2019178957A1 (en) 2018-03-22 2018-06-20 Distributed system test method and device, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810239756.XA CN108563562A (en) 2018-03-22 2018-03-22 Test method, device, computer equipment and the storage medium of distributed system

Publications (1)

Publication Number Publication Date
CN108563562A true CN108563562A (en) 2018-09-21

Family

ID=63532062

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810239756.XA Pending CN108563562A (en) 2018-03-22 2018-03-22 Test method, device, computer equipment and the storage medium of distributed system

Country Status (2)

Country Link
CN (1) CN108563562A (en)
WO (1) WO2019178957A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109829014A (en) * 2019-01-03 2019-05-31 平安科技(深圳)有限公司 The method and device that test data obtains
CN111159030A (en) * 2019-12-24 2020-05-15 联想(北京)有限公司 Program testing method, device, equipment and storage medium
CN111382056A (en) * 2018-12-29 2020-07-07 北京字节跳动网络技术有限公司 Service testing method and device, server and storage medium
CN111694724A (en) * 2019-03-15 2020-09-22 百度在线网络技术(北京)有限公司 Testing method and device of distributed table system, electronic equipment and storage medium
CN113254328A (en) * 2021-04-29 2021-08-13 厦门国际银行股份有限公司 White box testing method, system, mobile terminal and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101933001A (en) * 2008-01-31 2010-12-29 雅虎公司 Executing software performance test jobs in a clustered system
CN102214139A (en) * 2011-06-01 2011-10-12 北京航空航天大学 Automatic test performance control and debugging method facing distributed system
CN104781682A (en) * 2012-10-20 2015-07-15 爱德万测试公司 Pseudo tester-per-site functionality on natively tester-per-pin automatic test equipment for semiconductor test

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2348418A1 (en) * 2009-12-18 2011-07-27 Siemens Aktiengesellschaft Multi trace parser
CN105511936B (en) * 2014-09-22 2020-04-24 北京奇虎科技有限公司 Test system, method and device
CN107577602A (en) * 2017-08-25 2018-01-12 上海斐讯数据通信技术有限公司 A kind of method of testing of APP interfaces, apparatus and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101933001A (en) * 2008-01-31 2010-12-29 雅虎公司 Executing software performance test jobs in a clustered system
CN102214139A (en) * 2011-06-01 2011-10-12 北京航空航天大学 Automatic test performance control and debugging method facing distributed system
CN104781682A (en) * 2012-10-20 2015-07-15 爱德万测试公司 Pseudo tester-per-site functionality on natively tester-per-pin automatic test equipment for semiconductor test

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111382056A (en) * 2018-12-29 2020-07-07 北京字节跳动网络技术有限公司 Service testing method and device, server and storage medium
CN111382056B (en) * 2018-12-29 2024-02-02 北京字节跳动网络技术有限公司 Service testing method and device, server and storage medium
CN109829014A (en) * 2019-01-03 2019-05-31 平安科技(深圳)有限公司 The method and device that test data obtains
CN109829014B (en) * 2019-01-03 2024-01-23 平安科技(深圳)有限公司 Method and device for acquiring test data
CN111694724A (en) * 2019-03-15 2020-09-22 百度在线网络技术(北京)有限公司 Testing method and device of distributed table system, electronic equipment and storage medium
CN111159030A (en) * 2019-12-24 2020-05-15 联想(北京)有限公司 Program testing method, device, equipment and storage medium
CN111159030B (en) * 2019-12-24 2022-02-18 联想(北京)有限公司 Program testing method, device, equipment and storage medium
CN113254328A (en) * 2021-04-29 2021-08-13 厦门国际银行股份有限公司 White box testing method, system, mobile terminal and storage medium
CN113254328B (en) * 2021-04-29 2022-08-09 厦门国际银行股份有限公司 White box testing method, system, mobile terminal and storage medium

Also Published As

Publication number Publication date
WO2019178957A1 (en) 2019-09-26

Similar Documents

Publication Publication Date Title
CN108563562A (en) Test method, device, computer equipment and the storage medium of distributed system
CN104579822B (en) Mobile application automated performance testing system and method based on Http agreements
CN104765678B (en) The method and device tested the application on mobile terminal device
CN111190810B (en) Method, device, server and storage medium for executing test task
CN109416639B (en) Method, system, and computer readable medium for simulating network traffic patterns on a virtual machine
CN109302522A (en) Test method, device and computer system and medium
CN111611121B (en) Hardware simulation test method, device and equipment
CN110262274A (en) Smart home device control display methods and system based on Internet of Things operating system
CN105868105A (en) Application traversal testing method and device, and mobile terminal
CN109633351B (en) Intelligent IT operation and maintenance fault positioning method, device, equipment and readable storage medium
CN109218133A (en) Network speed testing system, method, apparatus and computer readable storage medium
CN110321273A (en) A kind of business statistical method and device
JP2010512126A (en) Apparatus and method for providing and providing an indication of communication events on a map
CN113672441B (en) Method and device for testing intelligent equipment
JP2015526700A (en) System and method for executing a user-defined instrument command sequence using multiple hardware and analysis modules
CN108717391A (en) Monitoring device, method and the computer readable storage medium of test process
CN110784374A (en) Method, device, equipment and system for monitoring operation state of service system
CN110502442A (en) Dynamic parameter method of calibration, device, equipment and storage medium
CN104683181B (en) A kind of method for monitoring performance, equipment and system
CN105988922B (en) Test method, device and the server of application program
CN107733710A (en) Construction method, device, computer equipment and the storage medium of link call relation
CN109726134A (en) Interface test method and system
CN109284227A (en) A kind of automation method for testing pressure and device calculate equipment and storage medium
CN108733545B (en) Pressure testing method and device
CN106951371A (en) A kind of semi-automatic method of testing of Android application based on dependence injection

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180921