[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN112214413A - Application program testing method, device, equipment and storage medium - Google Patents

Application program testing method, device, equipment and storage medium Download PDF

Info

Publication number
CN112214413A
CN112214413A CN202011166639.9A CN202011166639A CN112214413A CN 112214413 A CN112214413 A CN 112214413A CN 202011166639 A CN202011166639 A CN 202011166639A CN 112214413 A CN112214413 A CN 112214413A
Authority
CN
China
Prior art keywords
test
target
identifier
equipment
application program
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
CN202011166639.9A
Other languages
Chinese (zh)
Other versions
CN112214413B (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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202011166639.9A priority Critical patent/CN112214413B/en
Publication of CN112214413A publication Critical patent/CN112214413A/en
Application granted granted Critical
Publication of CN112214413B publication Critical patent/CN112214413B/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/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The present disclosure provides a method, an apparatus, a device and a storage medium for testing an application program, which relate to the technical field of data processing, and the method comprises the following steps: responding to an application program test request carrying a test server identification, and determining a target test server corresponding to the test server identification; the target test server runs in the target container; acquiring a first device identifier in a configuration file of a target container, and driving a first test device corresponding to the first device identifier by using a target test server to test a target application program; when the first test equipment is detected to be abnormal, updating the first equipment identifier in the configuration file to a newly acquired second equipment identifier; and driving second test equipment corresponding to the second equipment identifier by using the target test server to test the target application program. The method and the device can effectively reduce the waste of the test resources and improve the problem that the test process of the application program is influenced due to the interruption of the test process.

Description

Application program testing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for testing an application program.
Background
Nowadays, to ensure that an application loaded on a mobile terminal can normally run, automated testing for the application is becoming more and more popular. At present, an application program is mainly tested through testing equipment such as a mobile phone and the like.
In the process of testing the application program, the test equipment is easy to be abnormal to influence the test flow; therefore, the conventional functional test for applications in a mobile terminal is mainly based on the idea of device redundancy, that is, a plurality of test devices are used to test the same application program at the same time. However, the application program test is realized in a device redundancy mode, obviously occupies too many test devices, and is undoubtedly a waste of test resources.
Disclosure of Invention
In order to solve the technical problems or at least partially solve the technical problems, the present disclosure provides a method, an apparatus, a device and a storage medium for testing an application program.
The present disclosure provides a method for testing an application program, the method comprising: responding to an application program test request carrying a test server identification, and determining a target test server corresponding to the test server identification; wherein the target test server runs in a target container; acquiring a first device identifier in a configuration file of the target container, and driving a first test device corresponding to the first device identifier by using the target test server to test a target application program; when the first test equipment is detected to be abnormal, acquiring a second equipment identifier from available test equipment identifiers corresponding to the target container, and updating the first equipment identifier in the configuration file into the second equipment identifier; and driving second test equipment corresponding to the second equipment identification by using the target test server to test the target application program.
Optionally, after obtaining the second device identifier and before updating the first device identifier in the configuration file to the second device identifier, the method further includes: aiming at second test equipment corresponding to the second equipment identification, executing a pre-script of the target application program; the pre-stage operation comprises any one or more of installation of the target application program, resource initialization and account login.
Optionally, before obtaining the second device identifier from the available test device identifiers corresponding to the target container, the method further includes: when monitoring a universal serial bus device insertion message on a test host which deploys the target container, acquiring a device identifier of a current insertion device, and determining the device identifier as an available test device identifier corresponding to the target container; or when the universal serial bus device unplugging message on the test host deploying the target container is monitored, acquiring the device identification of the current unplugged device, and deleting the device identification from the available test device identification corresponding to the target container.
Optionally, when it is detected that the first testing device is abnormal, acquiring a second device identifier from the available testing device identifiers corresponding to the target container, including: and when the first test equipment is detected to be abnormal, acquiring an identifier of equipment with the same preset attribute as the first test equipment from the available test equipment identifier corresponding to the target container, and using the identifier as a second equipment identifier.
Optionally, the method further includes: and sending heartbeat connection to the first test equipment by using the target test server, and determining whether the first test equipment is abnormal or not based on the heartbeat connection result.
Optionally, the target container and the target testing server have a one-to-one correspondence.
Optionally, the server identifier includes an internet protocol address and a port number; the step of determining a target test server corresponding to the test server identifier in response to the application test request carrying the test server identifier includes: responding to an application program test request carrying an internet protocol address and a port number, and determining a test host corresponding to the internet protocol address; determining a target test server corresponding to the port number in the test host; wherein the target test server runs in a target container deployed on the test host.
The present disclosure also provides a device for testing an application program, the device including: the server determining module is used for responding to an application program test request carrying a test server identification and determining a target test server corresponding to the test server identification; wherein the target test server runs in a target container; the first device identifier acquisition module is used for acquiring a first device identifier in the configuration file of the target container, and driving a first test device corresponding to the first device identifier by using the target test server to test a target application program; a second device identifier obtaining module, configured to, when it is detected that the first test device is abnormal, obtain a second device identifier from available test device identifiers corresponding to the target container, and update the first device identifier in the configuration file to the second device identifier; and the program testing module is used for driving second testing equipment corresponding to the second equipment identifier by using the target testing server to test the target application program.
The present disclosure also provides a computer-readable storage medium, in which instructions are stored, and when the instructions are run on a terminal device, the terminal device is enabled to implement the test method of the application program.
The present disclosure also provides an apparatus comprising: the testing method comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein when the processor executes the computer program, the testing method of the application program is realized.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
the embodiment of the disclosure provides a method, a device, equipment and a storage medium for testing an application program, wherein the method comprises the following steps: firstly, responding to an application program test request carrying a test server identification, and determining a target test server corresponding to the test server identification, wherein the target test server runs in a target container; and then, acquiring a first device identifier in the configuration file of the target container, and driving a first test device corresponding to the first device identifier by using the target test server to test the target application program. Then, when the first test equipment is detected to be abnormal, acquiring a second equipment identifier from the available test equipment identifiers corresponding to the target container, and updating the first equipment identifier in the configuration file into the second equipment identifier; and driving second test equipment corresponding to the second equipment identifier by using the target test server to test the target application program. In the above test mode, the target test server runs in a target container, and the configuration file of the container is generally used to store the device identifier of the available device mounted on the container; therefore, after the target testing server is determined based on the testing server identifier, the testing device driven by the target testing server can be determined based on the device identifier in the configuration file, and the testing of the target application program is completed. Obviously, the testing mode provided by the disclosure only occupies one testing device at the same time point, and does not need to occupy multiple testing devices simultaneously, thereby reducing the waste of testing resources.
Further, considering that the configuration file of the container is modifiable, when the first testing device is abnormal, the first testing device can be replaced by an available second testing device by updating the device identifier in the configuration file of the target container, and then the target application program is tested by the second testing device; therefore, the application program testing method provided by the disclosure can effectively solve the problem that the testing process of the application program is influenced due to the interruption of the testing process on the basis of reducing the waste of testing resources.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1A is a schematic diagram of a test platform according to an embodiment of the disclosure;
FIG. 1B is a flowchart illustrating a method for testing an application according to an embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating a method for updating test equipment according to an embodiment of the present disclosure;
FIG. 3 is a block diagram of an apparatus for testing an application according to an embodiment of the present disclosure;
fig. 4 is a block diagram of a device according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
In the process of an automated test for an Application program in a mobile terminal, the inventor researches and discovers that due to long-time running of a test device and other reasons, the test device is easy to generate abnormalities, such as jamming, popping up an Application Not Responding (ANR) dialog box, shutting down a running process and the like. Once the test equipment is abnormal, the test process of the application program is interrupted, and the test flow of the application program is influenced.
For this reason, tests are currently mainly carried out in two ways:
one method is based on the idea of device redundancy, that is, a plurality of test devices are used to test the same application program at the same time, and as long as one test device can successfully complete the test process, the successful test for the application program is indicated. However, the application program test is realized in a device redundancy mode, obviously occupies too many test devices, and is undoubtedly a waste of test resources.
The other mode is that based on a task distribution thought, a test task is divided into a plurality of subtasks in advance, each test device only executes one subtask through scheduling, and when all subtasks are successfully executed, the application program is determined to be successfully tested. However, when the device executing a certain subtask is abnormal, the test cannot be recovered, and the user needs to know which device is abnormal, so as to reschedule a new testing device to execute the subtask again.
Based on this, to improve at least one of the above problems, embodiments of the present disclosure provide a method, an apparatus, a device, and a storage medium for testing an application program, and the embodiments of the present disclosure are described in detail below for easy understanding.
The first embodiment is as follows:
the embodiment of the present disclosure provides a method for testing an application program, which may be implemented on a test platform, for example, referring to fig. 1A, the test platform may be at least deployed with a test host, a container, a test server, and a test device.
In practical application, the containers can be deployed on the test hosts, and at least one container is deployed on one test host; the test server can run in a container, and the container can mount a plurality of test devices.
Referring to the flowchart of the testing method of the application program shown in fig. 1B, the method may include the steps of:
step S102, responding to an application program test request carrying a test server identification, and determining a target test server corresponding to the test server identification; wherein, the target test service end runs in the target container.
In an application scenario of executing an application program test, when only one test host exists, the test server identifier may be a port number of an ADB-server (ADB-server), and based on this, a target test server corresponding to the port number in the test host may be determined in response to an application program test request carrying the port number. When there are multiple test hosts, referring to the solid line part in fig. 1A, the test server identifier may include an IP (internet protocol) address and a port number, and based on this, a test host corresponding to the IP address may be determined in response to an application test request carrying the IP address and the port number; and then determining a target test service end corresponding to the port number in the test host.
And step S104, acquiring a first device identifier in the configuration file of the target container, and driving a first test device corresponding to the first device identifier by using the target test server to test the target application program.
In practical applications, resource allocation and management in a container (docker) depend on a configuration file, and the configuration file is generated by a user configuring available equipment corresponding to the container in advance. Thus, parameters of available devices mounted to the target container may be included in the configuration file, including device identification. The device identifier is a unique and unchangeable identifier representing the test device, taking a mobile phone as the test device as an example, the device identifier may include a master attribute value and a slave attribute value of the mobile phone, the master attribute value is used for representing the type of the mobile phone, and the slave attribute value is used for distinguishing different mobile phones under the same type of the mobile phone.
When a target test server corresponding to the test server identification is determined, a target container of the target test server can be determined to operate, and then a first equipment identification stored in the configuration file is obtained by reading the configuration file of the target container; then, the target test server is used to drive the first test device (e.g., the test device 1 in fig. 1A) corresponding to the first device identifier, so as to test the target application program.
And step S106, when the first test equipment is detected to be abnormal, acquiring a second equipment identifier from the available test equipment identifiers corresponding to the target container, and updating the first equipment identifier in the configuration file into the second equipment identifier.
The method considers that in the test process of the application program, the first test equipment is possibly abnormal, and therefore the test process of the application program is interrupted, and the test flow of the application program is influenced. Based on this, this embodiment can detect first test equipment to when detecting that first test equipment takes place unusually, in time change for second test equipment, guarantee that the test procedure lasts, stable going on. In this embodiment, there may be multiple available test device identifiers corresponding to the target container, and one of the available test device identifiers may be designated as the second device identifier, and the first device identifier in the configuration file is updated to the selected second device identifier.
Step S108, driving a second testing device (e.g., the testing device 2 in fig. 1A) corresponding to the second device identifier by using the target testing server, and testing the target application program.
In this embodiment, the first testing device corresponding to the first device identifier may include at least one testing device; the target test service end is a service process which runs in the background all the time and drives the first test equipment to test the target application program based on the application program test request.
The method for testing the application program provided by the embodiment of the disclosure comprises the steps of firstly responding to an application program test request carrying a test server identification, and determining a target test server corresponding to the test server identification, wherein the target test server runs in a target container; and then, acquiring a first device identifier in the configuration file of the target container, and driving a first test device corresponding to the first device identifier by using the target test server to test the target application program. And then, when the first test equipment is detected to be abnormal, acquiring a second equipment identifier from the available test equipment identifier corresponding to the target container, updating the first equipment identifier in the configuration file into the second equipment identifier, and driving the second test equipment corresponding to the second equipment identifier by using the target test server to test the target application program.
In the above test mode, the target test server runs in a target container, and the configuration file of the container is generally used to store the device identifier of the available device mounted on the container; therefore, after the target testing server is determined based on the testing server identifier, the testing device driven by the target testing server can be determined based on the device identifier in the configuration file, and the testing of the target application program is completed. Obviously, the testing mode provided by the disclosure only occupies one testing device at the same time point, and does not need to occupy multiple testing devices simultaneously, thereby reducing the waste of testing resources. Further, considering that the configuration file of the container is modifiable, when the first test device is abnormal, the first test device can be replaced by a second test device by updating the device identifier in the configuration file, and then the second test device is used for testing the target application program; therefore, the application program testing method provided by the disclosure can effectively solve the problem that the testing process of the application program is influenced due to the interruption of the testing process on the basis of reducing the waste of testing resources.
In order to better understand the testing method of the application program provided by the embodiment of the present disclosure, a detailed description is provided next for the implementation manner of each step described above.
For the above step S102, the application test request may be initiated by the user through the client (ADB-devices), which may be created according to the IP address and the port number, for example, referring to the following codes: a client is an adbClient (host is a host, and a port is a port).
The client transmits an application program test request to the test platform; and the test platform determines a target test server according to the application program test request and the port number and the IP address carried by the application program test request.
In a specific implementation, the following codes may be used: adb-a-P $ PORT server nodal &, realizing external service for a target test service terminal; on the client, the target testing service end is made to process an application program testing request of the client by using ADB-H $ PC1_ ip-P $ PORTshell through an ADB (Android Debug Bridge) tool, and a first testing device is driven to test the target application program. The version of the ADB tool used by the client is the same as that used by the target testing server.
And then determining first test equipment mounted on a target container where the target test server is located, and driving the first test equipment to test the target application program by using the target test server.
The client interacts with the target testing server and transmits an application program testing request to the target testing server. In the prior art, a plurality of test devices are docked by a test server. The more test equipment the test service end is butted with, the higher the probability of disconnection of the test service end is; based on this, in the present embodiment, each testing server is operated in an isolated container, that is, the target container and the target testing server have a one-to-one correspondence, and each testing server is docked with a smaller number of testing devices, for example, only one testing device is docked.
Taking an example that each testing server is butted with one testing device, the testing device butted with each testing server is realized by a container, and it can be understood that only one available testing device butted with the target testing server is bound in each container at any time. Based on this, the present embodiment provides a possible implementation of binding the test device to the container, as shown with reference to the following steps (1) and (2).
(1) All test equipment connected on USB (Universal Serial Bus) is mounted in the target container with reference to the following code:
docker run--rm-d-v/dev/bus/usb:/dev/bus/usb--net host--name adb$PORT_NUM hub.byted.org/toutiao.stf.adb:latest adb-a-P$PORT_NUM server nodaemon。
and in the plurality of test devices mounted in the target container, only the first test device is used for testing the target application program, the other test devices are used as standby, and the replaced available test device is selected from the other test devices under the condition that the first test device is abnormal.
(2) Configuring a first device identifier in a configuration file of a target container; wherein the first device identification is one or more of available test device identifications mounted under the target container.
In one embodiment, firstly, performing activity detection on a plurality of test devices, and acquiring available test devices and an identifier of each available test device, that is, acquiring an identifier of an available test device corresponding to a target container; and then, a first device identification is appointed in the available testing device identifications, and the first device identification is configured in a configuration file of the container. Therefore, the first test equipment corresponding to the first equipment identifier can be bound to the target container.
Specifically, when the test device is a mobile phone, the device identifier may include a major attribute value (major) and a minor attribute value (minor), where the major of the mobile phone is generally 189, which indicates a type of the mobile phone, and the minor is used to distinguish different mobile phones. According to the obtained major and minor of the mobile phone, configuring the following codes in a configuration file of the container:
1#device.allow
2c 189:*rwm#if config like this,will allow all smart phone load in docker
3c 189:25rwm#if config like this,will only allow one phone with mior 25load in docker
the mobile phone determined by major and minor can be bound in the container.
For the available test device identifiers in the foregoing embodiment, the available test device identifiers may be obtained in advance by a write operation and/or a delete operation, which may specifically refer to the following manner:
when monitoring a USB equipment insertion message on a test host for deploying a target container, acquiring an equipment identifier of current insertion equipment, and determining the equipment identifier as an available test equipment identifier corresponding to the target container; or when monitoring the USB device unplugging message on the test host deploying the target container, acquiring the device identifier of the currently unplugged device, and deleting the device identifier from the available test device identifier corresponding to the target container.
In specific implementation, when monitoring a USB device insertion message or a USB device extraction message on a test host that deploys a target container, a loading Path (mount Path) of the test device is obtained, and then a major and a minor of the mobile phone are obtained through the loading Path.
Then, a device identifier may be randomly assigned from the available test device identifiers corresponding to the target container, and the device identifier may be used as the first device identifier and configured in the configuration file of the target container. It is understood that, for the updated second device identifier, the updated second device identifier may also be obtained from the available test device identifier corresponding to the target container and configured in the configuration file of the target container in the same manner.
In consideration of the fact that in the testing process of the application program, the first testing device can be detected, so that when the first testing device is abnormal, the second testing device can be replaced in time, and the testing process is ensured to be continuously and stably carried out. Based on this, the present embodiment provides a detection method for a test device, as shown below:
and sending heartbeat connection to the first test equipment by using the target test server, and determining whether the first test equipment is abnormal or not based on a heartbeat connection result.
In this embodiment, the target test server sends the ADB-P $ PORT shell pwd to the first test device as a heartbeat connection according to a preset period (e.g., 30 seconds); if the first test equipment can normally respond, the first test equipment is not abnormal; if the first test equipment can not respond normally, the first test equipment is abnormal, and the first test equipment needs to be replaced by other available test equipment and bound into the target container.
When detecting that the first test device is abnormal, referring to fig. 2, the present embodiment provides a method for updating the first test device to the second test device, which may include the following steps:
step S202, when the first test equipment is detected to be abnormal, the second equipment identification is obtained from the available test equipment identification corresponding to the target container.
In practical application, a user may have personalized requirements on attributes of test equipment, for example, only for testing an application program of a certain type of mobile phone, the types (i.e., main attribute values) of the mobile phones before and after the user needs to change are the same; in this case, when it is detected that the first test device is abnormal, the identifier of the device having the same preset attribute as the first test device is obtained from the available test device identifiers corresponding to the target container, and the obtained identifier is used as the second device identifier.
Specifically, firstly, acquiring a preset attribute of a user to the test equipment; preset attributes such as cell phone type or cell phone brand. And then according to the mapping relation established in advance, determining a second device identifier of the device with the same preset attribute as the first test device in the available test device identifiers corresponding to the target container. The mapping relation is used for representing the corresponding relation between the equipment identification of the test equipment and the preset attribute; taking a mobile phone as an example, the mapping relationship may be a mapping relationship between a dependency value of the mobile phone and a type of the mobile phone, which is established when the mobile phone is inserted into the container through the USB.
After the second device identifier is acquired, the following step S204 is performed.
Step S204, aiming at the second test equipment corresponding to the second equipment identification, executing the pre-script of the target application program; the pre-stage script is used to implement pre-stage operation of the target application program, and the pre-stage operation may at least include: any one or more of the operations of installing the target application program, initializing the resource and logging in the account; and the pre-script is executed before updating the second test equipment.
In this embodiment, a timeout period (e.g., 30 minutes) of the pre-script may be set, and after the timeout period is reached, the first testing device is replaced with the second testing device, so as to ensure that all pre-operations after the second testing device is replaced are completed.
Step S206, the first device identifier in the configuration file is updated to be the second device identifier. And then, driving second test equipment corresponding to the second equipment identification by using the target test server to test the target application program.
In the replacement method of the test device provided in this embodiment, since the replaced second device identifier belongs to the available test device identifier corresponding to the target container, the second test device corresponding to the second device identifier is inevitably available for testing.
In the above embodiment, the detection of the test equipment is performed between the target test server and the test equipment, the replacement of the test equipment is performed on the target container, and none of the above processes is exposed to the user; therefore, for the user, it is not necessary to care which device the test device is testing, and whether the plurality of test devices mounted on the container have abnormalities such as shutdown, disconnection, false death, offline and the like. The test platform provides an IP address and a port number for a user, can quickly determine a target test service end and available test equipment (available test equipment, namely first test equipment or updated second test equipment) after receiving an application program test request which is initiated by the user and carries the IP address and the port number, and directly drives the determined available test equipment by using the target test service end to test the target application program.
In summary, the method for testing an application program provided in the above embodiment can directly determine the target test server based on the application program test request carrying the test server identifier, and use the target test server to drive the first test device to test the target application program. Obviously, the testing mode provided by the disclosure does not need to occupy multiple testing devices simultaneously, and reduces the waste of testing resources. In the testing process of the application program, considering that the configuration file of the container is modifiable, when the first testing device is abnormal, the first testing device can be replaced by an available second testing device by modifying the device identifier in the configuration file of the target container, and then the target application program is tested by using the second testing device; therefore, the application program testing method provided by the disclosure can effectively solve the problem that the testing process of the application program is influenced due to the interruption of the testing process on the basis of reducing the waste of testing resources.
Example two:
the present embodiment provides a testing apparatus for an application program, which is used to implement the testing method for an application program in the first embodiment. Referring to fig. 3, the apparatus includes:
a server determining module 302, configured to determine, in response to an application program test request carrying a test server identifier, a target test server corresponding to the test server identifier; the target test server runs in the target container;
a first device identifier obtaining module 304, configured to obtain a first device identifier in a configuration file of a target container, and drive, by using a target test server, a first test device corresponding to the first device identifier to test a target application program;
a second device identifier obtaining module 306, configured to, when it is detected that the first test device is abnormal, obtain a second device identifier from available test device identifiers corresponding to the target container, and update the first device identifier in the configuration file to the second device identifier;
and the program testing module 308 is configured to drive, by using the target testing server, the second testing device corresponding to the second device identifier to test the target application program.
The testing device for the application program provided by the embodiment of the disclosure can determine the target testing server based on the testing server identification, and directly drive the available testing equipment to test the target application program by using the target testing server. In the test mode, only one test device is occupied at the same time point, a plurality of test devices are not required to be occupied at the same time, and waste of test resources is reduced. Further, considering that the configuration file of the container is modifiable, when the first testing device is abnormal, the first testing device can be replaced by an available second testing device by updating the device identifier in the configuration file of the target container, and then the target application program is tested by the second testing device; therefore, the application program testing method provided by the disclosure can effectively solve the problem that the testing process of the application program is influenced due to the interruption of the testing process on the basis of reducing the waste of testing resources.
In an embodiment, the second device identification obtaining module 306 is further configured to: aiming at second test equipment corresponding to the second equipment identification, executing a pre-script of the target application program; the preset script is used for realizing the preset phase operation of the target application program, and the preset phase operation comprises any one or more of the operations of installing the target application program, initializing resources and logging in an account.
In one embodiment, the apparatus further includes a listening module (not shown in the figure) configured to: when monitoring a universal serial bus equipment insertion message on a test host for deploying a target container, acquiring an equipment identifier of current insertion equipment, and determining the equipment identifier as an available test equipment identifier corresponding to the target container; or when the universal serial bus device unplugging message on the test host for deploying the target container is monitored, acquiring the device identifier of the currently unplugged device, and deleting the device identifier from the available test device identifier corresponding to the target container.
In an embodiment, the second device identifier obtaining module 306 is further configured to: when the first test equipment is detected to be abnormal, the identification of the equipment with the same preset attribute as the first test equipment is obtained from the available test equipment identification corresponding to the target container and is used as the second equipment identification.
In one embodiment, the apparatus further comprises an anomaly detection module (not shown) configured to: and sending heartbeat connection to the first test equipment by using the target test server, and determining whether the first test equipment is abnormal or not based on a heartbeat connection result.
In one embodiment, the server identifier includes an internet protocol address and a port number; the server determining module 302 is further configured to: responding to an application program test request carrying an internet protocol address and a port number, and determining a test host corresponding to the internet protocol address; determining a target test server corresponding to the port number in the test host; wherein the target test server runs in a target container deployed on the test host.
The device provided in this embodiment has the same implementation principle and technical effect as those of the first embodiment of the method, and for the sake of brief description, reference may be made to corresponding contents of the first embodiment of the method where no part is mentioned in this embodiment.
Based on the foregoing embodiments, this embodiment provides a computer-readable storage medium, where instructions are stored, and when the instructions are run on a terminal device, the terminal device is enabled to implement the method for testing an application program provided in the foregoing embodiments.
This embodiment also provides an apparatus, comprising: the testing method of the application program provided by the embodiment is realized when the processor executes the computer program. Referring to fig. 4, the apparatus may include:
a processor 401, a memory 402, an input device 403, and an output device 404. The number of processors 401 in the atlas handling apparatus may be one or more, and one processor is taken as an example in fig. 4. In some embodiments of the present invention, the processor 401, the memory 402, the input device 403, and the output device 404 may be connected by a bus or other means, wherein the connection by the bus is illustrated in fig. 4.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing of the album packaging apparatus by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. The input device 403 may be used to receive entered numeric or character information and to generate signal inputs relating to user settings and functional control of the album packaging apparatus.
Specifically, in this embodiment, the processor 401 loads an executable file corresponding to one or more processes of an application program into the memory 402 according to the following instructions, and the processor 401 runs the application program stored in the memory 402, thereby implementing various functions of the above-described atlas packaging apparatus.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely 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. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for testing an application, the method comprising:
responding to an application program test request carrying a test server identification, and determining a target test server corresponding to the test server identification; wherein the target test server runs in a target container;
acquiring a first device identifier in a configuration file of the target container, and driving a first test device corresponding to the first device identifier by using the target test server to test a target application program;
when the first test equipment is detected to be abnormal, acquiring a second equipment identifier from available test equipment identifiers corresponding to the target container, and updating the first equipment identifier in the configuration file into the second equipment identifier;
and driving second test equipment corresponding to the second equipment identification by using the target test server to test the target application program.
2. The method of claim 1, wherein after the obtaining the second device identifier and before the updating the first device identifier in the configuration file to the second device identifier, further comprising:
aiming at second test equipment corresponding to the second equipment identification, executing a pre-script of the target application program; the pre-stage operation comprises any one or more of installation of the target application program, resource initialization and account login.
3. The method according to claim 1, wherein before obtaining the second device identifier from the available test device identifiers corresponding to the target container, the method further comprises:
when monitoring a universal serial bus device insertion message on a test host which deploys the target container, acquiring a device identifier of a current insertion device, and determining the device identifier as an available test device identifier corresponding to the target container;
or when the universal serial bus device unplugging message on the test host deploying the target container is monitored, acquiring the device identification of the current unplugged device, and deleting the device identification from the available test device identification corresponding to the target container.
4. The method according to claim 1, wherein when it is detected that the first test device is abnormal, acquiring a second device identifier from available test device identifiers corresponding to the target container, including:
and when the first test equipment is detected to be abnormal, acquiring an identifier of equipment with the same preset attribute as the first test equipment from the available test equipment identifier corresponding to the target container, and using the identifier as a second equipment identifier.
5. The method of claim 1, further comprising:
and sending heartbeat connection to the first test equipment by using the target test server, and determining whether the first test equipment is abnormal or not based on the heartbeat connection result.
6. The method of claim 1, wherein the target container has a one-to-one correspondence with the target test service.
7. The method of claim 1, wherein the server-side identification comprises an internet protocol address and a port number; the step of determining a target test server corresponding to the test server identifier in response to the application test request carrying the test server identifier includes:
responding to an application program test request carrying an internet protocol address and a port number, and determining a test host corresponding to the internet protocol address;
determining a target test server corresponding to the port number in the test host; wherein the target test server runs in a target container deployed on the test host.
8. An apparatus for testing an application, the apparatus comprising:
the server determining module is used for responding to an application program test request carrying a test server identification and determining a target test server corresponding to the test server identification; wherein the target test server runs in a target container;
the first device identifier acquisition module is used for acquiring a first device identifier in the configuration file of the target container, and driving a first test device corresponding to the first device identifier by using the target test server to test a target application program;
a second device identifier obtaining module, configured to, when it is detected that the first test device is abnormal, obtain a second device identifier from available test device identifiers corresponding to the target container, and update the first device identifier in the configuration file to the second device identifier;
and the program testing module is used for driving second testing equipment corresponding to the second equipment identifier by using the target testing server to test the target application program.
9. A computer-readable storage medium having stored therein instructions which, when run on a terminal device, cause the terminal device to implement the method of any one of claims 1-7.
10. An apparatus, comprising: memory, a processor, and a computer program stored on the memory and executable on the processor, when executing the computer program, implementing the method of any of claims 1-7.
CN202011166639.9A 2020-10-27 2020-10-27 Application program testing method, device, equipment and storage medium Active CN112214413B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011166639.9A CN112214413B (en) 2020-10-27 2020-10-27 Application program testing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011166639.9A CN112214413B (en) 2020-10-27 2020-10-27 Application program testing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112214413A true CN112214413A (en) 2021-01-12
CN112214413B CN112214413B (en) 2024-01-16

Family

ID=74057112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011166639.9A Active CN112214413B (en) 2020-10-27 2020-10-27 Application program testing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112214413B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113010060A (en) * 2021-03-17 2021-06-22 杭州遥望网络科技有限公司 Task execution method, device and equipment of application program and readable storage medium
CN113485905A (en) * 2021-02-26 2021-10-08 杜自然 Test method, device, equipment and computer storage medium in data transaction

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150245194A1 (en) * 2014-02-23 2015-08-27 Samsung Electronics Co., Ltd. Method of searching for device between electronic devices
US20170270031A1 (en) * 2016-03-15 2017-09-21 Fujitsu Limited Information processing apparatus, test execution method, and computer-readable recording medium
US20180285247A1 (en) * 2017-03-29 2018-10-04 The Travelers Indemnity Company Systems, methods, and apparatus for automated code testing
US20180365133A1 (en) * 2017-06-14 2018-12-20 T-Mobile Usa, Inc. Continuous integration testing for network-based applications
CN109726107A (en) * 2018-06-01 2019-05-07 平安普惠企业管理有限公司 Test method, device, equipment and storage medium
CN110688202A (en) * 2019-10-09 2020-01-14 腾讯科技(深圳)有限公司 Service process scheduling method, device, equipment and storage medium
CN110838953A (en) * 2019-11-01 2020-02-25 北京字节跳动网络技术有限公司 Test method, test system, electronic equipment and storage medium
CN111400131A (en) * 2020-03-06 2020-07-10 苏州浪潮智能科技有限公司 Performance detection method and system of AI server, electronic equipment and storage medium
CN111597112A (en) * 2020-04-30 2020-08-28 北京金山云网络技术有限公司 Automatic test method and device and electronic equipment
CN111639019A (en) * 2020-04-24 2020-09-08 北京五八信息技术有限公司 Code testing method and device and readable storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150245194A1 (en) * 2014-02-23 2015-08-27 Samsung Electronics Co., Ltd. Method of searching for device between electronic devices
US20170270031A1 (en) * 2016-03-15 2017-09-21 Fujitsu Limited Information processing apparatus, test execution method, and computer-readable recording medium
US20180285247A1 (en) * 2017-03-29 2018-10-04 The Travelers Indemnity Company Systems, methods, and apparatus for automated code testing
US20180365133A1 (en) * 2017-06-14 2018-12-20 T-Mobile Usa, Inc. Continuous integration testing for network-based applications
CN109726107A (en) * 2018-06-01 2019-05-07 平安普惠企业管理有限公司 Test method, device, equipment and storage medium
CN110688202A (en) * 2019-10-09 2020-01-14 腾讯科技(深圳)有限公司 Service process scheduling method, device, equipment and storage medium
CN110838953A (en) * 2019-11-01 2020-02-25 北京字节跳动网络技术有限公司 Test method, test system, electronic equipment and storage medium
CN111400131A (en) * 2020-03-06 2020-07-10 苏州浪潮智能科技有限公司 Performance detection method and system of AI server, electronic equipment and storage medium
CN111639019A (en) * 2020-04-24 2020-09-08 北京五八信息技术有限公司 Code testing method and device and readable storage medium
CN111597112A (en) * 2020-04-30 2020-08-28 北京金山云网络技术有限公司 Automatic test method and device and electronic equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113485905A (en) * 2021-02-26 2021-10-08 杜自然 Test method, device, equipment and computer storage medium in data transaction
CN113485905B (en) * 2021-02-26 2023-09-05 杜自然 Test method, device, equipment and computer storage medium in data transaction
CN113010060A (en) * 2021-03-17 2021-06-22 杭州遥望网络科技有限公司 Task execution method, device and equipment of application program and readable storage medium

Also Published As

Publication number Publication date
CN112214413B (en) 2024-01-16

Similar Documents

Publication Publication Date Title
US11474829B2 (en) Customizing program logic for booting a system
US8332496B2 (en) Provisioning of operating environments on a server in a networked environment
US9182998B2 (en) Remote bios update in system having multiple computers
CN107769949B (en) Application component deployment method and deployment node
CN106817411B (en) Service access request processing method and related equipment
EP2237480B1 (en) Computer system and method for supporting network-enabled devices
CN110765026A (en) Automatic testing method and device, storage medium and equipment
CN111124286A (en) Libcloud-based multi-cloud management implementation method
US10459742B2 (en) System and method for operating system initiated firmware update via UEFI applications
CN112214413A (en) Application program testing method, device, equipment and storage medium
CN111338698A (en) Method and system for accurately booting server by BIOS (basic input output System)
WO2023098052A1 (en) Server operation and maintenance method and apparatus, and device and storage medium
CN107688479B (en) Android system network cluster, construction method thereof, and Android system network cluster data processing method and system
CN109669727B (en) Server configuration method, system and related components
US9317273B2 (en) Information processing apparatus and information processing method
US20240111579A1 (en) Termination of sidecar containers
CN111767082A (en) Computing chip starting method and device and computer system
CN110688130A (en) Physical machine deployment method, physical machine deployment device, readable storage medium and electronic equipment
US20240160425A1 (en) Deployment of management features using containerized service on management device and application thereof
CN115827035A (en) Equipment upgrading method and device, storage medium and electronic device
CN106506276A (en) A kind of information detecting method for server
EP4086756A1 (en) Method and apparatus for processing virtual machine component
US20240036896A1 (en) Generating installation images based upon dpu-specific capabilities
US20240020103A1 (en) Parallelizing data processing unit provisioning
CN113010439B (en) Equipment factory detection method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant