CN110018933A - Andlink_IF3 automatic interface testing method - Google Patents

Andlink_IF3 automatic interface testing method Download PDF

Info

Publication number
CN110018933A
CN110018933A CN201910268700.1A CN201910268700A CN110018933A CN 110018933 A CN110018933 A CN 110018933A CN 201910268700 A CN201910268700 A CN 201910268700A CN 110018933 A CN110018933 A CN 110018933A
Authority
CN
China
Prior art keywords
andlink
interface
test
length
testing method
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
CN201910268700.1A
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 JIXIANG TENDA TECHNOLOGY Co Ltd
Original Assignee
SHENZHEN JIXIANG TENDA 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 JIXIANG TENDA TECHNOLOGY Co Ltd filed Critical SHENZHEN JIXIANG TENDA TECHNOLOGY Co Ltd
Priority to CN201910268700.1A priority Critical patent/CN110018933A/en
Publication of CN110018933A publication Critical patent/CN110018933A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/263Generation of test inputs, e.g. test vectors, patterns or sequences ; with adaptation of the tested hardware for testability with external testers

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a kind of Andlink_IF3 automatic interface testing methods, the following steps are included: step S10, judge whether Andlink_IF3 interface is online, if Andlink_IF3 interface is online, executes the first test case to carry out the first test for Andlink_IF3 interface;Step S20, generated load data, determines the first length of load data, judges whether the first length is greater than the first preset length when obtaining for the first test of progress of Andlink_IF3 interface, if the first length is greater than the first preset length, load data is subjected to piecemeal transmission;Step S30 after the completion of the first testing case, executes the second test case, to carry out the second test to Andlink_IF3 interface.The present invention is directed at least two test cases, can be sent, be greatly improved for Andlink_IF3 interface testing efficiency based on piecemeal.

Description

Andlink_IF3 automatic interface testing method
Technical field
The invention belongs to interface testing technical field more particularly to a kind of Andlink_IF3 automatic interface testing methods.
Background technique
Currently, Andlink is the specification that mobile group formulates, Andlink_IF3 and Andlink_IF6 are independent from each other Two interfaces, for Andlink_IF3 interface, mobile group's project testing Andlink_IF3 is mandatory item, test item every time More, each test requires that the path coap and json order is filled in manually, and comparatively laborious, testing efficiency is very low.
Therefore, the prior art is to be improved.
Summary of the invention
It is a primary object of the present invention to propose a kind of Andlink_IF3 automatic interface testing method, to solve background The technical issues of mentioned in technology, is sent by piecemeal and reduces message interaction number, and then promotes efficiency of transmission and stability, Improve testing efficiency.
A kind of Andlink_IF3 automatic interface testing method of the invention, comprising the following steps:
Step S10 judges whether Andlink_IF3 interface is online, if Andlink_IF3 interface is online, executes the first test Use-case is to carry out the first test for Andlink_IF3 interface;
Step S20, generated load data, determines load number when obtaining for the first test of progress of Andlink_IF3 interface According to the first length, judge whether the first length is greater than the first preset length, if the first length be greater than the first preset length, will Load data carries out piecemeal transmission;
Step S30 after the completion of the first testing case, executes the second test case, to carry out the to Andlink_IF3 interface Two tests.
Preferably, in step S20, load data is subjected to piecemeal transmission and is specifically included:
Step S21, load data is divided, to form at least two data portions;
Step S22 sends each data portion at least two data portions according to sequencing.
Preferably, before step S10, comprising steps of
First test case and the second test case are stored in test macro by step S1;
Step S2, the inputted test instruction of reception call corresponding test case to preparation access based on test instruction Andlink_IF3 interface is tested.
Preferably, after step S20, comprising steps of
Step S25 extracts the position code of returned packet, judges whether code be equal to default code information, if code are differed In default code information, carries out reporting an error operation and execute step S30.
Preferably, it in step S20, further comprises the steps of:
Step S26, if the first length, less than the first preset length, load data directly transmits.
Preferably, the first preset length includes 256 bytes.
Preferably, the length of each data portion at least two data portions is all the same.
Andlink_IF3 automatic interface testing method of the invention is arranged based on step S10, automatically for access Andlink_IF3 interface carry out test case test, based on step S20 be arranged, can exist for Andlink_IF3 interface Generated load data carries out piecemeal transmission in test case, and next test case, entire mistake are just executed after the completion of test Cheng Rengong participates in less, greatly improving the degree of automation and its testing efficiency, automated system can carry out automatically according to test case It tests, is participated in operational process without artificial, in addition to this coap agreement is not popular protocol common on the market, is based on piecemeal Transmission, which is advantageous in that, can be avoided load data too long the problem of leading to transmission abnormality;And piecemeal length be it is adjustable, Message interaction number can be reduced by tuning up piecemeal length, and then promote efficiency of transmission and stability.
Detailed description of the invention
Fig. 1 is the flow diagram of Andlink_IF3 automatic interface testing method first embodiment of the present invention;
The first refinement flow diagram that Fig. 2 is step S20 in Andlink_IF3 automatic interface testing method of the present invention;
Fig. 3 is the flow diagram of Andlink_IF3 automatic interface testing method second embodiment of the present invention;
Fig. 4 is the flow diagram of Andlink_IF3 automatic interface testing method 3rd embodiment of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
It should be noted that relational language such as " first ", " second " can be used for describing various assemblies, but these arts Language is not intended to limit the component.These terms are only used to distinguish a component and another component.For example, not departing from model of the invention It encloses, first assembly can be referred to as the second component, and the second component can also similarly be referred to as first assembly.Term " and/ Or " refer to continuous item and describe the combination of any one or more of item.
With reference to Fig. 1, Fig. 2, Fig. 3 and Fig. 4, Fig. 1 is Andlink_IF3 automatic interface testing method first of the present invention implementation The flow diagram of example;The first refinement stream that Fig. 2 is step S20 in Andlink_IF3 automatic interface testing method of the present invention Journey schematic diagram;Fig. 3 is the flow diagram of Andlink_IF3 automatic interface testing method second embodiment of the present invention;Fig. 4 is The flow diagram of Andlink_IF3 automatic interface testing method 3rd embodiment of the present invention.
A kind of Andlink_IF3 automatic interface testing method of the invention, comprising the following steps:
Step S10 judges whether Andlink_IF3 interface is online, if Andlink_IF3 interface is online, executes the first test Use-case is to carry out the first test for Andlink_IF3 interface;Before step S10, comprising steps of step S1, first is surveyed Example and the second test case on probation are stored in test macro;Step S2 receives inputted test instruction, based on test instruction Corresponding test case is called to test the Andlink_IF3 interface for preparing access.
In step slo, test terminal judges whether Andlink_IF3 interface is online, if on Andlink_IF3 interface Line, test terminal call corresponding test case to carry out first for Andlink_IF3 interface based on the test instruction inputted Test;Testing terminal includes computer.
In step slo, test terminal judge whether Andlink_IF3 interface is online and specifically includes: testing terminal and is following Coap message sniff (agreement provides that its port udp is 5683) is carried out in ring body, is converted into character string shape after receiving coap message Then formula is checked whether comprising the 5th preset field, wherein the 5th preset field includes heartbeat;If so, explanation connects Receiving is heartbeat message (indicating that Andlink_IF3 interface is online).
Scapy, selenium and pywifi can be installed in advance in test terminal;To be applied to Andlink_IF3 interface It is tested.Scapy, which is one, can allow user to send, listen to and parse and pretend the Python program of network message.These Function can be used for making the tool of detecting, scanning and attacking network.In other words, scapy is a powerful manipulation message Interactive program.It can forge or parse the message of various protocols, also have transmission, capture, matching request and respond these Message and more functions.Scapy can easily accomplish as scanning (scanning), routing tracking (tracerouting), (probing), unit testing (unit tests), attack (attacks) and discovery network are detected Task with traditional as (network discorvery).
Selenium is a tool for web application test.Selenium test runs directly in browser In, just as real user in operation.The browser of support includes IE(7, and 8,9,10,11), Mozilla Firefox, Safari, Google Chrome, Opera etc..The major function of this tool includes: the simultaneous of test and browser Capacitive --- the application program for testing you sees work whether fine can be obtained on different browsers and operating system.Test system Uniting, function --- software function and user demand are examined in creation regression test.
Pywifi provides a cross-platform Python module, for operating wireless interface, such as wireless association and adds Carry configuration file etc..
Step S20, generated load data, determines negative when obtaining for the first test of progress of Andlink_IF3 interface The first length for carrying data, judges whether the first length is greater than the first preset length, if the first length is greater than the first preset length, Load data is then subjected to piecemeal transmission;Wherein, load data includes json data;Piecemeal transmission is a kind of different from http Data transmission mechanism;In step S20, mechanism is sent based on the piecemeal to load data, testing efficiency can be greatly improved, keep away Exempt from burdensome problem;Preferably, the first preset length includes 256 bytes.
After step S20, comprising steps of step S25 receives opposite end after load data is carried out piecemeal transmission Returned packet, extract the position code of returned packet, judge whether code be equal to default code information, if code are not equal to Default code information, carries out reporting an error operation and executes step S30.It goes to judge whether code be equal to default code information, purpose It is, gives code extractions, it is whether normal for verifying current interaction.Wherein, code indicate the in returned packet Decimal value corresponding to 44 bytes;For example: default code information includes 69, when being equal to 69 for code, is illustrated negative Data are carried to have distributed.
Step S30 after the completion of the first testing case, executes the second test case, with to Andlink_IF3 interface into Row second is tested.
Andlink_IF3 automatic interface testing method of the invention is arranged based on step S10, automatically for access Andlink_IF3 interface carry out test case test, based on step S20 be arranged, can exist for Andlink_IF3 interface Generated load data carries out piecemeal transmission in test case, and next test case, entire mistake are just executed after the completion of test Cheng Rengong participates in less, greatly improving the degree of automation and its testing efficiency.
As shown in Figure 2, it is preferable that in step S20, load data is subjected to piecemeal transmission and is specifically included:
Step S21, load data is divided, to form at least two data portions;
Step S22 sends each data portion at least two data portions according to sequencing.
It in the step s 21, is equal form-separating for the division of load data;Load data is divided, to be formed At least two data portions;The length of each data portion at least two data portions is all the same;So that subsequent point During block is sent, the byte of each data portion is identical in load data received by opposite end.
For step S20, part of code is as follows:
while 1:
# piecemeal is sent
if len(data) > 256:
data_send = data[0:256]
data = data[256:]
Clipped code * * * * * * * * * * * * * * * * * * * * * * * * * * * * among * * * * * * * * * * * * * * * * * * * * * * * * * *
pkt = ether / ip / udp / cap / self._post_block(block_ num, block_size) / devide / data_send
answer = srp1(pkt, iface=interface, verbose=False, timeout=timeout)
if len(answer) != 0:
answer_bytes = bytes(answer)
M=answer_bytes [43:44] [- 1] # extracts Code
If M==95:# Continue indicates that json data distribute not yet
block_num += 1
msg += 1
else:
Print (color.red (' piecemeal transmission exception!'))
flag = 0
break
The present invention also protects a kind of Andlink_IF3 interface automatization test system, including application layer, control layer and functional module Layer, application layer preferably test terminal, and test terminal includes test case, test script and report, and control layer includes that test is used Example driving file, data management, report output and printing, functional module layer include online detection module, coap layer building module, Restore factory module, radio interface module and report output module.It should be noted that Andlink_IF3 interface of the invention Automatization test system can be applied in Andlink_IF3 automatic interface testing method.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in a storage medium In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, computer, clothes Business device, air conditioner or the network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (7)

1. a kind of Andlink_IF3 automatic interface testing method, which comprises the following steps:
Step S10 judges whether Andlink_IF3 interface is online, if Andlink_IF3 interface is online, executes the first test Use-case is to carry out the first test for Andlink_IF3 interface;
Step S20, generated load data, determines load number when obtaining for the first test of progress of Andlink_IF3 interface According to the first length, judge whether the first length is greater than the first preset length, if the first length be greater than the first preset length, will Load data carries out piecemeal transmission;
Step S30 after the completion of the first testing case, executes the second test case, to carry out the to Andlink_IF3 interface Two tests.
2. Andlink_IF3 automatic interface testing method as described in claim 1, which is characterized in that, will in step S20 Load data carries out piecemeal transmission and specifically includes:
Step S21, load data is divided, to form at least two data portions;
Step S22 sends each data portion at least two data portions according to sequencing.
3. Andlink_IF3 automatic interface testing method as described in claim 1, which is characterized in that before step S10, Comprising steps of
First test case and the second test case are stored in test macro by step S1;
Step S2, the inputted test instruction of reception call corresponding test case to preparation access based on test instruction Andlink_IF3 interface is tested.
4. Andlink_IF3 automatic interface testing method as described in claim 1, which is characterized in that after step S20, Comprising steps of
Step S25 extracts the position code of returned packet, judges whether code be equal to default code information, if code are differed In default code information, carries out reporting an error operation and execute step S30.
5. Andlink_IF3 automatic interface testing method as described in claim 1, which is characterized in that in step S20, also Comprising steps of
Step S26, if the first length, less than the first preset length, load data directly transmits.
6. Andlink_IF3 automatic interface testing method as described in claim 1, which is characterized in that the first preset length packet Include 256 bytes.
7. Andlink_IF3 automatic interface testing method as claimed in claim 2, which is characterized in that at least two data portions The maximum length of each data portion in point is all the same.
CN201910268700.1A 2019-04-04 2019-04-04 Andlink_IF3 automatic interface testing method Pending CN110018933A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910268700.1A CN110018933A (en) 2019-04-04 2019-04-04 Andlink_IF3 automatic interface testing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910268700.1A CN110018933A (en) 2019-04-04 2019-04-04 Andlink_IF3 automatic interface testing method

Publications (1)

Publication Number Publication Date
CN110018933A true CN110018933A (en) 2019-07-16

Family

ID=67190568

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910268700.1A Pending CN110018933A (en) 2019-04-04 2019-04-04 Andlink_IF3 automatic interface testing method

Country Status (1)

Country Link
CN (1) CN110018933A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102890503A (en) * 2012-10-18 2013-01-23 重庆长安汽车股份有限公司 Automatic CAN (Controller Area Network) interface function test system and test analysis method
US9203730B1 (en) * 2012-11-19 2015-12-01 Sifos Technologies, Inc. Method and apparatus for testing network interfaces
CN109450741A (en) * 2018-12-20 2019-03-08 深圳市吉祥腾达科技有限公司 A kind of test macro and test method of wireless network card Wi-Fi connection reliability

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102890503A (en) * 2012-10-18 2013-01-23 重庆长安汽车股份有限公司 Automatic CAN (Controller Area Network) interface function test system and test analysis method
US9203730B1 (en) * 2012-11-19 2015-12-01 Sifos Technologies, Inc. Method and apparatus for testing network interfaces
CN109450741A (en) * 2018-12-20 2019-03-08 深圳市吉祥腾达科技有限公司 A kind of test macro and test method of wireless network card Wi-Fi connection reliability

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
曹阳等: "基于TCP/IP网络协议的通信系统性能分析与优化", 《武汉大学学报(自然科学版)》 *

Similar Documents

Publication Publication Date Title
CN102023922B (en) System and method for testing automotive electronic diagnostic software
US8737980B2 (en) End to end application automatic testing
US9538404B2 (en) Apparatus and methods for product acceptance testing on a wireless device
US20060205398A1 (en) Apparatus and methods for product acceptance testing on a wireless device
WO2012062108A1 (en) Test system and test method
CN106330483B (en) Information acquisition method, client device and server device
CN110995764B (en) Mobile cellular network application layer data flow fuzzy test method, electronic equipment and storage medium
WO2011009308A1 (en) Field service test method, device and system
CN102821416A (en) System for testing abnormal interruption of wireless communication module and application method thereof
CN107612769B (en) Method and system for testing wireless transmission rate of router
CN115150377A (en) Method and device for calling and processing simulation interface
CN111683044A (en) Method and device for automatically detecting forward isolation device strategy
CN110875825B (en) Fault judgment method and device
CN108076197A (en) A kind of detection method and device of terminal network performance degradation
CN110018933A (en) Andlink_IF3 automatic interface testing method
CN110708216B (en) Switch LLDP protocol test method and test system
CN110896544B (en) Fault delimiting method and device
CN105827462A (en) Method and tool for detecting network device
CN105208574A (en) Method and device for detecting performance of wireless module of terminal
CN110753363A (en) Intelligent device wireless debugging system and method
CN105243015B (en) Method and system for automatically testing software
CN108363922A (en) A kind of automation malicious code emulation detection method and system
CN107579871A (en) The generation method of distributed testing script based on model inspection and generation system
CN107172641B (en) A kind of WiFi network monitoring method
CN111800296B (en) Method, system, equipment and storage medium for capturing and analyzing network data of real-time system

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