[go: up one dir, main page]

CN111309575A - Method, device, server and storage medium for starting and stopping test tool - Google Patents

Method, device, server and storage medium for starting and stopping test tool Download PDF

Info

Publication number
CN111309575A
CN111309575A CN202010099050.5A CN202010099050A CN111309575A CN 111309575 A CN111309575 A CN 111309575A CN 202010099050 A CN202010099050 A CN 202010099050A CN 111309575 A CN111309575 A CN 111309575A
Authority
CN
China
Prior art keywords
test tool
starting
command
session
interface
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
CN202010099050.5A
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.)
Shenzhen Zhumo Technology Co ltd
Original Assignee
Shenzhen Zhumo 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 Shenzhen Zhumo Technology Co ltd filed Critical Shenzhen Zhumo Technology Co ltd
Priority to CN202010099050.5A priority Critical patent/CN111309575A/en
Publication of CN111309575A publication Critical patent/CN111309575A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/3414Workload generation, e.g. scripts, playback

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses a method, a device, a server and a storage medium for starting and stopping a test tool, wherein the method for starting the test tool comprises the following steps: obtaining command parameters through interface parameters of a test tool starting interface; generating a test tool starting command according to the command parameters and the interface parameters; connecting with a preset system to create a starting session; running the test tool launch command in the launch session to launch a test tool. The embodiment of the invention enables the performance test platform to achieve the purpose of starting or stopping running the test tool by one key by calling the test tool starting interface, improves the test efficiency and the automation degree of the performance test platform, and is more beneficial to platform construction.

Description

Method, device, server and storage medium for starting and stopping test tool
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a method, a device, a server and a storage medium for starting and stopping a test tool.
Background
The performance test is to simulate various normal, peak and abnormal load conditions through an automatic test tool to test various performance indexes of the system, and mainly comprises a load test and a pressure test. At present, many companies collect various testing tools by building a performance testing platform, so that management and calling are facilitated.
The use of the testing tool in the performance testing platform generally has specific conditions, for example, the starting and stopping of the testing tool needs to be connected with a matched system in advance, and the connection of the testing tool and the matched system cannot be completed directly through the performance testing platform, and needs manual operation of a testing person. For example, currently known Locust is a performance testing tool written by Python, a performance testing platform based on Locust is very easy to use and very good to learn, but Locust operation needs to be executed by connecting a Linux execution command to start and stop operation, while Locust connection with Linux needs to be executed by special software, and if a tester needs to perform manual Linux connection operation each time Locust is used, the automation degree of the performance testing platform is reduced, and the platform construction is not facilitated.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a server, and a storage medium for starting and stopping a test tool, so that a performance testing platform can start or stop running the test tool by one key in a manner of interface call.
In a first aspect, an embodiment of the present invention provides a method for starting a test tool, including:
obtaining command parameters through interface parameters of a test tool starting interface;
generating a test tool starting command according to the command parameters and the interface parameters;
connecting with a preset system to create a starting session;
running the test tool launch command in the launch session to launch a test tool.
Further, generating a test tool start command according to the command parameters and the interface parameters includes:
acquiring a randomly generated port number;
and splicing the command parameters and the port number with preset content to form a test tool starting command.
Further, connecting with a preset system to create a startup session includes:
and remotely connecting with a preset system in a preset connection mode to create a starting session.
Further, after the test tool start command is executed in the start session to start the test tool, the method further includes:
acquiring a process number corresponding to the port number;
and storing the process number into a database.
In a second aspect, an embodiment of the present invention provides a method for stopping a test tool, including:
acquiring a process number to be stopped through interface parameters of an interface for stopping running of the test tool;
splicing the process number to be stopped and preset contents to generate a test tool stop command;
connecting with a preset system to create a stop session;
executing the test tool shutdown command in the shutdown session to shutdown the test tool.
Further, connecting with a preset system to create a stop session includes:
and remotely connecting with a preset system in a preset connection mode to create a stop session.
In a third aspect, an embodiment of the present invention provides an apparatus for starting a test tool, including:
the command parameter acquisition module is used for acquiring command parameters through interface parameters of the test tool starting interface;
the starting command generating module is used for generating a testing tool starting command according to the command parameters and the interface parameters;
the starting session creating module is used for connecting with a preset system to create a starting session;
and the starting session running module is used for running the test tool starting command in the starting session so as to start the test tool. In a fourth aspect, an embodiment of the present invention provides an apparatus for stopping a test tool, including:
the device comprises a to-be-stopped running process number acquisition module, a to-be-stopped running process number acquisition module and a to-be-stopped running process number acquisition module, wherein the to-be-stopped running process number acquisition module is used for acquiring a to-be-stopped running process number through interface parameters of a test tool stop running interface;
the operation stopping command generating module is used for splicing the process number to be stopped and the preset content to generate a test tool operation stopping command;
the session stopping creating module is used for connecting with a preset system to create a stopping session;
and the session stop running module is used for running the test tool stop running command in the stop session so as to stop running the test tool.
In a fifth aspect, an embodiment of the present invention provides a server, where the server includes:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method for starting the test tool provided by any of the embodiments of the present invention and/or implement the method for stopping the test tool provided by any of the embodiments of the present invention.
In a sixth aspect, embodiments of the present invention provide a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements a method for starting a test tool provided in any of the embodiments of the present invention, and/or implements a method for stopping a test tool provided in any of the embodiments of the present invention.
The method for starting the test tool provided by the embodiment of the invention obtains the command parameters through the interface parameters of the test tool starting interface; generating a test tool starting command according to the command parameters and the interface parameters; connecting with a preset system to create a starting session; running the test tool launch command in the launch session to launch a test tool. According to the embodiment of the invention, the performance test platform achieves the purpose of starting or stopping running the test tool by one key by calling the test tool starting interface, so that the test efficiency and the automation degree of the performance test platform are improved, and the platform construction is facilitated.
Drawings
Fig. 1 is a schematic flowchart illustrating a method for starting a test tool according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a method for starting a test tool according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an apparatus for starting a test tool according to a third embodiment of the present invention;
FIG. 4 is a flowchart illustrating a method for stopping a test tool according to a fourth embodiment of the present invention;
fig. 5 is a flowchart illustrating a method for stopping a test tool according to a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of an apparatus for stopping a test tool according to a sixth embodiment of the present invention;
fig. 7 is a schematic structural diagram of a server according to a seventh embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. A process may be terminated when its operations are completed, but may have additional steps not included in the figure. A process may correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
Furthermore, the terms "first," "second," and the like may be used herein to describe various orientations, actions, steps, elements, or the like, but the orientations, actions, steps, or elements are not limited by these terms. These terms are only used to distinguish one direction, action, step or element from another direction, action, step or element. The terms "first", "second", etc. are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "plurality", "batch" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Example one
Fig. 1 is a flowchart illustrating a method for starting a test tool according to an embodiment of the present invention, where the embodiment is applicable to a performance test platform to start the test tool by one key through an interface call. As shown in fig. 1, a method for starting a test tool according to an embodiment of the present invention includes:
and S110, obtaining command parameters through the interface parameters of the test tool starting interface.
In particular, interfaces in the computer world generally include two meanings: one is an Interface of an Application program itself, which is also called an API (Application Programming Interface), and is an Interface that an operating system leaves for the Application program to call, which is equivalent to an access of a calling resource and is expressed in the form of a source code; the other is an interactive Interface between a person and software, that is, a User Interface (UI). The interfaces referred to in the embodiments of the present invention all represent APIs.
The test tool starting interface is an interface for realizing the starting function of the test tool, the UI expression form corresponding to the test tool starting interface is a button on the UI, and from the perspective of a user, the user clicks the test tool starting button on the performance test platform interface, namely, the resource of the test tool starting interface is called, so as to realize the function of starting the test tool.
The interface parameters of the test tool start interface generally include domain name, path, interface parameters and the like, and the interface parameters represent parameters transferred between interfaces. The meaning of starting the test tool actually includes starting the test tool to test the test object, so starting the test tool needs to determine the test object of the test tool, and the command parameter is a parameter for determining the test object of the test tool and is obtained through interface parameters in the interface parameters. Preferably, the command parameter in this embodiment is a host parameter, the host parameter is stored in the database, and different hosts correspond to different interface parameter Task codes, so that the corresponding host parameter can be obtained from the database through the interface parameter Task Code.
And S120, generating a test tool starting command according to the command parameters and the interface parameters.
Specifically, the test tool initiation command usually has a fixed format, for example, the test tool initiation command format of Locust is: the fixed content + test script file + command parameter + port number, its fixed format is: py, LF _ + Task code. The test script file is determined by an interface parameter Task Code in the interface parameters, and the Locust start command is expressed as (+ number represents a connection relationship between each part and does not exist in an actual command):
locust-f/usr/fin/FinBomber/LF_+Task Code.py--host=+host+--P+port
illustratively, if the Task Code is TCqwx015bjhv, the host is http:// www.baidu.com, and the port number is 22222, then the test tool start command of Locust is:
locust-f/usr/fin/FinBomber/LF_TCqwx015bjhv.py--host=http://www.baidu.com-P22222。
and S130, connecting with a preset system to create a starting session.
Specifically, session refers to a process in which an end user communicates with an interactive system, so that connection with a preset system is required before session creation, and the session is started for executing a starting process of a test tool. Preferably, when using Locust, the method needs to connect with a Linux system, and the manner of creating the startup session is as follows: openness.
And S140, running the test tool starting command in the starting session to start the test tool.
Specifically, a test tool start command is run in a start session in a mode of session.
The method for starting the test tool provided by the embodiment of the invention obtains the command parameters through the interface parameters of the test tool starting interface; generating a test tool starting command according to the command parameters and the interface parameters; connecting with a preset system to create a starting session; running the test tool launch command in the launch session to launch a test tool. The performance test platform achieves the purpose of starting the test tool by one key by calling the test tool starting interface, improves the test efficiency and the automation degree of the performance test platform, and is more favorable for platform construction.
Example two
Fig. 2 is a schematic flowchart of a method for starting a test tool according to a second embodiment of the present invention, which is a further refinement of the above embodiments. As shown in fig. 2, a method for starting a test tool according to a second embodiment of the present invention includes:
s210, obtaining command parameters through the interface parameters of the test tool starting interface.
In particular, interfaces in the computer world generally include two meanings: one is an Interface of the Application program itself, which is also called an API (Application Programming Interface), and is a call Interface that an operating system leaves for the Application program, which is equivalent to an access of a call resource and is expressed in the form of a source code; the other is an interactive Interface between a person and software, that is, a User Interface (UI). The interfaces referred to in the embodiments of the present invention all represent APIs.
The test tool starting interface is an interface for realizing the starting function of the test tool, the UI expression form corresponding to the test tool starting interface is a button on the UI, and from the perspective of a user, the user clicks the test tool starting button on the performance test platform interface, namely, the resource of the test tool starting interface is called, so as to realize the function of starting the test tool.
The interface parameters of the test tool start interface generally include domain name, path, interface parameters and the like, and the interface parameters represent parameters transferred between interfaces. The meaning of starting the test tool actually includes starting the test tool to test the test object, so starting the test tool needs to determine the test object of the test tool, and the command parameter is a parameter for determining the test object of the test tool and is obtained through interface parameters in the interface parameters. Preferably, the command parameter in this embodiment is a host parameter, the host parameter is stored in the database, and different hosts correspond to different interface parameter Task codes, so that the corresponding host parameter can be obtained from the database through the interface parameter Task Code.
S220, acquiring the randomly generated port number.
Specifically, a port (port) is an entrance for communication between a computer and the outside, a port in the software field generally refers to a communication protocol port facing a connection service or a connectionless service in a network, and is an abstract software structure including some data structures and I/O (basic input/output) buffers, and an interface must call resources through the port. The ports are marked by port numbers, so a port generally refers to a port number, and the port number is an integer within 0 to 65535. The port number may be set by a user in a self-defined manner, or may be randomly generated by a computer, and preferably, the port number of this embodiment is a randomly generated port number.
And S230, splicing the command parameters and the port numbers with preset contents to form a test tool starting command.
Specifically, the test tool start command is: the method comprises the following steps of fixing content, testing script files, command parameters and port numbers, wherein the testing script files are determined by interface transmission parameters in the interface parameters, and the fixed format is as follows: py, LF _ + Task code. The Locust start command is expressed as (+ number represents a connection relationship between parts, which does not exist in an actual command):
locust-f/usr/fin/FinBomber/LF_+Task Code.py--host=+host+--P+port
illustratively, if the Task Code is TCqwx015bjhv, host is http:// www.baidu.com, and port is 22222, then Locust's test tool start command is:
locust-f/usr/fin/FinBomber/LF_TCqwx015bjhv.py--host=http://www.baidu.com-P22222。
and S240, remotely connecting with a preset system through a preset connection mode to create a starting session.
Specifically, the preset connection mode is a connection mode carried in a Ganymed SSH-2 packet, the Ganymed SSH-2 is called Ganymed SSH-2for Java in its entirety, and the packet is a packet for realizing SSH-2 protocol by pure Java. Session (session) refers to a process of communication between an end user and an interactive system, so that connection with a preset system is required before session creation, and session initiation is used for executing a test tool initiation process. In this embodiment, the preset system is a Linux system, and a startup session is created through conn.
And S250, running the test tool starting command in the starting session to start the test tool.
Specifically, a test tool start command is run in a start session in a mode of session.
And S260, acquiring a process number corresponding to the port number.
Specifically, a Process (Process) is a copy of a running program and is an instruction set loaded into a memory, the program is a description of instructions, data and their organization forms, and the Process is an entity of the program and is used for describing a dynamic execution Process of the program. Processes are marked and distinguished by Process numbers (Process IDs, PIDs). When the destination host receives the data packet, the data is sent to the corresponding port according to the port number, and the process corresponding to the port takes the data and waits for the next group of data to arrive, so the port number (port) and the process number (PID) are in one-to-one correspondence, and the corresponding process number can be determined according to the port number.
And S270, storing the process number into a database.
Specifically, the process number is stored in the database, and when the process needs to be called subsequently, the corresponding process number is acquired from the database, so that the corresponding process can be determined.
The method for starting the test tool provided by the embodiment of the invention enables the performance test platform to achieve the purpose of starting the test tool by one key by calling the test tool starting interface, improves the test efficiency and the automation degree of the performance test platform, and is more beneficial to platform construction.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a device for starting a test tool according to a third embodiment of the present invention, which is applicable to a performance test platform to start the test tool by one key through an interface call. The device for starting the test tool provided by the third embodiment of the present invention can implement the method for starting the test tool provided by any embodiment of the present invention, has the corresponding functional structure and the beneficial effects of the implementation method, can be implemented in a hardware or software manner, and can be integrated into a terminal device, such as a computer device. The contents not described in detail in this embodiment can refer to the description of any embodiment of the method for starting the test tool according to the present invention.
As shown in fig. 3, an apparatus for starting a test tool according to a third embodiment of the present invention includes: a command parameter acquisition module 310, a start command generation module 320, a start session creation module 330, and a start session running module 340.
The command parameter acquiring module 310 is configured to acquire command parameters through interface parameters of the test tool start interface;
the start command generating module 320 is configured to generate a test tool start command according to the command parameters and the interface parameters;
the starting session creating module 330 is configured to connect with a preset system to create a starting session;
the start session running module 340 is used for running the test tool start command in the start session to start the test tool.
Further, the start command generating module 320 is specifically configured to: acquiring a randomly generated port number; and splicing the command parameters and the port number with preset content to form a test tool starting command.
Further, the start command generating module 320 is specifically configured to: and remotely connecting with a preset system in a preset connection mode to create a starting session.
Further, the method also comprises the following steps: the process number acquisition module is used for acquiring the process number corresponding to the port number; and the process number storage module is used for storing the process number into a database.
According to the device for starting the test tool provided by the third embodiment of the invention, the performance test platform achieves the purpose of starting the test tool by one key by calling the test tool starting interface through the command parameter acquisition module, the starting command generation module, the starting session creation module and the starting session operation module, so that the test efficiency and the automation degree of the performance test platform are improved, and the platform construction is facilitated.
Example four
Fig. 4 is a flowchart illustrating a method for stopping a test tool according to a fourth embodiment of the present invention, where this embodiment is applicable to a performance test platform to stop running the test tool by one key in a manner of interface call. As shown in fig. 4, a method for stopping a test tool according to a fourth embodiment of the present invention includes:
s410, acquiring the number of the process to be stopped through the interface parameters of the interface for stopping running of the test tool.
Specifically, stopping the test tool is to stop the test tool, the test tool stop interface is an interface for implementing the stop function of the test tool, the UI expression form corresponding to the test tool stop interface is a button on the UI, and from the perspective of the user, clicking the test tool stop button on the performance test platform interface by the user is to call the resource of the test tool stop interface to implement the stop function of the test tool.
The interface parameters of the interface for which the test tool stops operating generally include domain name, path, interface parameters, and the like, and the interface parameters represent parameters transferred between the interfaces. The running of the test tool is the running of the program in terms of data representation, the dynamic Process of the program running is represented by processes, the processes are entities of the program, and the processes are marked and distinguished through Process numbers (Process IDs and PIDs). The stop running test tool is the process corresponding to the stop test tool, so the stop running test tool needs to determine the corresponding process number, namely the process number to be stopped running, and the process number can be obtained through the interface parameters in the interface parameters, namely the PID to be stopped running is obtained through the interface parameter Task Code.
And S420, splicing the process number to be stopped and preset contents to generate a test tool stop command.
Specifically, the preset content is a fixed command for killing the process number: the kill command, preferably, the preset content in this embodiment is a kill-9 command, and the test tool stop command may be represented as (+ number represents a connection relationship between each part, and is not present in an actual command): kill-9+ PID, for example, Locust for test tool and 22222 for PID, then the Locust stop command is kill-922222.
And S430, connecting with a preset system to create a stop session.
Specifically, session refers to a process in which an end user communicates with an interactive system, so that connection with a preset system is required before session creation, and a process in which the test tool stops running is performed when the session is stopped. Preferably, when using Locust, the method needs to connect with a Linux system, and the manner of creating the startup session is as follows: openness.
And S440, running the test tool running stopping command in the stopping session to stop running the test tool.
Specifically, the test tool stop command is executed in a stop session in a mode of session.
The method for stopping the test tool provided by the fourth embodiment of the invention obtains the process number to be stopped through the interface parameter of the interface for stopping the test tool; splicing the process number to be stopped and preset contents to generate a test tool stop command; connecting with a preset system to create a stop session; executing the test tool shutdown command in the shutdown session to shutdown the test tool. The performance test platform achieves the purpose of stopping the operation of the test tool by one key by calling the test tool operation stopping interface, improves the test efficiency and the automation degree of the performance test platform, and is more favorable for platform construction.
EXAMPLE five
Fig. 5 is a flowchart illustrating a method for stopping a test tool according to a fifth embodiment of the present invention, which is a further refinement of the foregoing embodiments. As shown in fig. 5, a method for stopping a test tool according to a fifth embodiment of the present invention includes:
and S510, acquiring the number of the process to be stopped through the interface parameters of the interface for stopping running of the test tool.
Specifically, the test tool operation stopping interface is an interface for realizing the operation stopping function of the test tool, the UI expression form corresponding to the test tool operation stopping interface is a button on the UI, and from the perspective of the user, clicking the test tool operation stopping button on the performance test platform interface by the user is to call the resource of the test tool operation stopping interface to realize the function of stopping the operation of the test tool.
The interface parameters of the interface for which the test tool stops operating generally include domain name, path, interface parameters, and the like, and the interface parameters represent parameters transferred between the interfaces. The running of the test tool is the running of the program in terms of data representation, the dynamic Process of the program running is represented by processes, the processes are entities of the program, and the processes are marked and distinguished through Process numbers (Process IDs and PIDs). The stop running test tool is the process corresponding to the stop test tool, so the stop running test tool needs to determine the corresponding process number, namely the process number to be stopped running, and the process number can be obtained through the interface parameters in the interface parameters, namely the PID to be stopped running is obtained through the interface parameter Task Code.
S520, splicing the process number to be stopped and preset contents to generate a test tool stop command.
Specifically, the preset content is a fixed command for killing the process number: the kill command, preferably, the preset content in this embodiment is a kill-9 command, and the test tool stop command may be represented as (+ number represents a connection relationship between each part, and is not present in an actual command): kill-9+ PID, for example, Locust for test tool and 22222 for PID, then the Locust stop command is kill-922222.
And S530, remotely connecting with a preset system through a preset connection mode to create a stop session.
Specifically, the preset connection mode is a connection mode carried in a Ganymed SSH-2 packet, the Ganymed SSH-2 is called Ganymed SSH-2for Java in its entirety, and the packet is a packet for realizing SSH-2 protocol by pure Java. Session (session) refers to a process of communication between an end user and an interactive system, so that connection with a preset system is required before session creation, and the process of stopping the operation of a test tool is executed when the session is stopped. In this embodiment, the preset system is a Linux system, and establishes a session stop through conn.
And S540, running the test tool running stopping command in the stopping session to stop running the test tool.
Specifically, the test tool stop command is executed in a stop session in a mode of session.
And S550, clearing the process number to be stopped stored in the database.
Specifically, in order to search and call a process, the process number is stored in the database, and when the process corresponding to the process number to be stopped is killed (i.e., the process is stopped), the process number to be stopped stored in the database needs to be cleared, so that an error is avoided in a subsequent data query process.
The method for stopping the test tool provided by the fifth embodiment of the invention enables the performance test platform to achieve the purpose of stopping the test tool by one key by calling the test tool stop interface, improves the test efficiency and the automation degree of the performance test platform, and is more beneficial to platform construction.
EXAMPLE six
Fig. 6 is a schematic structural diagram of a device for stopping a test tool according to a sixth embodiment of the present invention, which is applicable to a performance test platform to stop running the test tool by one key in an interface call manner. The device for stopping the test tool provided by the sixth embodiment of the present invention can implement the method for stopping the test tool provided by any embodiment of the present invention, has the corresponding functional structure and the beneficial effects of the implementation method, can be implemented in a hardware or software manner, and can be integrated into a terminal device, such as a computer device. What is not described in detail in this embodiment may be referred to as the description of any method embodiment of the present invention for stopping a test tool.
As shown in fig. 6, an apparatus for stopping a test tool according to a sixth embodiment of the present invention includes: a to-be-stopped process number obtaining module 610, a stop command generating module 620, a stop session creating module 630 and a stop session running module 640.
The to-be-stopped process number obtaining module 610 is configured to obtain a to-be-stopped process number through an interface parameter of the test tool stop interface;
the stop operation command generating module 620 is configured to splice the process number to be stopped and preset content to generate a test tool stop operation command;
the stop session creation module 630 is configured to connect with a preset system to create a stop session;
the stop session running module 640 is used for running the test tool stop command in the stop session to stop running the test tool.
Further, the stop session creating module 630 is specifically configured to: and remotely connecting with a preset system in a preset connection mode to create a stop session.
Further, the preset connection mode is a connection mode of a ganymed-ssh2 self-contained belt.
Further, the method also comprises the following steps: and the to-be-stopped process number clearing module is used for clearing the to-be-stopped process number stored in the database.
According to the device for stopping the test tool provided by the sixth embodiment of the invention, the performance test platform achieves the purpose of stopping the test tool by one key by calling the test tool stop interface through the process number acquisition module to be stopped, the stop operation command generation module, the stop session creation module and the stop session operation module, so that the test efficiency and the automation degree of the performance test platform are improved, and the platform construction is facilitated.
EXAMPLE seven
Fig. 7 is a schematic structural diagram of a server according to a seventh embodiment of the present invention. FIG. 7 illustrates a block diagram of an exemplary server 712 suitable for use to implement embodiments of the present invention. The server 712 shown in fig. 7 is only an example and should not bring any limitations to the function and scope of use of the embodiments of the present invention.
As shown in fig. 7, server 712 is embodied in the form of a general-purpose server. Components of server 712 may include, but are not limited to: one or more processors 716, a storage device 728, and a bus 718 that couples the various system components (including the storage device 728 and the processors 716).
Bus 718 represents one or more of any of several types of bus structures, including a memory device bus or memory device controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Server 712 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by server 712 and includes both volatile and nonvolatile media, removable and non-removable media.
Storage 728 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 730 and/or cache Memory 732. The server 712 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 734 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 7, commonly referred to as a "hard drive"). Although not shown in FIG. 7, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk such as a Compact disk Read-Only Memory (CD-ROM), Digital Video disk Read-Only Memory (DVD-ROM) or other optical media may be provided. In these cases, each drive may be connected to the bus 718 by one or more data media interfaces. Storage 728 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
Program/utility 740 having a set (at least one) of program modules 742 may be stored, for instance, in storage 728, such program modules 742 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may include an implementation of a network environment. Program modules 742 generally perform the functions and/or methodologies of embodiments of the invention as described herein.
The server 712 may also communicate with one or more external devices 714 (e.g., keyboard, pointing server, display 724, etc.), with one or more servers that enable a user to interact with the server 712, and/or with any servers (e.g., network card, modem, etc.) that enable the server 712 to communicate with one or more other computing servers. Such communication may occur through input/output (I/O) interfaces 722. Further, server 712 may communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), and/or a public Network such as the Internet) via Network adapter 720. As shown in FIG. 7, network adapter 720 communicates with the other modules of server 712 via bus 718. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with server 712, including but not limited to: microcode, server drives, Redundant processors, external disk drive Arrays, disk array (RAID) systems, tape drives, and data backup storage systems, to name a few.
The processor 716 executes programs stored in the storage device 728 to perform various functional applications and data processing, such as implementing the method of starting a test tool provided by any embodiment of the present invention and/or stopping a test tool provided by any embodiment of the present invention.
The method for starting the test tool can comprise the following steps: obtaining command parameters through interface parameters of a test tool starting interface; generating a test tool starting command according to the command parameters and the interface parameters; connecting with a preset system to create a starting session; running the test tool launch command in the launch session to launch a test tool.
The method of stopping a test tool may include: acquiring a process number to be stopped through interface parameters of an interface for stopping running of the test tool; splicing the process number to be stopped and preset contents to generate a test tool stop command; connecting with a preset system to create a stop session; executing the test tool shutdown command in the shutdown session to shutdown the test tool.
Example eight
An eighth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for starting a test tool as provided in any embodiment of the present invention, and/or a method for stopping a test tool as provided in any embodiment of the present invention.
The method for starting the test tool can comprise the following steps: obtaining command parameters through interface parameters of a test tool starting interface; generating a test tool starting command according to the command parameters and the interface parameters; connecting with a preset system to create a starting session; running the test tool launch command in the launch session to launch a test tool.
The method of stopping a test tool may include: acquiring a process number to be stopped through interface parameters of an interface for stopping running of the test tool; splicing the process number to be stopped and preset contents to generate a test tool stop command; connecting with a preset system to create a stop session; executing the test tool shutdown command in the shutdown session to shutdown the test tool.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or terminal. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method of starting up a test tool, comprising:
obtaining command parameters through interface parameters of a test tool starting interface;
generating a test tool starting command according to the command parameters and the interface parameters;
connecting with a preset system to create a starting session;
running the test tool launch command in the launch session to launch a test tool.
2. The method of claim 1, wherein generating a test tool initiation command based on the command parameters and the interface parameters comprises:
acquiring a randomly generated port number;
and splicing the command parameters and the port number with preset content to form a test tool starting command.
3. The method of claim 2, wherein connecting with a pre-provisioned system to create a startup session comprises:
and remotely connecting with a preset system in a preset connection mode to create a starting session.
4. The method of claim 3, wherein after running the test tool launch command in the launch session to launch a test tool, further comprising:
acquiring a process number corresponding to the port number;
and storing the process number into a database.
5. A method of stopping a test tool, comprising:
acquiring a process number to be stopped through interface parameters of an interface for stopping running of the test tool;
splicing the process number to be stopped and preset contents to generate a test tool stop command;
connecting with a preset system to create a stop session;
executing the test tool shutdown command in the shutdown session to shutdown the test tool.
6. The method of claim 5, wherein connecting with a preset system to create a stop session comprises:
and remotely connecting with a preset system in a preset connection mode to create a stop session.
7. An apparatus for activating a test tool, comprising:
the command parameter acquisition module is used for acquiring command parameters through interface parameters of the test tool starting interface;
the starting command generating module is used for generating a testing tool starting command according to the command parameters and the interface parameters;
the starting session creating module is used for connecting with a preset system to create a starting session;
and the starting session running module is used for running the test tool starting command in the starting session so as to start the test tool.
8. An apparatus for stopping a test tool, comprising:
the device comprises a to-be-stopped running process number acquisition module, a to-be-stopped running process number acquisition module and a to-be-stopped running process number acquisition module, wherein the to-be-stopped running process number acquisition module is used for acquiring a to-be-stopped running process number through interface parameters of a test tool stop running interface;
the operation stopping command generating module is used for splicing the process number to be stopped and the preset content to generate a test tool operation stopping command;
the session stopping creating module is used for connecting with a preset system to create a stopping session;
and the session stop running module is used for running the test tool stop running command in the stop session so as to stop running the test tool.
9. A server, characterized in that the server comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method of starting a test tool as claimed in any one of claims 1 to 4 and/or implement a method of stopping a test tool as claimed in any one of claims 5 to 6.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method of starting a test tool according to any one of claims 1-4 and/or carries out the method of stopping a test tool according to any one of claims 5-6.
CN202010099050.5A 2020-02-18 2020-02-18 Method, device, server and storage medium for starting and stopping test tool Pending CN111309575A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010099050.5A CN111309575A (en) 2020-02-18 2020-02-18 Method, device, server and storage medium for starting and stopping test tool

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010099050.5A CN111309575A (en) 2020-02-18 2020-02-18 Method, device, server and storage medium for starting and stopping test tool

Publications (1)

Publication Number Publication Date
CN111309575A true CN111309575A (en) 2020-06-19

Family

ID=71158267

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010099050.5A Pending CN111309575A (en) 2020-02-18 2020-02-18 Method, device, server and storage medium for starting and stopping test tool

Country Status (1)

Country Link
CN (1) CN111309575A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117687893A (en) * 2024-02-04 2024-03-12 深圳市冠群电子有限公司 Mobile phone APP port testing method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6925633B1 (en) * 2000-05-30 2005-08-02 Aspect Communications Corporation Method and apparatus for automating testing of java beans
CN103546345A (en) * 2013-10-24 2014-01-29 广东欧珀移动通信有限公司 A method and device for testing the performance of communication equipment
CN105468519A (en) * 2015-11-17 2016-04-06 中国建设银行股份有限公司 Performance-testing tool control method and device
CN106383786A (en) * 2016-09-27 2017-02-08 北京金山安全软件有限公司 Interface pressure performance testing method and device and electronic equipment
CN109582517A (en) * 2018-12-04 2019-04-05 郑州云海信息技术有限公司 System application automated testing method, device, system and tool storage end

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6925633B1 (en) * 2000-05-30 2005-08-02 Aspect Communications Corporation Method and apparatus for automating testing of java beans
CN103546345A (en) * 2013-10-24 2014-01-29 广东欧珀移动通信有限公司 A method and device for testing the performance of communication equipment
CN105468519A (en) * 2015-11-17 2016-04-06 中国建设银行股份有限公司 Performance-testing tool control method and device
CN106383786A (en) * 2016-09-27 2017-02-08 北京金山安全软件有限公司 Interface pressure performance testing method and device and electronic equipment
CN109582517A (en) * 2018-12-04 2019-04-05 郑州云海信息技术有限公司 System application automated testing method, device, system and tool storage end

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117687893A (en) * 2024-02-04 2024-03-12 深圳市冠群电子有限公司 Mobile phone APP port testing method and system
CN117687893B (en) * 2024-02-04 2024-05-10 深圳市冠群电子有限公司 Mobile phone APP port testing method and system

Similar Documents

Publication Publication Date Title
US10613788B2 (en) Data migration between cloud storage systems
US11509505B2 (en) Method and apparatus for operating smart network interface card
US9009676B2 (en) Common recording and replaying performance test tool for a client-server environment
CN110764945A (en) Crash log processing method, device, equipment and storage medium
US20040254978A1 (en) System and method of remotely accessing a computer system to initiate remote mainteneance and management accesses on network computer systems
WO2023065749A1 (en) Distributed database embedding method and apparatus, and device and storage medium
CN109104491A (en) A kind of micro services call method, device, server and storage medium
CN111324441A (en) Operating environment switching method and device, computer equipment and storage medium
CN110555072A (en) Data access method, device, equipment and medium
CN113448730B (en) Service processing method, device, computer equipment and storage medium
WO2025040058A1 (en) Context switching verification method and apparatus
CN109086097B (en) Method and device for starting small program, server and storage medium
CN113138915A (en) Page testing method, device and medium
CN111309575A (en) Method, device, server and storage medium for starting and stopping test tool
CN110806967B (en) Unit testing method and unit testing device
CN107480055A (en) Method of testing, device, calculate readable storage medium storing program for executing and computing device
US5819071A (en) Remote simulation of data transmission
CN112491940A (en) Request forwarding method and device of proxy server, storage medium and electronic equipment
CN114840379A (en) Log generation method, device, server and storage medium
CN113961836A (en) Page jump method and device, electronic equipment and storage medium
CN110795388A (en) Binary file processing method, system, equipment and readable storage medium
CN111176982B (en) Test interface generation method and device
CN110825438B (en) Method and device for simulating data processing of artificial intelligence chip
CN113779018B (en) A data processing method and device
CN116028344A (en) Method and device for counting test results and related products

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: 20200619