CN111400171A - Interface testing method, system, device and readable storage medium - Google Patents

Interface testing method, system, device and readable storage medium Download PDF

Info

Publication number
CN111400171A
CN111400171A CN202010132541.5A CN202010132541A CN111400171A CN 111400171 A CN111400171 A CN 111400171A CN 202010132541 A CN202010132541 A CN 202010132541A CN 111400171 A CN111400171 A CN 111400171A
Authority
CN
China
Prior art keywords
interface
target
test
acquiring
distributed cluster
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.)
Granted
Application number
CN202010132541.5A
Other languages
Chinese (zh)
Other versions
CN111400171B (en
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010132541.5A priority Critical patent/CN111400171B/en
Publication of CN111400171A publication Critical patent/CN111400171A/en
Application granted granted Critical
Publication of CN111400171B publication Critical patent/CN111400171B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/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

Abstract

The invention discloses an interface testing method, which comprises the following steps: acquiring an interface linked list corresponding to a target distributed cluster; determining a target file according to the interface linked list; acquiring a test script corresponding to a target interface by using a target file; running a test script on the target distributed cluster so as to test a target interface; the method comprises the steps of obtaining interface information of a target distributed cluster by obtaining an interface linked list of the target distributed cluster, and determining and obtaining a test script required when the interface of the distributed cluster is tested by using a target file; the target interface of the target distributed cluster can be tested by running the test script on the target distributed cluster; the method can test the interface of the target distributed cluster so as to carry out deeper test work and find the problem of the interface function of the distributed storage system in time; in addition, the invention also provides an interface testing device, equipment and a computer readable storage medium, which also have the beneficial effects.

Description

Interface testing method, system, device and readable storage medium
Technical Field
The present invention relates to the field of distributed storage technologies, and in particular, to an interface testing method, an interface testing apparatus, an interface testing device, and a computer-readable storage medium.
Background
In the test work of the distributed storage system, a tester always performs black box test work of a service function, namely, a functional test is performed on the distributed storage system at an upper layer. Because the tester can not touch the corresponding interface of the distributed storage system and can not capture the corresponding interface, the tester can not carry out deeper interface test work and can not find the problem of the interface function of the distributed storage system. However, the interface test helps to cover a more comprehensive test project and helps in the test work of the distributed storage system. Therefore, the existing testing method has the problem that the interface testing cannot be carried out.
Therefore, how to solve the problem that the interface test cannot be performed in the existing test method is a technical problem to be solved by the technical personnel in the field.
Disclosure of Invention
In view of the above, the present invention provides an interface testing method, an interface testing device, an interface testing apparatus, and a computer readable storage medium, which solve the problem that the interface testing cannot be performed by the existing testing method.
In order to solve the above technical problem, the present invention provides an interface testing method, including:
acquiring an interface linked list corresponding to a target distributed cluster;
determining a target file according to the interface linked list;
acquiring a test script corresponding to a target interface by using the target file;
and running the test script on the target distributed cluster so as to test the target interface.
Optionally, the obtaining an interface linked list corresponding to the target distributed cluster includes:
acquiring and analyzing a test instruction to obtain project information and cluster type information;
determining the target distributed cluster according to the project information and the cluster type information;
and acquiring the interface linked list from the target distributed cluster according to a first preset path.
Optionally, the determining a target file according to the interface linked list includes:
acquiring an rmp upgrade package from an ftp server according to a second preset path, and acquiring a plurality of json files from the rmp upgrade package;
and performing matching verification on each json file and the interface linked list, and determining the json file passing the matching verification as the target file.
Optionally, the obtaining, by using the target file, a test script corresponding to a target interface includes:
loading and analyzing the target file by using JSONMapper to obtain parameters of each level corresponding to the target file;
and acquiring the test script corresponding to each level of parameter by using a preset corresponding relation.
Optionally, before the obtaining the test script corresponding to the target interface by using the target file, the method further includes:
and acquiring a selection instruction, and determining the target interface in the interface linked list according to the selection instruction.
Optionally, the method further comprises:
and acquiring a test result, and generating a test report by using the test result.
The present invention also provides an interface testing apparatus, comprising:
the link list acquisition module is used for acquiring an interface link list corresponding to the target distributed cluster;
the target file determining module is used for determining a target file according to the interface linked list;
the test script acquisition module is used for acquiring a test script corresponding to the target interface by using the target file;
and the test module is used for running the test script on the target distributed cluster so as to test the target interface.
Optionally, the linked list obtaining module includes:
the information acquisition unit is used for acquiring and analyzing the test instruction to obtain project information and cluster type information;
the cluster determining unit is used for determining the target distributed cluster according to the project information and the cluster type information;
and the linked list acquisition unit is used for acquiring the interface linked list from the target distributed cluster according to a first preset path.
The invention also provides an interface test device, comprising a memory and a processor, wherein:
the memory is used for storing a computer program;
the processor is used for executing the computer program to realize the interface testing method.
The present invention also provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the interface testing method described above.
The interface testing method provided by the invention obtains the interface linked list corresponding to the target distributed cluster; determining a target file according to the interface linked list; acquiring a test script corresponding to a target interface by using a target file; and running a test script on the target distributed cluster so as to test the target interface.
Therefore, the method can obtain the interface information of the target distributed cluster by obtaining the interface linked list of the target distributed cluster, and can determine and obtain the test script required by the interface test of the distributed cluster by using the target file corresponding to the interface linked list. And running the test script on the target distributed cluster to test the target interface of the target distributed cluster. The method can test the interface of the target distributed cluster so as to carry out deeper test work and find the problem of the interface function of the distributed storage system in time, and solves the problem that the interface test cannot be carried out in the existing test method.
In addition, the invention also provides an interface testing device, interface testing equipment and a computer readable storage medium, and the interface testing device, the interface testing equipment and the computer readable storage medium also have the beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of an interface testing method according to an embodiment of the present invention;
fig. 2 is a flowchart of a specific interface testing method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an interface testing apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an interface test apparatus according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a json file list according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a test report according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating an interface testing method according to an embodiment of the present invention. The method comprises the following steps:
s101: and acquiring an interface linked list corresponding to the target distributed cluster.
Part or all of the steps of the interface testing method provided by the invention can be completed by appointed equipment or terminals, for example, the interface testing method can be an appointed computer, and the computer is used for carrying out interface testing on the distributed cluster. The target distributed cluster may be any kind of distributed cluster, for example, may be a file cluster, or may be an object cluster, or may be a block cluster, or may be a triple cluster. The target distributed cluster can be selected at will, or can be selected according to actual needs, for example, a test instruction input by a tester can be obtained, and a cluster specified by the test instruction is determined as the target distributed cluster; or the selection information input by the tester can be acquired, the distributed clusters are screened according to the selection information, secondary selection is performed according to preset conditions after screening, and the finally selected distributed cluster is determined as the target distributed cluster.
The present inventors have made creative efforts to analyze logs of a distributed cluster, and to count and record possible interfaces according to information prefixed by API tags in a log file, and to extract information with API tag prefixes, such as API _ authTo L ogin, which actually represents a log interface and counts and records all extracted information.
The interface linked list may also be referred to as an interface list, and is used to record interface information of the target distributed cluster, where the specific content is not limited in this embodiment, and specifically, for example, interface names of each interface in the target distributed cluster may be recorded, or interface types of each interface may be recorded, or interface states of each interface may be recorded. In order to perform interface test on the target distributed cluster, it needs to determine which interfaces the target distributed cluster has through an interface chain table for subsequent operations. It should be noted that the generation process of the interface linked list is not limited in this embodiment, for example, after the target distributed cluster is constructed, a tester may fill the interface linked list according to the actual interface condition of the target distributed cluster, and store the interface linked list to the target distributed cluster; or after the target distributed cluster is constructed, the cluster automatically detects the interface of the cluster and generates an interface linked list according to the acquired information and the generation rule.
S102: and determining the target file according to the interface linked list.
And after the interface linked list is obtained, determining a corresponding target file according to the interface linked list. The target file is specifically a json file and is used for recording parameters of each level corresponding to the interface, the type and the number of the parameters specifically included in the parameters of each level are not limited in this embodiment, the parameters corresponding to different interfaces are different, and each interface corresponds to at least one json file. For example, some interfaces may correspond to multiple json files if their operating modes are different under different parameter settings. However, each interface has only one corresponding target file when performing interface testing, for example, when the interface a corresponds to three json files numbered 1, 2, and 3, and when the interface linked list records the interface a _1, the corresponding target file is the json file numbered 1; when an A _2 interface is recorded in the interface linked list, the corresponding target file is a json file with the serial number of 2; when the interface linked list records the a _3 interface, the corresponding target file is the json file with the number of 3.
It should be noted that the details of the parameter configuration of the interface need to be known in order to test the interface. In the embodiment of the invention, a code project, namely icfs _ code, is constructed by analyzing versions, and an interface file stored in a json file form exists in an update code directory. The target file is therefore the json file.
Further, after the version is built, the version is persistently stored on the ftp server in the form of an rpm upgrade package through an scp command and can be accessed at any time, so that the target file can be acquired from the ftp server. However, the json file is not all interface files, and the json file is determined as a target file by comparing the json file with the interface linked list, and the json file name is the same as the interface information in the interface linked list, and the parameter details of each interface are described in detail in the target file, that is, parameters of each level are recorded.
The target file is a json file corresponding to all or part of the interfaces recorded in the interface chain table, and when all the interfaces need to be tested, the target file is the json file corresponding to each interface in the interface chain table; when part of the interfaces need to be tested, the target files are json files corresponding to the tested interfaces respectively. The interfaces work under the setting of corresponding parameters, so that when the interfaces are tested, a target file needs to be determined, so that a proper test case or test script can be selected according to parameters of each level corresponding to each interface, and the interfaces are tested. It should be noted that the specific storage form and storage location of the target file are not limited in this embodiment, for example, a json file may be stored in a designated server, and after the interface linked list is acquired, the corresponding target file is acquired from the designated server.
S103: and acquiring a test script corresponding to the target interface by using the target file.
Test scripts are written and packaged in advance for automated testing of the interface. It should be noted that different interfaces correspond to different test scripts, different test scripts corresponding to different parameters at different levels are different, and different test scripts that need to be used when testing different functions of the unified interface are different, that is, different test scripts corresponding to different services are different, and different test scripts need to be used when testing functions such as interface opening and closing, interface adding and deleting, and interface permission changing. In addition, different test scripts can be packaged according to actual needs of the test flow, the test scene and the like, so that requirements on the aspects of the test flow, the test scene and the like can be met when the test script is selected.
The target interfaces are corresponding interfaces of each target file, which may be all interfaces in the interface chain table, or may be partial interfaces in the target chain table. In the embodiment of the invention, in order to ensure the integrity of the interface test work, after the target file is obtained, the test script corresponding to the target interface is obtained according to the parameters of each level recorded in the target file. In addition, the test scripts corresponding to the target interface may be screened for the second time according to other needs, which is not limited in this embodiment as long as the finally obtained test scripts correspond to the target interface.
S104: and running a test script on the target distributed cluster so as to test the target interface.
After the test script is obtained, the test script is run on the target distributed cluster so as to test the target interface, and the specific running process of the test script is not limited in this embodiment.
Furthermore, in order to efficiently comb the interface test work, the test interface is checked, and the problem of quick positioning is solved when an error occurs. Preferably, the embodiment acquires a test result, and generates a test report by using the test result. Referring to fig. 6, fig. 6 is a schematic diagram of a test report according to an embodiment of the invention. The test report can include cluster information, test script information, tested interface information, test process information and test results of the target distributed cluster, and the whole interface test process is comprehensively recorded, so that a tester can sort and summarize the interface test work according to the test report, check the test interface and quickly locate the problem when an error occurs.
By applying the interface testing method provided by the embodiment of the invention, the interface information of the target distributed cluster can be obtained by obtaining the interface linked list of the target distributed cluster, and the testing script required by the interface testing of the distributed cluster can be determined and obtained by using the target file corresponding to the interface linked list. And running the test script on the target distributed cluster to test the target interface of the target distributed cluster. The method can test the interface of the target distributed cluster so as to carry out deeper test work and find the problem of the interface function of the distributed storage system in time, and solves the problem that the interface test cannot be carried out in the existing test method.
Based on the above embodiments of the present invention, a specific interface test flow will be described in the embodiments of the present invention. Referring to fig. 2, fig. 2 is a flowchart of a specific interface testing method according to an embodiment of the present invention, including:
in the present embodiment, the S101 step includes three steps S1011, S1012, and S1013. In order to improve the reliability of the interface test, in this embodiment, when determining the target distributed cluster, secondary screening is performed in each distributed cluster that meets the requirement of the test instruction, and the target distributed cluster is determined, specifically:
s1011: and acquiring and analyzing the test instruction to obtain project information and cluster type information.
The test instruction is used for initiating an interface test, where the test instruction includes project information and cluster type information, the project information may include a research and development project, a field POC project, an L MT project, and the cluster type information includes a file cluster, an object cluster, a block cluster, a triple cluster, and the like.
S1012: and determining a target distributed cluster according to the project information and the cluster type information.
After the project information and the cluster type information are obtained, screening each cluster which can participate in the interface test by using the project information and the cluster type information, and determining a target distributed cluster in the distributed clusters obtained by screening. If a preset distributed cluster is determined as a target distributed cluster for interface testing, the reliability of the interface testing may be reduced due to the particularity of the distributed cluster, so in this embodiment, a random determination method may be adopted, for example, to determine the target distributed cluster at random among distributed clusters satisfying the project information and the cluster type information; or a polling selection method may be employed. In order to improve the test reliability, it should be noted that if there is only one distributed cluster satisfying the project information and the cluster type information, the distributed cluster is determined as the target distributed cluster.
S1013: and acquiring an interface linked list from the target distributed cluster according to a first preset path.
In this embodiment, the interface linked list corresponding to each distributed cluster is stored in the distributed cluster according to a first preset path, where the first preset path is a storage path of the interface linked list. For example, the first preset path may be/usr/bin, the interface linked list may be list _ interface, the target distributed cluster may be connected in an SSH remote connection manner, and the list _ interface is obtained under the/usr/bin, the interface linked list may be formed by interface names of each interface in the target distributed cluster, or may be formed by preset interface numbers, which is not limited in this embodiment.
In the embodiment of the present invention, the step S102 includes two steps S1021 and S1022. In order to reduce the waste of storage resources, in this embodiment, a json file may be obtained from the rmp upgrade package, and a target file is determined by using the json file, specifically:
s1021: and acquiring an rmp upgrade package from the ftp server according to a second preset path, and acquiring a plurality of json files from the rmp upgrade package.
In this embodiment, an rmp upgrade package is stored in the ftp server. The second preset path is a storage path of the rmp upgrade package, and the specific content of the second preset path is not limited in this embodiment. When the target file needs to be determined, the rmp upgrade package is obtained from the ftp server according to a second preset path, and a plurality of json files can be extracted and obtained by analyzing the rmp upgrade package. Specifically, json files may be obtained from the Interfaces directory of the rmp upgrade package. After the rmp upgrade package or the json file is determined in the ftp server, the rmp upgrade package or the json file can be acquired locally so as to carry out subsequent operation; or instructions may be sent to the ftp server, which sends the rmp upgrade package or json file to the target distributed cluster for subsequent operations. Referring to fig. 5, fig. 5 is a schematic diagram of a json file list, namely a json file list in an rmp upgrade package, according to an embodiment of the present invention.
S1022: and matching and verifying each json file and the interface linked list, and determining the json file passing the matching and verifying as a target file.
And after acquiring the json file, performing matching verification on the json file and the interface linked list. Specifically, when the interface chain table records the interface name of each interface, the interface name can be used for matching with the file name of the json file, if the interface name is the same as the file name of the json file, the json file is determined to pass the matching verification, and the json file is determined to be the target file; or when the interface chain table records the interface numbers of each interface, the corresponding names can be determined by using the corresponding relation between the interface numbers and the interface names, the interface names are matched with the file names of the json files, and if the interface numbers are the same as the interface numbers, the json files are determined to pass the matching verification and are determined as target files.
In the embodiment of the present invention, the step S103 includes two steps S1031 and S1032. In order to accurately obtain parameters of each level in a json file, and further select a correct test script, and prevent a test error caused by a test script selection error, in this embodiment, parameters of each level corresponding to the json file are stored in a dictionary manner, specifically:
s1031: and loading and analyzing the target file by using the JSONMapper to obtain parameters of each level corresponding to the target file.
After the target file is determined, the target file is loaded and analyzed by using the JSONMapper, so that parameters of each level corresponding to the target file are obtained and stored as a dictionary, for example, the parameters can be stored as a dictionary dit _ parameter 1. Specifically, an analysis instruction may be sent to the target distributed cluster, and the target distributed cluster loads and analyzes the target file to obtain parameters of each level; or the target file can be obtained and analyzed locally to obtain parameters of each level.
S1032: and acquiring test scripts corresponding to the parameters of each stage by using a preset corresponding relation.
And after the parameters at all levels are obtained, obtaining a dictionary, and obtaining the test scripts corresponding to the parameters at all levels by using the parameters at all levels recorded in the dictionary according to the preset corresponding relation between the parameters and the test scripts so as to test the interfaces.
S104: and running a test script on the target distributed cluster so as to test the target interface.
After the test script is obtained, the test script is run on the target distributed cluster so as to test the target interface, and the specific running process of the test script is not limited in this embodiment.
Based on the foregoing embodiment of the present invention, in the embodiment of the present invention, before obtaining the test script corresponding to the target interface by using the target file, the method may further include:
and acquiring a selection instruction, and determining a target interface in the interface linked list according to the selection instruction.
The selection instruction is used for selecting the target interface, and the interface participating in the interface test in the interface linked list can be selected by utilizing the selection instruction so as to carry out test work according to actual needs, thereby reducing the time required by the test and the calculation resources wasted by repeated tests.
In the following, the interface testing apparatus provided by the embodiment of the present invention is introduced, and the interface testing apparatus described below and the interface testing method described above may be referred to correspondingly.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an interface testing apparatus according to an embodiment of the present invention, including:
a linked list obtaining module 310, configured to obtain an interface linked list corresponding to the target distributed cluster;
a target file determining module 320, configured to determine a target file according to the interface linked list;
a test script obtaining module 330, configured to obtain a test script corresponding to the target interface by using the target file;
and the testing module 340 is configured to run a testing script on the target distributed cluster so as to test the target interface.
Optionally, the linked list obtaining module 310 includes:
the information acquisition unit is used for acquiring and analyzing the test instruction to obtain project information and cluster type information;
the cluster determining unit is used for determining a target distributed cluster according to the project information and the cluster type information;
and the linked list acquisition unit is used for acquiring the interface linked list from the target distributed cluster according to a first preset path.
Optionally, the target file determining module 320 includes:
the json file acquisition unit is used for acquiring an rmp upgrade package from the ftp server according to a second preset path and acquiring a plurality of json files from the rmp upgrade package;
and the determining unit is used for performing matching verification on each json file and the interface linked list and determining the json file passing the matching verification as a target file.
Unfortunately, the test script obtaining module 330 includes:
the parameter acquisition unit is used for loading and analyzing the target file by using the JSONMapper to obtain parameters of each level corresponding to the target file;
and the script selection unit is used for acquiring the test scripts corresponding to the parameters of each stage by utilizing the preset corresponding relation.
Optionally, the method further comprises:
and the target interface determining module is used for acquiring the selection instruction and determining the target interface in the interface linked list according to the selection instruction.
Optionally, the method further comprises:
and the report generating module is used for acquiring the test result and generating a test report by using the test result.
In the following, the interface testing device provided by the embodiment of the present invention is introduced, and the interface testing device described below and the interface testing method described above may be referred to correspondingly.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an interface testing apparatus according to an embodiment of the present invention, where the interface testing apparatus includes a memory and a processor, where:
a memory 410 for storing a computer program;
the processor 420 is configured to execute a computer program to implement the interface testing method.
In the following, the computer-readable storage medium provided by the embodiment of the present invention is introduced, and the computer-readable storage medium described below and the interface testing method described above may be referred to correspondingly.
The present invention also provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the above-described interface testing method. The computer-readable storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it should also be noted that, herein, relationships such as first and second, etc., are intended only to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
The interface testing method, the interface testing device, the interface testing equipment and the computer readable storage medium provided by the invention are introduced in detail, and a specific example is applied in the text to explain the principle and the implementation mode of the invention, and the description of the above embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. An interface testing method, comprising:
acquiring an interface linked list corresponding to a target distributed cluster;
determining a target file according to the interface linked list;
acquiring a test script corresponding to a target interface by using the target file;
and running the test script on the target distributed cluster so as to test the target interface.
2. The interface testing method according to claim 1, wherein the obtaining of the interface linked list corresponding to the target distributed cluster includes:
acquiring and analyzing a test instruction to obtain project information and cluster type information;
determining the target distributed cluster according to the project information and the cluster type information;
and acquiring the interface linked list from the target distributed cluster according to a first preset path.
3. The interface testing method of claim 1, wherein determining a target file according to the interface chain table comprises:
acquiring an rmp upgrade package from an ftp server according to a second preset path, and acquiring a plurality of json files from the rmp upgrade package;
and performing matching verification on each json file and the interface linked list, and determining the json file passing the matching verification as the target file.
4. The interface testing method according to claim 1, wherein the obtaining of the test script corresponding to the target interface using the target file includes:
loading and analyzing the target file by using JSONMapper to obtain parameters of each level corresponding to the target file;
and acquiring the test script corresponding to each level of parameter by using a preset corresponding relation.
5. The interface testing method according to any one of claims 1 to 4, further comprising, before the obtaining a test script corresponding to a target interface by using the target file, the steps of:
and acquiring a selection instruction, and determining the target interface in the interface linked list according to the selection instruction.
6. The interface testing method of claim 5, further comprising:
and acquiring a test result, and generating a test report by using the test result.
7. An interface testing apparatus, comprising:
the link list acquisition module is used for acquiring an interface link list corresponding to the target distributed cluster;
the target file determining module is used for determining a target file according to the interface linked list;
the test script acquisition module is used for acquiring a test script corresponding to the target interface by using the target file;
and the test module is used for running the test script on the target distributed cluster so as to test the target interface.
8. The interface testing apparatus of claim 7, wherein the linked list obtaining module comprises:
the information acquisition unit is used for acquiring and analyzing the test instruction to obtain project information and cluster type information;
the cluster determining unit is used for determining the target distributed cluster according to the project information and the cluster type information;
and the linked list acquisition unit is used for acquiring the interface linked list from the target distributed cluster according to a first preset path.
9. An interface test apparatus comprising a memory and a processor, wherein:
the memory is used for storing a computer program;
the processor for executing the computer program to implement the interface testing method according to any one of claims 1 to 6.
10. A computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the interface testing method of any one of claims 1 to 6.
CN202010132541.5A 2020-02-27 2020-02-27 Interface testing method, system and device and readable storage medium Active CN111400171B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010132541.5A CN111400171B (en) 2020-02-27 2020-02-27 Interface testing method, system and device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010132541.5A CN111400171B (en) 2020-02-27 2020-02-27 Interface testing method, system and device and readable storage medium

Publications (2)

Publication Number Publication Date
CN111400171A true CN111400171A (en) 2020-07-10
CN111400171B CN111400171B (en) 2023-01-10

Family

ID=71435982

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010132541.5A Active CN111400171B (en) 2020-02-27 2020-02-27 Interface testing method, system and device and readable storage medium

Country Status (1)

Country Link
CN (1) CN111400171B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112363969A (en) * 2020-11-11 2021-02-12 歌尔科技有限公司 Interface debugging method and device, electronic equipment and readable storage medium
CN112799969A (en) * 2021-04-08 2021-05-14 蚂蚁金服(杭州)网络技术有限公司 Testing method, device and system of distributed file system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1407756A (en) * 2001-09-10 2003-04-02 深圳市中兴通讯股份有限公司上海第二研究所 Interface test method
US20170115344A1 (en) * 2015-10-23 2017-04-27 Intel IP Corporation Device, system and method to support communication of test, debug or trace information with an external input/output interface

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1407756A (en) * 2001-09-10 2003-04-02 深圳市中兴通讯股份有限公司上海第二研究所 Interface test method
US20170115344A1 (en) * 2015-10-23 2017-04-27 Intel IP Corporation Device, system and method to support communication of test, debug or trace information with an external input/output interface

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
虞砺琨等: "基于数据模型的接口用例自动生成", 《测控技术》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112363969A (en) * 2020-11-11 2021-02-12 歌尔科技有限公司 Interface debugging method and device, electronic equipment and readable storage medium
CN112799969A (en) * 2021-04-08 2021-05-14 蚂蚁金服(杭州)网络技术有限公司 Testing method, device and system of distributed file system

Also Published As

Publication number Publication date
CN111400171B (en) 2023-01-10

Similar Documents

Publication Publication Date Title
CN109302522B (en) Test method, test device, computer system, and computer medium
US8010844B2 (en) File mutation method and system using file section information and mutation rules
US9465718B2 (en) Filter generation for load testing managed environments
CN111124919A (en) User interface testing method, device, equipment and storage medium
CN111897724B (en) Automatic testing method and device suitable for cloud platform
KR20080068385A (en) Program test system, method and computer readable medium on which program for executing the method is recorded
CN106776338B (en) Test method, test device and server
CN107608898B (en) Method for reproducing test flow to realize automatic regression test
US20180357143A1 (en) Testing computing devices
CN114546738B (en) Universal test method, system, terminal and storage medium for server
CN111400171B (en) Interface testing method, system and device and readable storage medium
CN111797006B (en) Method, device and equipment for testing thread and storage medium
CN111124911A (en) Automatic testing method, device, equipment and readable storage medium
CN113568839A (en) Method, device, equipment and medium for software testing and statistical test coverage rate
CN111625434A (en) Database OLTP benchmark performance test method, system and related components
US8997048B1 (en) Method and apparatus for profiling a virtual machine
CN110147313B (en) Log output method and device
CN116383025A (en) Performance test method, device, equipment and medium based on Jmeter
CN111666200A (en) Testing method and terminal for time consumption of cold start of PC software
CN116016270A (en) Switch test management method and device, electronic equipment and storage medium
CN114490413A (en) Test data preparation method and device, storage medium and electronic equipment
CN114490337A (en) Debugging method, debugging platform, equipment and storage medium
CN110908903B (en) Test method based on editable YAML file
CN112084108A (en) Test script generation method and device and related components
US8898636B1 (en) Method and apparatus for testing an application running in a virtual machine

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