Disclosure of Invention
The invention aims to solve the problem of high performance test cost in the existing cloud environment, and provides a test method and a test system for reducing the performance test cost in the cloud environment.
The technical scheme adopted by the invention for solving the technical problems is as follows: a testing method for reducing performance testing cost in a cloud environment includes:
step 1, receiving network information input by a user, and selecting at least one agent in a network corresponding to the network information;
and 2, receiving target server information input by a user, verifying whether a server corresponding to the target server information exists in a network corresponding to the network information, if so, transmitting the target server information to the selected at least one agent, otherwise, preventing the access to the network or the server.
Further, the selected at least one agent can prevent access to servers other than the server to which the target server information corresponds.
Further, the selected at least one agent operates on the Java virtual machine and prevents access to servers other than the server to which the target server information corresponds using a security function of the Java virtual machine.
Further, the selected at least one agent prevents access to servers other than the server to which the target server information corresponds by setting up the Java security manager in response to driving the script engine.
Further, the network information includes internet data center information, and step 1 further includes: and selecting at least one agent in the network corresponding to the network information according to the Internet data center information.
The invention also provides a test system for reducing the performance test cost in the cloud environment, which comprises the following components: a receiver, an agent selector, a server verifier and a target server information transmitter;
the receiver is used for receiving network information and target server information input by a user;
the agent selector is used for selecting at least one agent in a network corresponding to the network information;
the server verifier is used for verifying whether a server corresponding to the target server information exists in a network corresponding to the network information;
the target server information transmitter is used for transmitting the target server information to the selected at least one agent if a server corresponding to the target server information exists in the network corresponding to the network information, otherwise, the access to the network or the server is prevented.
Further, the selected at least one agent can prevent access to servers other than the server to which the target server information corresponds.
Further, the selected at least one agent operates on the Java virtual machine and prevents access to servers other than the server to which the target server information corresponds using a security function of the Java virtual machine.
Further, the selected at least one agent prevents access to servers other than the server to which the target server information corresponds by setting up the Java security manager in response to driving the script engine.
Further, the network information includes internet data center information, and the selecting unit is further configured to: and selecting at least one agent in the network corresponding to the network information according to the Internet data center information.
The invention has the beneficial effects that: according to the testing method and the testing system for reducing the performance testing cost in the cloud environment, the target server information is transmitted to the selected at least one agent according to the network information and the target server information input by the user, unnecessary cost caused by flow among networks and network change can be reduced by preventing access to the network or the server, and more accurate performance testing results and system stability can be provided. In addition, the test system and method can not scan scripts in advance, and can limit unnecessary communication between networks no matter what communication mode is selected on the dynamic test target server.
Examples
Referring to fig. 1, fig. 1 shows a user 1: 110. and (4) a user 2: 120. the control system comprises: 130. script: 140. the agent 1: 150. and the agent 2: 160. the agent 3: 170. the test target server 1: 180 and test target server 2: 190.
for example, user 1: 110 and user 2: 120 may represent a user desiring to test the performance of the target server. For example, user 1: 110 may wish to test the test target server 1: 180, and user 2: 120 may wish to test the test target server 2: 190. For simplicity, fig. 1 shows two users, user 1: 110 and user 2: 120, but the number of users is not limited.
Control system 130 may instruct the controller to controlagents 150, 160, and 170 based on the requests ofusers 110 and 120. In this case, thecontrol system 130 may control theagents 150, 160, and 170 by transmitting thescript 140 satisfying the demands of theusers 110 and 120 to theagents 150, 160, and 170.
Thescript 140 may contain a command to control theagents 150, 160, and 170 in response to the requests of theusers 110 and 120. For example, thescript 140 may contain commands for controlling a particular agent to request resources from a test target server at a particular host address. Thescript 140 may vary according to the requests of theusers 110 and 120.
Theagents 150, 160, and 170 may measure the performance of the respective servers by providing a load (e.g., providing a service request from thetest target servers 180 and 190 to the corresponding servers) in response to commands of thescript 140 transmitted from thecontrol system 130. For simplicity, fig. 1 shows threeagents 150, 160, and 170, but the number of agents is not limited.
Thetest target servers 180 and 190 are test targets set by theusers 110 and 120, and may provide services for theagents 150, 160, and 170 (e.g., service requests provided by theagents 150, 160, and 170) to respond to the load. For simplicity, fig. 1 shows twotest target servers 180 and 190, but the number of test target servers is not limited.
Referring to fig. 2, fig. 2 shows a network 1: 210 and network 2: 220. currently, many cloud services are offered free of charge with respect to traffic between components within a network. However, traffic between different networks requires charging. For example, it may not be possible for network 1 to: traffic occurring between components within 210 may be charged a fee or may not be: 220, but may be used to charge for traffic occurring between components within network 1: 210 and network 2: 220 charges a fee for traffic occurring between the components. Therefore, the inter-network bandwidth is narrow compared to the intra-network bandwidth.
Referring to the features of the cloud service of FIG. 2 described above, FIG. 1 may present problems when using a cloud-based test tool.
Referring to fig. 3, fig. 3 shows a network 1: agent 1 and agent 2 of 310 control scripts 1 and 2, respectively, to network 2: the test target servers of 320 provide the load, respectively testing examples of the tested performance target servers. In this example, as described above for fig. 2, because traffic occurring between the networks may be charged, a provider (e.g., a service provider providing a cloud-based testing tool) may be charged an amount corresponding to traffic sent between the networks. Furthermore, from the user's perspective, performance is measured by transmitting data between networks, and therefore, the accuracy of the performance test result of the test target server may be reduced; also, security issues (e.g., stability issues) and other issues (e.g., abuse) may arise because the load may be provided by accessing any address contained in the script.
Thus, if there is an agent in each network, the agents in the corresponding networks may be used to test servers in a particular network. However, in the related art, when a response test is performed using a command written in a scripting language, there may be no protection device that can prevent an agent from accessing another network.
To solve the above problem, a test target server may be identified by scanning a script in advance. However, in this case, appropriate action may not be taken to select one dynamic test target server.
Based on this, the present embodiment provides a test method and system for reducing performance test costs in a cloud environment, which may not scan scripts in advance and may restrict occurrence of unnecessary communication between networks regardless of which communication manner is selected on a dynamic test target server.
Referring to fig. 4, fig. 4 illustrates acontrol system 400 and a plurality of agents included in a plurality of networks. Thecontrol system 400 may select at least one agent included in the network corresponding to the network information according to the network information input by the user. For example, the network information may include Internet Data Center (IDC) information.
Further, thecontrol system 400 may verify whether a server corresponding to the target server information is included in the network information according to the target server information input by the user. For example, the target server information may include an Internet Protocol (IP) address or a host address of the server to be tested.
In this case, thecontrol system 400 may transmit the target server information together with the script to the selected at least one agent when the verified server is included in the corresponding network.
Thecontrol system 400 may execute, via one or more processors, program code stored in memory that includes instructions corresponding to the operations performed by the control system 400 (or elements thereof).
In this example, the at least one agent may block access to servers other than the server corresponding to the target server information. For example, at least one agent may run on a Java Virtual Machine (JVM). In this case, at least one agent may use the security information of the JVM to block access to servers other than the server corresponding to the target server information. For example, the at least one agent may block itself from accessing servers other than the server corresponding to the target server information according to the target server information. The JVM provides a function capable of blocking access to an Operating System (OS) or hardware through a security layer. In this embodiment, the agent may control access of the script to the network or server by setting up a Java security manager in response to driving the script engine.
For example, a user may access thecontrol system 400 and may enter, via a user interface provided by thecontrol system 400, information regarding the network 2: 420 as network information. In this embodiment, thecontrol system 400 may select the network 2 to include: 420, e.g., network 2: agent 2 in 420. Further, the user may input, via the user interface, information included in the network 2: the IP address or host address of server 2 in 420 is the target server information. In this case, thecontrol system 400 may verify whether the server 2 exists in the network 2 according to the target server information (e.g., the IP address or the host address of the server 2) and the network information (e.g., information about the network 2: 420): 420.
However, the information entered by the user (e.g., target server information or network information) may be inaccurate or erroneous, or may be malicious input. For example, the user may incorrectly input information about network 1: 410 and information about network 2: 420, target server information for server 2. In this case, thecontrol system 400 may verify whether the server 2 exists in the network 1 based on the network information and the target server information: 410, and it can be verified that the user entered is an error message, because the server 2 is in the network 1: 410 is not present.
Further, the agent in the embodiment may fundamentally block access to the other servers except for the server corresponding to the target server information through the script. For example, the target server information input from the user may be different from the server information accessed through the script. When the server corresponding to the target server information is the network 2: 420, and the server to be accessed by the script is network 1: 410, the agent may prevent erroneous access by blocking access to the server. In this case, thecontrol system 400 may issue a warning to the user or notify the administrator of the input of error information.
The load is provided to a test target server present in the network, the server being selected from the networks in the agents in the selected network. Thus, from the perspective of the provider providing the performance testing service, unnecessary costs may be prevented from being incurred by blocking inter-network communications (e.g., cross-IDC communications). Also, from the user's perspective, the user may generate more accurate performance test results by reducing changes to the network.
Further, thecontrol system 400 may automatically register the target server information according to the script after the script is initially executed. Accordingly, it is possible to reduce inconvenience in which users individually input target server information on the same test target server.
According to the embodiment of fig. 5, the test system 500 corresponds to thecontrol system 400 of fig. 4. The central test system 500 may be implemented by one or more processors executing program code stored in memory that includes instructions corresponding to the operations performed by the test control system 500 (or elements thereof).
Referring to fig. 5, the test system 500 may include anagent selector 510, aserver verifier 520, and a targetserver information transmitter 530.
The testing method according to the embodiment of fig. 6 may be performed by the testing method 500 or a separate component included in the testing system 500.
Inoperation 610, one or more processors of the test system 500 may load program code stored in at least one file of a program for a test method into a memory of the test system 500. For example, a program may be installed in test system 500 using at least one file, and when executed, one or more processors may load program code from the at least one file into a memory.
Theagent selector 510, theserver verifier 520, and the targetserver information conveyer 530 may all be configured to execute respective portions of program code in memory to processoperations 620 through 640.
Inoperation 620, the test system 500 or theagent selector 510 may select at least one agent including a network corresponding to the network information according to the network information input by the user. For example, the network information may include IDC information. In this example, the test system 500 or theagent selector 510 may select at least one agent based on the IDC information.
Inoperation 630, the test system 500 or theserver verifier 520 may verify whether a server corresponding to the target server information exists in the network corresponding to the network information according to the network information and the target server information further input by the user. For example, the destination server information may include an IP address or a host address of the server.
Inoperation 640, if it is verified inoperation 630 that the server corresponding to the target server information exists in the network corresponding to the network information, the test system 500 or the targetserver information transmitter 530 may transmit the target server information to the selected at least one agent. Further, according to at least one example embodiment, ifoperation 630 verifies that server information corresponding to the target server information does not exist in the network corresponding to the network information, then the test system 500 or the targetserver information transmitter 530 may not transmit the target server information to the selected at least one agent. The at least one agent selected here may block access to another server other than the server corresponding to the target server information. For example, the selected at least one agent may attempt to access a particular server based on the communicated script. The selected at least one agent may prevent access to the particular server using the script when the particular server is not the server corresponding to the target server information. For example, the security features of the JVM may be used to prevent access to a particular server. As described above, the selected at least one agent may respond to the script engine by setting up a Java security manager to control access of the script to the network or server.
Referring to fig. 7, the test system 700 of the fig. 7 embodiment may correspond to at least one agent described above, and the test system 700 may include a targetserver information receiver 710 and anaccess blocker 720. The testing method of the embodiment of fig. 8 may be performed by the test system 700 or a separate component included in the test system 700.
The test system 700 may be implemented, for example, by one or more processors executing program code stored in memory that includes instructions corresponding to the operations described herein as being performed by the test system 700 (or elements thereof).
Inoperation 810, the one or more processors of the test system 700 may load program code stored in at least one file of a program for a test method into a memory of the test system 700. For example, the program may be installed in the test system 700 using at least one file. When the program is executed, the one or more processors may load the program code from at least one file into memory.
Targetserver information receiver 710 andaccess blocker 720 may be configured to execute corresponding program code in memory to processoperations 820 and 830.
Inoperation 820, the test system 700 or the targetserver information receiver 710 may receive target server information from the controller. Here, the controller may correspond to thecontrol system 400 of fig. 4 or the test system 500 of fig. 5. Further, the target server information refers to information input from the user into the controller. When the test system 700 and the server corresponding to the target server information exist in the network corresponding to the network information input from the user, the target server information may be transmitted from the controller.
Inoperation 830, the test system 700 or theaccess blocker 720 may block access to servers other than the server corresponding to the target server information. Here, inoperation 820, the test system 700 or theaccess blocker 720 may block access to other servers (i.e., servers that are not servers corresponding to the target server information) using the security function of the JVM. For example, test system 700 oraccess blocker 720 may block access to other servers by setting up a Java security manager in response to driving the script engine.
As described above, according to at least some embodiments, by receiving information about a server of a network to be tested from a user, and by blocking access to a server other than the server selected by the input information, unnecessary costs due to inter-network traffic can be reduced and changes in the network can be reduced. Therefore, more accurate performance test results can be provided and stability can be improved. Furthermore, according to at least some embodiments, pre-scanning scripts are not required, and unnecessary communications between networks may be limited from occurring regardless of the selection on the dynamic test server.
The means described herein may be implemented using hardware components, software components, or a combination thereof. For example, the devices and components described in the embodiments may be implemented using at least one special purpose computer, such as a processor, a controller, an Arithmetic Logic Unit (ALU), a digital signal processor, a microcomputer, a Field Programmable Array (FPA), a Programmable Logic Unit (PLU), a microprocessor, or any other device capable of responding to and executing instructions in a defined manner. The processing device may run an Operating System (OS) and one or more software applications running on the OS. The processing device may also access, store, manipulate, process, and create data. For simplicity, the processing device is described herein in the singular; however, those skilled in the art will appreciate that a processing device may include multiple processing elements or multiple types of processing elements. For example, a processing device may include multiple processors or a single processor and controller. In addition, different processing configurations are also possible, such as parallel processors, multi-core processors, distributed processing, and the like.
The software may include a computer program, a piece of code, a piece of instruction, or some combination thereof, to individually or collectively direct or configure the processing device to operate as desired, to convert the processing device into a special purpose processor. Software and data may be embodied permanently or temporarily in any type of machine, component, physical or virtual device or computer storage medium or device. The software may also be distributed over network-coupled computer systems so that the software is stored and executed in a distributed fashion. The software and data may be stored by one or more computer-readable recording media.
The methods of the above-described embodiments may be recorded in a non-transitory computer-readable medium including program instructions to implement various operations of the above-described embodiments. The media may also be embodied as, alone or in combination with the program instructions, data files, data structures, and the like. The program instructions recorded on the medium may be those specially designed and constructed for the purposes of certain embodiments, or they may be of the kind well known and available to those having skill in the computer software arts. Examples of non-transitory computer readable media include magnetic media such as hard disks, floppy disks, and magnetic tape; optical disk media such as CD ROM disks and DVDs; magneto-optical media such as optical disks; hardware devices that are dedicated to storing and executing program instructions, such as Read Only Memory (ROM), Random Access Memory (RAM), flash memory, and the like. Examples of program instructions include both machine code, such as produced by a compiler, and files containing higher level code that may be executed by the computer using an interpreter. The above-described apparatus may be configured to act as one or more software modules in order to perform the operations of the above-described embodiments, and vice versa.