CN111355632A - SIPP-based performance test method and device, computer equipment and storage medium - Google Patents

SIPP-based performance test method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN111355632A
CN111355632A CN202010102160.2A CN202010102160A CN111355632A CN 111355632 A CN111355632 A CN 111355632A CN 202010102160 A CN202010102160 A CN 202010102160A CN 111355632 A CN111355632 A CN 111355632A
Authority
CN
China
Prior art keywords
test
sipp
user agent
test case
calling
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
CN202010102160.2A
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 Vanrui Intelligent Technology Co ltd
Original Assignee
Shenzhen Vanrui Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Vanrui Intelligent Technology Co ltd filed Critical Shenzhen Vanrui Intelligent Technology Co ltd
Priority to CN202010102160.2A priority Critical patent/CN111355632A/en
Publication of CN111355632A publication Critical patent/CN111355632A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/06Generation of reports
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/42Mailbox-related aspects, e.g. synchronisation of mailboxes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/10Architectures or entities
    • H04L65/1045Proxies, e.g. for session initiation protocol [SIP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • H04L65/1101Session protocols
    • H04L65/1104Session initiation protocol [SIP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention discloses a performance testing method and a device based on SIPP, a computer device and a storage medium, wherein the method comprises the following steps: building a SIPP tool, a Python environment and a communication scheduling system; installing a driver for connecting a database, introducing a database connection module in a Python environment, remotely connecting the database, creating a storage process and creating a large batch of test data; simulating a user agent client and a user agent server by using a test case script in a Python environment; packaging a log module and a mail module in a Python environment, and introducing HTMLTestRunner and mkdocs definition test reports; running test case scripts, and running the test cases in parallel according to the sequence of first registration and then calling; and acquiring a webpage version test log and a test report. The time wasted by manually adding a large amount of data in the CSV file is saved, and the error rate is reduced; the test logs and the test reports can be stored locally, so that the test logs and the test reports can be conveniently consulted and checked in future; the test results can be sent and viewed through custom mails.

Description

SIPP-based performance test method and device, computer equipment and storage medium
Technical Field
The invention relates to the technical field of multimedia scheduling communication, in particular to a performance testing method, a device and a system based on SIPP and a storage medium.
Background
With the popularization and development of communication products, the performance of the dispatch communication system is receiving more and more attention and attention from users. In the testing process of the dispatching communication system, in order to meet the requirement of performance indexes of products, testers need to comprehensively test the overall performance of the dispatching communication system, and can check, accept and release the dispatching communication system after the dispatching communication system reaches the standard.
SIP software is an open source test tool software (see further websites: sip.sourceforce.net) that contains some basic SIP phone user agent workflows (UAC and UAS) and can use INVITE and BYE commands to set up and release multiple calls. It may also read a scene file in XML format, i.e. a configuration file describing any performance test. It can dynamically display the statistics of the test run (call rate, round-trip delay, and message statistics), periodically dump the CSV statistics, TCP and UDP over multiple sockets, and multiplex with retransmission management. Regular expressions may be used in the context definition file to dynamically adjust the call rate. The SIPp software can be used to test many real SIP devices such as SIP proxies, B2BUAs, SIP media servers, SIP/x gateways, SIP pbxs, etc., and it can also emulate thousands of SIP proxy call SIP systems. However, testing in this manner has several disadvantages:
1. test data needs to be added into the CSV file manually, and when the test data volume is very large, the method obviously wastes time;
2. in the testing process, the change of the testing data of the SIPP software needs to be observed manually in real time, and the testing results need to be manually sorted and summarized. This significantly reduces testing efficiency and increases labor and time investment.
The information disclosed in this background section is only for enhancement of understanding of the general background of the invention and should not be taken as an acknowledgement or any form of suggestion that this information forms the prior art already known to a person skilled in the art.
Based on the reasons, the invention provides a performance testing method, a device and a system based on SIPP and a storage medium.
Disclosure of Invention
In order to meet the requirements, the first object of the invention is to provide a performance testing method based on the SIPP, the method aims to build the SIPP and Python, build a communication scheduling system on linux, introduce mysql.connector module into Python, remotely connect a database, write and store a large batch of new test data in the process, write and store codes in Python to directly read data in the database, save time wasted by adding a large amount of data in a CSV file manually, and reduce error rate. The method comprises the steps of reading test data through a Python code, introducing a unittest frame into the Python, compiling a test script in the unittest frame, calling the SIPP to perform performance test, packaging a log module and a mail module in the Python, introducing HTMLTestRunner and mkdocs, realizing log real-time output in the test process and test report netpage after the test is completed, and storing the test log and the test report to the local to facilitate subsequent reference. The test result can be checked through a custom mail.
The second purpose of the invention is to provide a performance testing device based on SIPP.
A third object of the present invention is to provide a SIPP-based performance testing computer apparatus.
It is a fourth object of the invention to provide a non-transitory computer readable storage medium having a computer program stored thereon.
In order to achieve the purpose, the invention adopts the following technical scheme:
in a first aspect, a SIPP-based performance testing method is provided, which includes the following steps:
building a SIPP tool, a Python environment and a communication scheduling system;
installing a driver for connecting a database, introducing a database connection module in a Python environment, remotely connecting the database, creating a storage process and creating a large batch of test data;
simulating a user agent client and a user agent server by using a test case script in a Python environment;
packaging a log module and a mail module in a Python environment, and introducing HTMLTestRunner and mkdocs definition test reports;
running test case scripts, and running the test cases in parallel according to the sequence of first registration and then calling;
and acquiring a webpage version test log and a test report.
In a possible embodiment, the step of building the SIPP tool, the Python environment and the communication scheduling system further includes building the SIPP tool on a linux system or a Windows system, installing Phthon on the Windows system, and building the communication scheduling system on the linux environment.
In a possible embodiment, the step of introducing a database connection module in the Python environment and remotely connecting the database includes introducing the database connection module through an import statement, configuring the relevant information of the database through a config statement, and acquiring the connection with the database through a connect statement.
In a possible embodiment, the step of simulating the user agent client and the user agent server by using the test case script in the Python environment comprises introducing a unittest frame in the Python environment, and newly building a registration test suite and a call test suite in the unittest frame, wherein the registration test suite is used for writing a main registration test case script and a registered test case script, the call test suite comprises a main call test suite and a called test suite, the called test suite is used for writing a called test case script, and the main call test suite is used for writing a main call test case script.
In one possible embodiment, the method further comprises the steps of performing packet capture analysis on partial data packets in the test script by using a wireshark tool;
and the step of packet capturing analysis comprises the steps of taking a calling party, a called party and a core network as a whole when the service platform needs to be tested and is not limited by the core network, and compiling a test script by capturing a packet of the SIP foreground server as a reference.
In a possible embodiment, when the calling network, the called network and the core network are taken as a whole, the flow included in the calling test case script and the called test case script includes:
the user agent client sends an INVITE type request message to a service platform through an sdp protocol, and the user agent server obtains the request message through the service platform;
the user agent server returns 108 message codes to the user agent client by using the service platform;
the user agent server transmits the message to a service platform through a mechanism for ensuring reliable transmission of the temporary message in the SIP message, and the service platform returns a 200 message code to the user agent client;
the user agent server sends an INVITE type message to a service platform through an sdp protocol;
the service platform sends request messages of ACK and INVITE types to a user agent server;
the user agent server returns 200 message codes to the service platform through the sdp protocol;
and 2 times of update interaction process is carried out between the user agent client and the service platform, the user agent client sends an ACK request message to the service platform to reach the user agent server, and the user agent server returns a 200 message code.
In a possible embodiment, the step of running the test cases in parallel according to the sequence of first registering and then calling by running the test case script includes:
and running the test case script by using a unittest framework in Python, running the main registered test case script and the registered test case script at one time, and running the test cases in parallel according to the sequence of first registration and then calling to obtain a corresponding test result.
In a possible embodiment, the step of running the main registered test case script and the registered test case script at one time and running the test cases in parallel according to the sequence of first registration and then calling comprises:
obtaining the test information of the SIPP tool through a unittest frame in the Python environment, and calling the SIPP tool by using a main calling test case script and a called test case script to register a calling party and a called party to a dispatching communication system at the same time;
simultaneously registering a calling party and a called party in a dispatching communication system through the main calling test case script and the called test case script to carry out performance test;
after the registration is successful, calling a called test case script in the call test suite, and operating a called party in a dispatching communication system by utilizing the SIPP tool;
calling a main call test case script in the call test suite and calling the SIPP tool to operate a calling party in a dispatching communication system;
a calling party initiates a call, a called party answers and a call is established; and obtaining a corresponding test result through the call condition.
In a possible embodiment, the step of encapsulating the log module and the mail module in the Python environment and introducing the HTMLTestRunner, mkdocs definition test report further includes:
a common module is newly built in Python, then a Mylog module for recording logs and a SendMail module for sending and receiving mails are respectively packaged, an output format and log levels are set for log types, log output is carried out, and the problems of real-time information viewing and tracking positioning are realized;
defining a report style, a report name and report content by using an mkdocs static site generator, and defining a path in which a file absolute path of a test report is mapped to a mirror image of the mkdocs static site generator in an HTMLTestRunner;
defining a main registration test case script and a registered script case to be executed in parallel in a Python code, and executing the main calling test case script and the called test case script only after the main registration test case script and the registered script case are executed;
a test data reading mode is defined in Python, and a large amount of test data newly built in a storage process is used by reading a remote connection database.
In a possible embodiment, the step of obtaining the web page version test log and the test report further includes obtaining the test report of the HTML file in a test report path defined by the tmltestrunner.
In another aspect, the present invention further provides a SIPP-based performance testing apparatus, including the following units:
the environment building unit is used for building a SIPP tool, a Python environment and a communication scheduling system;
the data connection unit is used for installing a driver used for connecting a database, introducing a database connection module in a Python environment, remotely connecting the database, creating a storage process and newly building a large batch of test data;
the call simulation unit is used for simulating the user agent client and the user agent server by using the test case script in the Python environment;
the module encapsulation unit is used for encapsulating the log module and the mail module in a Python environment and introducing HTMLTestRunner and mkdocs definition test reports;
the operation test unit is used for operating the test case script and parallelly operating the test cases according to the sequence of first registration and then calling;
and the report acquisition unit is used for acquiring the webpage version test log and the test report.
In another aspect, the present invention further discloses a SIPP-based performance testing system, which includes a memory, a processor and a performance testing program stored in the memory and capable of running on the processor, wherein when the performance testing program is executed by the processor, the SIPP-based performance testing method is implemented as any one of the above methods.
In another aspect, the present invention also proposes a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a SIPP-based performance testing method as described in any one of the above.
Compared with the prior art, the invention has the beneficial effects that: by adopting the performance test method, the SIPP and the Python are built in the windows environment, and the communication scheduling system is built on linux; a mysql connector module is introduced into Python, remote connection of a database is achieved, new large-batch test data are created by using a writing and storing process, and time wasted by adding a large amount of data in a CSV file manually is saved. Reading test data through Python codes, introducing a unittest frame into Python, writing test script simulation UAC and UAS in the test script simulation UAC and UAS, creating a registration test suite and a call test suite in the unittest, creating a test case script in the test suite, running the test case script in parallel according to the sequence of first registration and then calling, calling SIPP to perform performance test, packaging a log module and a mail module in the Python, introducing HTMLTestRunner and mkdocs, defining a log output format, a storage position, a report style, a report name, report content, a report storage position and the like, realizing the real-time output of logs in the test process and the netpage test report after the test is completed, facilitating subsequent reference, and enabling test results to be checked through self-defined mails. The method can record the test data and the execution condition dynamically presented by the SIPP in real time, and is convenient for uniformly summarizing the test result and checking the test result in future. In addition, compared with the observation of naked eyes, the potential performance problem of the dispatching communication system can be more easily found by analyzing the test data within a certain time range, the operation safety of the dispatching communication system is improved,
in conclusion, the scheme has the following advantages:
1. by adopting a mode of remotely connecting a database in Python, newly building a large amount of test data in the storage process, and then writing codes in Python to directly read the data in the database, the time wasted by adding a large amount of data in a CSV file manually is saved, and the error rate is also reduced;
2. a log module and a mail module are packaged in Python, HTMLTestRunner and mkdocs are introduced, log real-time output in the test process and test report netpage after the test is finished are realized, and the test log and the test report can be stored locally, so that the test log and the test report can be conveniently consulted and checked in future;
3. the test results can be sent and viewed through custom mails.
The invention is further described below with reference to the accompanying drawings and specific embodiments.
Drawings
FIG. 1 is a flow chart of a SIPP-based performance testing method according to an embodiment of the present invention;
FIG. 2 is a block diagram of an embodiment of a SIPP-based Performance test apparatus according to the present invention;
FIG. 3 is a block diagram of an embodiment of a SIPP-based Performance test computer apparatus of the present invention;
FIG. 4 is a block diagram of one embodiment of a non-transitory computer readable storage medium according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
As shown in the method flowchart of fig. 1, a specific embodiment of the SIPP-based performance testing method provided by the present invention is schematically illustrated, and the method includes the following steps:
step S1, building a SIPP tool, a Python environment and a communication scheduling system;
step S2, installing a driver for connecting a database, introducing a database connection module in a Python environment, remotely connecting the database, creating a storage process and creating a large batch of test data;
step S3, simulating a user agent client and a user agent server by using a test case script in a Python environment;
step S4, packaging a log module and a mail module in a Python environment, and introducing HTMLTestRunner and mkdocs definition test reports;
step S5, running the test case script, and running the test cases in parallel according to the sequence of first registration and then calling;
and step S6, acquiring the webpage version test log and the test report.
As an optional implementation manner, step S1 further includes building a SIPP tool on the linux system or the Windows system, installing Phthon on the Windows system, and building a communication scheduling system in the linux environment.
Specifically, because the construction of the SIPP tool on the linux system is more complex than the construction flow on the windows system, the construction on the windows system is selected in a better implementation mode; the construction of the SIPP tool comprises installation of windows clients of cygwin and WinPcap, SIPP-win64, ipv6 and the like.
As a preferred embodiment, step S2 includes introducing the database connection module through an import statement, configuring the database related information through a config statement, and acquiring the connection with the database through a connect statement.
Specifically, after the Python and the pycharm are installed, mysql-connector-Python-1.0.12-py3.3 needs to be installed;
when the installation of the driver mysql-connector-Python-1.0.12-py3.3 is completed, a newly-created py file is introduced into a mysql.connector module (i.e. the database connection module in step S2) through import, and the relevant information of the database to be connected is configured through a config statement, wherein the relevant information of the database includes ip, port number, user name, password, library name, and the like.
When the configuration of the database information is completed, connection with the database is obtained through a connect statement, a storage process is compiled after remote connection to create new test data in large batch, and the data are stored in a database corresponding table.
By adopting the steps of the scheme, the traditional method (filling a large amount of test data in the xml file by hand) is avoided, and a large amount of time is saved.
In other embodiments, other drivers may be used to implement the remote connection of the database, and the drivers are not specifically limited herein because they are intended to implement the connection.
In a preferred embodiment, the step of simulating the user agent client and the user agent server (i.e., UAC and UAS) by using the test case script in the Python environment includes introducing a unittest framework in the Python environment, and newly building a registration test suite and a call test suite in the unittest framework, where the registration test suite is used to write a main registration test case script and a registered test case script, the call test suite includes a main call test suite and a called test suite, the called test suite is used to write a called test case script, and the main call test suite is used to write a main call test case script.
In one possible embodiment, the method further comprises the steps of performing packet capture analysis on partial data packets in the test script by using a wireshark tool;
and the step of packet capturing analysis comprises the steps of taking a calling party, a called party and a core network as a whole when the service platform needs to be tested and is not limited by the core network, and compiling a test script by capturing a packet of the SIP foreground server as a reference. The messages sent to the SIP foreground by the user agent client and the user agent server are in a message form that real calling and called messages are sent to the SIP foreground after passing through a core network.
In a preferred embodiment, when the calling network, the called network and the core network are taken as a whole, the flow included in the calling test case script and the called test case script includes:
the user agent client sends an INVITE type request message to a service platform through an sdp protocol, and the user agent server obtains the request message through the service platform;
the user agent server returns 108 message codes to the user agent client by using the service platform;
the user agent server transmits the message to a service platform through a mechanism for ensuring reliable transmission of the temporary message in the SIP message, and the service platform returns a 200 message code to the user agent client;
the user agent server sends an INVITE type message to a service platform through an sdp protocol;
the service platform sends request messages of ACK and INVITE types to a user agent server;
the user agent server returns 200 message codes to the service platform through the sdp protocol;
and 2 times of update interaction process is carried out between the user agent client and the service platform, the user agent client sends an ACK request message to the service platform to reach the user agent server, and the user agent server returns a 200 message code.
Specifically, the user agent client and the user agent server are both generated in step S3 by simulation.
In one possible embodiment, the step S5 includes:
and running the test case script by using a unittest framework in Python, running the main registered test case script and the registered test case script at one time, and running the test cases in parallel according to the sequence of first registration and then calling to obtain a corresponding test result.
The specific implementation mode is that unit test in python is used for running a test case script, the unit test. testsuite adds a corresponding test case script, unit test. texttestrunner is used for defining a runner, and then main and registered scripts are run at one time through runner. And (4) running the test cases in parallel according to the sequence of first registration and then calling to obtain a corresponding test result.
In a possible embodiment, the step of running the main registered test case script and the registered test case script at one time and running the test cases in parallel according to the sequence of first registration and then calling comprises:
obtaining the test information of the SIPP tool through a unittest frame in the Python environment, and calling the SIPP tool by using a main calling test case script and a called test case script to register a calling party and a called party to a dispatching communication system at the same time;
simultaneously registering a calling party and a called party in a dispatching communication system through the main calling test case script and the called test case script to carry out performance test;
after the registration is successful, calling a called test case script in the call test suite, and operating a called party in a dispatching communication system by utilizing the SIPP tool;
calling a main call test case script in the call test suite and calling the SIPP tool to operate a calling party in a dispatching communication system;
a calling party initiates a call, a called party answers and a call is established; and obtaining a corresponding test result through the call condition.
As a preferred embodiment, the step S4 further includes:
a common module is newly built in Python, then a Mylog module for recording logs and a SendMail module for sending and receiving mails are respectively packaged, an output format and log levels are set for log types, log output is carried out, and the problems of real-time information viewing and tracking positioning are realized;
defining a report style, a report name and report content by using an mkdocs static site generator, and defining a path in which a file absolute path of a test report is mapped to a mirror image of the mkdocs static site generator in an HTMLTestRunner;
defining a main registration test case script and a registered script case to be executed in parallel in a Python code, and executing the main calling test case script and the called test case script only after the main registration test case script and the registered script case are executed;
a test data reading mode is defined in Python, a large amount of test data newly built in a storage process is used by reading a remote connection database, and manual test data in a CSV file are not read.
Specifically, 2 handles are created in the log class, one is a FileHandler and the other is a StreamHandler, and the handles are respectively used for setting an output format and a log level;
and adding the handler to the loader by using an addHandler method, and simultaneously writing the log into a file and outputting the log to a console, so that the problems of information checking, tracking and positioning are conveniently and real-timely solved.
The send _ mail method in the mail class SendMail sends and receives mails, generates an object msg containing a plurality of mail bodies through the email.
When the process is completed, the HTMLTestRunner is introduced, and corresponding codes are written to define stream, test suite use case execution modes and the like.
And installing an mkdocs static site generator, mounting the data volume to a local ip carrying a test report, and operating the 8000 port of the local 8000 port mapping container and the data volume in a daemon process mode.
The method comprises the steps of creating an mkdocs.yml file, writing a small amount of codes to define a REPORT style, a REPORT name, REPORT contents and the like, opening a cs.yml _ REPORT, namely the mkdocs.yml file, in the codes by a method of writing the files, judging whether the currently written contents exist in the files, defining a corresponding data format, and reporting the name and the contents to be presented.
And then defining a file absolute path of a test report in the HTMLTestRunner to be mapped to a path in an mkdocs static site generator mirror image. The Python code defines the use case of the calling registration script and the use case of the called registration script to be executed in parallel, and the execution of the script of the calling use case and the script of the called use case is carried out only after the execution of the script of the calling use case and the script of the called use case is finished. Then, a test data reading mode is defined in the python script, and instead of reading the manual test data in the CSV file, a large amount of test data newly created in the storage process is used by remotely connecting the database in the reading step S2.
In a preferred embodiment, the step S6 further includes checking the log in a python command line window during the test, and directly checking the detailed log information during the test in a local log file after the script is executed.
The test report can be viewed in the test report path defined by HTMLTestRunne in step S4, and reported as an HTML file. By adopting the method, the test data and the execution condition dynamically presented by the SIPP can be recorded in real time, and the test results can be conveniently and uniformly summarized for later viewing. In addition, compared with the observation of naked eyes, the potential performance problem of the dispatching communication system can be found more easily by analyzing the test data within a certain time range, and the operation safety of the dispatching communication system is improved.
On the other hand, as shown in fig. 2, a SIPP-based performance testing apparatus further proposed by the present invention includes the following units:
the environment building unit 100 is used for building a SIPP tool, a Python environment and a communication scheduling system;
the data connection unit 200 is used for installing a driver for connecting a database, introducing a database connection module in a Python environment, remotely connecting the database, creating a storage process and newly building a large batch of test data;
a call simulation unit 300, configured to simulate a user agent client and a user agent server by using a test case script in a Python environment;
the module packaging unit 400 is used for packaging the log module and the mail module in a Python environment and introducing HTMLTestRunner and mkdocs definition test reports;
the running test unit 500 is used for running test case scripts and running test cases in parallel according to the sequence of first registration and then calling;
a report obtaining unit 600, configured to obtain a web page version test log and a test report.
The environment building unit 100, the data connection unit 200, the call simulation unit 300, the module packaging unit 400, the operation test unit 500, and the report obtaining unit 600 are all used for executing steps S1-S6 shown in fig. 1 to achieve the test purpose of the present disclosure, and in addition, the unit 100 and the unit 600 may include, but are not limited to, an operation interface and the like.
On the other hand, as shown in fig. 3, a SIPP-based performance testing system disclosed in the present invention further includes a memory 700, a processor 800, and a performance testing program stored in the memory 700 and executable on the processor 800, wherein the performance testing program, when executed by the processor, implements the SIPP-based performance testing method as described in any one of the above.
The Memory 700 may be a Read-Only Memory (ROM) or other types of static storage devices that can store static information and instructions, a Random Access Memory (RAM) or other types of dynamic storage devices that can store information and instructions, an Electrically Erasable Programmable Read-Only Memory (EEPROM), a compact disc Read-Only Memory (CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disks, blu-ray disks, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory may be self-contained and coupled to the processor via a communication bus. The memory may also be integral to the processor.
In another aspect, as shown in fig. 4, the present invention also proposes a non-transitory computer-readable storage medium, on which is stored a computer program, which when executed by a processor, implements the SIPP-based performance testing method as described in any one of the above.
The storage medium may be an internal storage unit of the aforementioned server, such as a hard disk or a memory of the server. The storage medium may also be an external storage device of the device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the device. Further, the storage medium may also include both an internal storage unit and an external storage device of the apparatus.
It should be noted that, as can be clearly understood by those skilled in the art, the specific implementation process of the above SIPP-based performance testing apparatus and each unit may refer to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, no further description is provided herein.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention. It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, more than one unit or component may be combined or may be integrated into another computer device, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be merged, divided and deleted according to actual needs.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Accordingly, the scope of the present invention should be determined by the appended claims and their equivalents, which are to be construed as broadly as possible, and in order to clearly illustrate this interchangeability of hardware and software, various illustrative components and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention. It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the computer devices and units described above may refer to corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided by the present invention, it should be understood that the disclosed computer apparatus and method may be implemented in other ways. For example, the computer device embodiments described above are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, more than one unit or component may be combined or may be integrated into another computer device, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the computer equipment of the embodiment of the invention can be merged, divided and deleted according to actual needs.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A performance test method based on SIPP is characterized by comprising the following steps:
building a SIPP tool, a Python environment and a communication scheduling system;
installing a driver for connecting a database, introducing a database connection module in a Python environment, remotely connecting the database, creating a storage process and creating a large batch of test data;
simulating a user agent client and a user agent server by using a test case script in a Python environment;
packaging a log module and a mail module in a Python environment, and introducing HTMLTestRunner and mkdocs definition test reports;
running test case scripts, and running the test cases in parallel according to the sequence of first registration and then calling;
acquiring a webpage version test log and a test report;
the steps of building the SIPP tool, the Python environment and the communication scheduling system further comprise building the SIPP tool in a linux system or a Windows system, installing Phthon in the Windows system and building the communication scheduling system in the linux environment.
2. The SIPP-based performance testing method of claim 1, wherein the step of introducing a database connection module in the Python environment and remotely connecting the database comprises introducing the database connection module through an import statement, configuring relevant information of the database through a config statement, and acquiring connection with the database through a connect statement.
3. The SIPP-based performance testing method according to claim 1, wherein the step of simulating the user agent client and the user agent server by using the test case scripts in the Python environment comprises introducing a unittest framework in the Python environment, and newly building a registration test suite and a call test suite in the unittest framework, wherein the registration test suite is used for writing a main registration test case script and a registered test case script, the call test suite comprises a main call test suite and a called test suite, the called test suite is used for writing a called test case script, and the main call test suite is used for writing a main call test case script.
4. The SIPP-based performance testing method of claim 3, further comprising performing packet capture analysis on a part of data packets in the test script by using a wireshark tool;
and the step of packet capturing analysis comprises the steps of taking a calling party, a called party and a core network as a whole when the service platform needs to be tested and is not limited by the core network, and compiling a test script by capturing a packet of the SIP foreground server as a reference.
5. The SIPP-based performance testing method of claim 3, wherein when the calling network, the called network and the core network are integrated, the flow contained in the calling test case script and the called test case script comprises:
the user agent client sends an INVITE type request message to a service platform through an sdp protocol, and the user agent server obtains the request message through the service platform;
the user agent server returns 108 message codes to the user agent client by using the service platform;
the user agent server transmits the message to a service platform through a mechanism for ensuring reliable transmission of the temporary message in the SIP message, and the service platform returns a 200 message code to the user agent client;
the user agent server sends an INVITE type message to a service platform through an sdp protocol;
the service platform sends request messages of ACK and INVITE types to a user agent server;
the user agent server returns 200 message codes to the service platform through the sdp protocol;
and 2 times of update interaction process is carried out between the user agent client and the service platform, the user agent client sends an ACK request message to the service platform to reach the user agent server, and the user agent server returns a 200 message code.
6. The SIPP-based performance testing method of claim 3, wherein the step of running the test cases in parallel according to the sequence of registering before calling by running the test case script comprises:
running a test case script by using a unittest framework in Python, running a main registration test case script and a registered test case script at one time, and running test cases in parallel according to the sequence of first registration and then calling to obtain a corresponding test result;
the step of running the main registered test case script and the registered test case script at one time and running the test cases in parallel according to the sequence of first registration and then calling comprises the following steps:
obtaining the test information of the SIPP tool through a unittest frame in the Python environment, and calling the SIPP tool by using a main calling test case script and a called test case script to register a calling party and a called party to a dispatching communication system at the same time;
simultaneously registering a calling party and a called party in a dispatching communication system through the main calling test case script and the called test case script to carry out performance test;
after the registration is successful, calling a called test case script in the call test suite, and operating a called party in a dispatching communication system by utilizing the SIPP tool;
calling a main call test case script in the call test suite and calling the SIPP tool to operate a calling party in a dispatching communication system;
a calling party initiates a call, a called party answers and a call is established; and obtaining a corresponding test result through the call condition.
7. The SIPP-based performance testing method of claim 1, wherein the step of encapsulating the log module and the mail module in a Python environment and introducing HTMLTestRunner, mkdocs definition test reports further comprises:
a common module is newly built in Python, then a Mylog module for recording logs and a SendMail module for sending and receiving mails are respectively packaged, an output format and log levels are set for log types, log output is carried out, and the problems of real-time information viewing and tracking positioning are realized;
defining a report style, a report name and report content by using an mkdocs static site generator, and defining a path in which a file absolute path of a test report is mapped to a mirror image of the mkdocs static site generator in an HTMLTestRunner;
defining a main registration test case script and a registered script case to be executed in parallel in a Python code, and executing the main calling test case script and the called test case script only after the main registration test case script and the registered script case are executed;
a test data reading mode is defined in Python, and a large amount of test data newly built in a storage process is used by reading a remote connection database.
8. The SIPP-based performance testing method of claim 7, wherein the step of obtaining web page version test logs and test reports further comprises obtaining test reports of HTML files using test report paths defined by tmltestrunner.
9. A performance testing device based on SIPP is characterized by comprising the following units:
the environment building unit is used for building a SIPP tool, a Python environment and a communication scheduling system;
the data connection unit is used for installing a driver used for connecting a database, introducing a database connection module in a Python environment, remotely connecting the database, creating a storage process and newly building a large batch of test data;
the call simulation unit is used for simulating the user agent client and the user agent server by using the test case script in the Python environment;
the module encapsulation unit is used for encapsulating the log module and the mail module in a Python environment and introducing HTMLTestRunner and mkdocs definition test reports;
the operation test unit is used for operating the test case script and parallelly operating the test cases according to the sequence of first registration and then calling;
and the report acquisition unit is used for acquiring the webpage version test log and the test report.
10. A SIPP-based performance testing computer device comprising a memory, a processor, and a performance testing program stored on the memory and executable on the processor, the performance testing program when executed by the processor implementing a SIPP-based performance testing method as claimed in any one of claims 1-10;
the apparatus also includes a non-transitory computer readable storage medium having stored thereon a computer program, the computer program being a performance testing program.
CN202010102160.2A 2020-02-19 2020-02-19 SIPP-based performance test method and device, computer equipment and storage medium Pending CN111355632A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010102160.2A CN111355632A (en) 2020-02-19 2020-02-19 SIPP-based performance test method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010102160.2A CN111355632A (en) 2020-02-19 2020-02-19 SIPP-based performance test method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111355632A true CN111355632A (en) 2020-06-30

Family

ID=71194023

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010102160.2A Pending CN111355632A (en) 2020-02-19 2020-02-19 SIPP-based performance test method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111355632A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112286806A (en) * 2020-10-28 2021-01-29 成都佰维存储科技有限公司 Automatic testing method and device, storage medium and electronic equipment
CN113347062A (en) * 2021-06-04 2021-09-03 北京飞讯数码科技有限公司 SIP performance test method, device, equipment and storage medium
CN114205273A (en) * 2020-08-26 2022-03-18 腾讯科技(深圳)有限公司 System testing method, device and equipment and computer storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8386608B1 (en) * 2007-08-03 2013-02-26 Alex Rankov Service scripting framework
CN108551409A (en) * 2018-02-12 2018-09-18 北京佳讯飞鸿电气股份有限公司 A kind of method that far call SIPp softwares are tested for the property
CN110287119A (en) * 2019-06-28 2019-09-27 深圳市万睿智能科技有限公司 A kind of automatic interface testing method and device based on python

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8386608B1 (en) * 2007-08-03 2013-02-26 Alex Rankov Service scripting framework
CN108551409A (en) * 2018-02-12 2018-09-18 北京佳讯飞鸿电气股份有限公司 A kind of method that far call SIPp softwares are tested for the property
CN110287119A (en) * 2019-06-28 2019-09-27 深圳市万睿智能科技有限公司 A kind of automatic interface testing method and device based on python

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114205273A (en) * 2020-08-26 2022-03-18 腾讯科技(深圳)有限公司 System testing method, device and equipment and computer storage medium
CN114205273B (en) * 2020-08-26 2023-09-15 腾讯科技(深圳)有限公司 System test method, device and equipment and computer storage medium
CN112286806A (en) * 2020-10-28 2021-01-29 成都佰维存储科技有限公司 Automatic testing method and device, storage medium and electronic equipment
CN112286806B (en) * 2020-10-28 2023-10-03 成都佰维存储科技有限公司 Automatic test method and device, storage medium and electronic equipment
CN113347062A (en) * 2021-06-04 2021-09-03 北京飞讯数码科技有限公司 SIP performance test method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111355632A (en) SIPP-based performance test method and device, computer equipment and storage medium
CN102244594B (en) At the networks simulation technology manually and in automatic testing instrument
US20170242784A1 (en) Failure recovery testing framework for microservice-based applications
US20110202645A1 (en) Methods and Apparatus to Test Network Elements
US20060039538A1 (en) "Software only" tool for testing networks under high-capacity, real-world conditions
CN108664385A (en) A kind of test method and device of application programming interface
CN113127108A (en) Service request processing method and device, storage medium and electronic equipment
CN111723019A (en) Interface debugging method and system
CN111752820B (en) gRPC interface pressure test method, computer equipment and storage medium
CN114356774A (en) Target service test method, device, equipment and storage medium
CN113553260A (en) Test method, test apparatus, device, medium, and program product
CN113296744A (en) Application development system and method
CN108551409B (en) Method for remotely calling SIPP software to perform performance test
CN114048087B (en) Method and device for testing data transfer performance of equipment
CN114629830B (en) Method and system for automatically controlling test center instrument test
CN105577453A (en) System and method for realizing application test of mobile terminals
CN105610639A (en) Total log grabbing method and device
CN111107100B (en) Equipment for transmitting industrial protocol flow message
CN116126603A (en) Test configuration method, device, computer equipment and storage medium
CN112256564B (en) Application program running method and device and electronic equipment
CN112001156A (en) Form processing method and device and computer readable storage medium
CN112947115A (en) Generalized data monitoring method
CN110011894B (en) Barrage message simulation method and device
CN117130933A (en) Baffle service method, system, equipment and storage medium
CN102075646A (en) Call center equipment control system and method

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