CN113315681A - Automatic testing method and system based on intelligent home gateway plug-in - Google Patents

Automatic testing method and system based on intelligent home gateway plug-in Download PDF

Info

Publication number
CN113315681A
CN113315681A CN202110593981.5A CN202110593981A CN113315681A CN 113315681 A CN113315681 A CN 113315681A CN 202110593981 A CN202110593981 A CN 202110593981A CN 113315681 A CN113315681 A CN 113315681A
Authority
CN
China
Prior art keywords
gateway
plug
request
message body
server
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
CN202110593981.5A
Other languages
Chinese (zh)
Other versions
CN113315681B (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.)
Shenzhen Tenda Technology Co Ltd
Original Assignee
Shenzhen 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 Tenda Technology Co Ltd filed Critical Shenzhen Tenda Technology Co Ltd
Priority to CN202110593981.5A priority Critical patent/CN113315681B/en
Publication of CN113315681A publication Critical patent/CN113315681A/en
Application granted granted Critical
Publication of CN113315681B publication Critical patent/CN113315681B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides an automatic testing method and system based on an intelligent home gateway plug-in, and belongs to the technical field of gateway testing. The method of the invention comprises the following steps: initializing data; registering a gateway to be tested for authentication, and establishing communication with the gateway after the authentication is passed; acquiring an operation instruction, finishing communication with the gateway when the operation instruction is a second instruction, finishing testing, and executing the next step when the operation instruction is a first instruction; iteratively acquiring a request method according to the test case data until the request method is acquired; constructing a message body matched with the request method and sending the message body to the gateway; receiving a response message sent by a gateway; judging and storing a test result according to the response message; generating a test report, and finishing the test. The invention has the beneficial effects that: a set of plug-in automatic test solution is provided, so that the testability of the product function is improved, the test efficiency is improved, and meanwhile, the product quality risk is also avoided.

Description

Automatic testing method and system based on intelligent home gateway plug-in
Technical Field
The invention relates to a gateway testing technology, in particular to an automatic testing method and system based on an intelligent home gateway plug-in.
Background
The current China Mobile Intelligent Home gateway product relates to a plurality of plug-in module service tests, and is also a key core component. Under the condition of no environment and no tool testable, the plug-in unit can only be manually operated to test by issuing instructions through the serial port.
The test method has the following disadvantages:
(1) testability of a plug-in functional service missing tool;
(2) operation tests such as plug-in service installation, upgrading, unloading, stopping, starting, upgrading, inquiring and the like of a simulated real environment scene cannot be verified;
(3) the product quality is at risk at any time;
(4) the plug-in test is operated by manually sending instructions through the serial port, and the accuracy verification of data message interaction is lacked.
Therefore, a plug-in server tool needs to be developed to provide an interface for interfacing with a gateway to perform TCP protocol network communication, so as to implement a set of plug-in automation test solutions such as JSON data transmission, data packet parsing and automatic verification of JSON data packets.
Disclosure of Invention
In order to solve the problems in the prior art, the invention provides an automatic testing method and system based on an intelligent home gateway plug-in.
The automatic testing method based on the intelligent home gateway plug-in comprises the following steps:
s1: initializing data;
s2: registering a gateway to be tested for authentication, and establishing communication with the gateway after the authentication is passed;
s3: acquiring an operation instruction, finishing communication with the gateway when the operation instruction is a second instruction, finishing testing, and executing the next step when the operation instruction is a first instruction;
s4: iteratively acquiring a request method according to the test case data until the request method is acquired;
s5: constructing a message body matched with the request method and sending the message body to the gateway;
s6: receiving a response message sent by a gateway;
s7: judging and storing a test result according to the response message;
s8: and generating a test report, and finishing the test.
The invention further improves, in step S1, the automatic testing method based on the intelligent home gateway plug-in is implemented on a plug-in server, the plug-in server is provided with a config.
In step S2, the method for registering and authenticating the tested gateway includes:
s21: the gateway registration authentication is started;
s22: creating a receiving thread, circularly monitoring the gateway, and receiving a gateway request message;
s23: judging the type of the gateway request message and the parameter value in the gateway request message;
s24: constructing different response message bodies to the gateway according to whether the parameter values are matched with the preset values in the plug-in server;
s25: and the gateway executes corresponding operation according to the content of the response message body.
The invention is further improved, in step S22, the plug-in server and the intelligent home gateway monitor the IP and port through the socket to perform network communication and transmit JSON data, in step S22, a message receiving thread is separately created, and a request JSON message body sent from the gateway is received through circular monitoring.
The invention is further improved, in step S23-25, judge whether the JSON message body RPCMethod key value of the gateway authentication request is the BootInitiation request method at first, if yes, judge whether the server platform INI configuration file MAC address of the plug-in matches with JSON message body MAC, if yes, construct the field Result of the authentication response JSON message body and return to 0, finish; otherwise, the gateway returns to-2, and the gateway can only be connected after being restarted to perform gateway registration authentication again.
If the JSON message body RPCMethod key value of the gateway authentication request is not the BootInitiation request method, judging whether the JSON message body RPCMethod key value of the gateway authentication request is the Register request method, if so, checking the MD5 value of the JSON message body CheckGateway requested by the gateway and the preset MD5 spliced into characters to calculate the obtained MD5 value to be matched and consistent, if so, constructing an authentication Result to respond the field Result of the JSON message body and returning to 0, and ending; otherwise, returning to-5, and the gateway waits for the set time in a silent mode and then carries out authentication again.
If the JSON message body RPCMethod key value of the gateway authentication request is not the BootInitiation request method, judging whether the JSON message body RPCMethod key value of the gateway authentication request is the Register request method, if so, checking the MD5 value of the JSON message body CheckGateway requested by the gateway and the preset MD5 spliced into characters to calculate the obtained MD5 value to be matched and consistent, if so, constructing an authentication Result to respond the field Result of the JSON message body and returning to 0, and ending; otherwise, returning to-5, and the gateway waits for the set time in a silent mode and then carries out authentication again.
If the key value of the gateway authentication request JSON message body RPCMethod is not a Register request method, judging whether the key value of the gateway authentication request JSON message body RPCMethod is a Hb request method, if so, constructing a field Result of a heartbeat keep-alive response JSON message body and returning to be 0, keeping a normal heartbeat period by the gateway for keeping the connection between the gateway and a plug-in server, and initiating plug-in management operation to the intelligent home gateway by the plug-in server.
And if the authentication request JSON message body RPCMethod does not find the request method, an abnormal message prompt is thrown out, and the authentication fails.
The invention further improves, in step S4, the request method includes the request of installation, upgrade, inquiry, stop, start, recovery and uninstall, and if the plug-in server where the request method is located does not exist, an exception message prompt is displayed.
In a further improvement of the present invention, in step S5, the processing method includes the following steps:
s51: uniformly calling the packaged function ID _ cod in the message ID field of the plug-in requesteRandomly constructing a 5-bit digital integer;
s52: after a request method JSON message body is constructed, loading the constructed JSON message body by using a JSON.
S53: packaging and encapsulating a JSON message body into a network byte stream by a struct.pack method;
s54: and uniformly calling the sendall method of the socket to send a request message corresponding to the plug-in operation to the gateway.
The invention also provides a test system for realizing the test method, which comprises a plug-in server, OLT equipment and a file server, wherein the plug-in server is connected with the file server, the gateway to be tested is respectively connected with the plug-in server and the file server through the OLT equipment, the OLT equipment is used for enabling the gateway to be tested to be accessed into a network, the plug-in server runs an automatic test method based on the intelligent home gateway plug-in and is used for carrying out plug-in test on the gateway to be tested, and the file server is used for storing different plug-in version files and providing corresponding plug-ins for remote downloading in the plug-in installation process.
Compared with the prior art, the invention has the beneficial effects that: a set of plug-in automatic test solution is provided, so that the testability of the product function is improved, the test efficiency is improved, and meanwhile, the product quality risk is also avoided.
Drawings
FIG. 1 is a schematic diagram of a test system according to the present invention;
fig. 2 is a schematic diagram of connection between an intelligent home gateway and a plug-in server;
FIG. 3 is a schematic diagram of interaction between an intelligent home gateway and a plug-in server
FIG. 4 is a flow chart of the method of the present invention;
FIG. 5 is a flowchart of a gateway registration authentication method;
FIG. 6 is a flowchart of a plug-in service use case operation method according to an embodiment of the testing method of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples.
As shown in fig. 1, the testing system of the present invention includes a plug-in server, an OLT (optical line terminal) device, a file server, and a transmission and bearer network, and each device functions as:
(1) and the intelligent home gateway optical fiber interface to be tested is connected to the port of the OLT equipment to provide registration authentication and dialing services.
(2) The OLT equipment is accessed to the transmission and bearing network, and the network port of the plug-in server is also accessed to the transmission and bearing network after the IP address is set.
(3) The intelligent home gateway configures remote registration authentication, and establishes a static WAN connection IP address to ensure that the plug-in server can communicate with the gateway through PING.
(4) The file server is deployed by using an HFS tool, and an http mode is used for providing a URL address for the gateway to download the plug-in file installation operation test.
The invention sets a plug-in server tool at the plug-in server end, the tool is mainly applied to the China Mobile Intelligent Home gateway product for performing plug-in service function test, and supports the service management operations of installation, upgrade, uninstallation, start, stop and the like of the plug-in on the intelligent Home gateway, thereby realizing the automatic test method of the plug-in of the intelligent Home gateway.
The plug-in server side tool is developed by adopting a programming language Python, the realized functions comprise automatic test of plug-in services and automatic generation of EXCEL test reports, and the related technology comprises the following steps:
automatic test for automatically executing plug-in service case
(1) Network communication: the method comprises the steps of using socket to realize a TCP protocol, binding a host IP address and a port number, monitoring a gateway and receiving a JSON message structural body from the gateway, introducing a JSON dumps method to load a JSON message structural body to calculate length, packaging and compiling into network byte stream through a struct.pack method, using sendall of socket to send the JSON message structural body to the gateway, and solving the problem of realizing cross-language communication interaction and JSON data analysis with a message body compiled by gateway C language.
(2) Calculating the size of the plug-in file: the getsize method referencing the third party library os.
(3) MD5 encrypts: the concatenated string is encrypted using the md5 method that references the third party library hashlib.
(4) Randomly generating a number: and (3) respectively and randomly generating character type 16 bytes and integer ID number for the key name DeRND and the ID number of the JSON structure body by using a choice method of referring to a third-party library random.
Second, automatically generating EXCEL test report
(1) And loading the specified xlsx use case template format file by using a load _ workbook method of the third-party library openpyl, and reading data line by line through a built-in iterator iter _ rows to be stored in a list.
(2) Writing the read test result data into a specified xlsx case format file cell by using an openpyxl definition object sheet.
As shown in fig. 2, the plug-in server platform functions fall into three major categories: user management, heartbeat maintenance, and plug-in management. And the plug-in server platform and the intelligent home gateway monitor the IP and the port through the socket to carry out network communication and transmit JSON data. Through the user management interface: the intelligent home gateway requests authentication for the access of the plug-in service end platform; maintaining an interface via a heartbeat: heartbeat maintenance from the intelligent home gateway to the plug-in service end platform; through the plug-in management interface: and the business management operations of installing, upgrading, unloading, starting, stopping, inquiring, upgrading and the like of the plug-in on the intelligent home gateway by the plug-in server platform are supported.
As shown in fig. 3, in this example, a TCP is used, and the smart home gateway serves as a client to initiate a TCP connection to the plug-in server platform, and under a precondition, after the registration authentication is passed, the smart home gateway can enter a heartbeat chain state stage, and can keep a long connection through a heartbeat keep-alive mechanism. Then, the plug-in service test can be operated, and the plug-in management provides an operation method which comprises the following steps: and 7 plug-in operations of plug-in installation, upgrading, inquiring, stopping, starting, unloading, recovering and the like. The whole business process interaction process is as follows:
(1) the intelligent home gateway firstly sends an authentication request message to the plug-in server and reports the authentication request message: MAC, plug-in management interface protocol version and other information;
(2) the plug-in server records corresponding information, authenticates according to information such as MAC and the like, and returns an authentication result;
(3) after the authentication is passed, the intelligent home gateway periodically reports the heartbeat to the plug-in server;
(4) the plug-in server responds to the heartbeat keep-alive, and the heartbeat interval is defaulted to 600 seconds;
(5) the plug-in server initiates plug-in management operation to the intelligent home gateway;
(6) and the intelligent home gateway responds to the plug-in management operation and returns an operation result.
As shown in fig. 4, the implementation process of the test tool of the present invention includes the following steps:
s1: initializing data;
s2: registering a gateway to be tested for authentication, and establishing communication with the gateway after the authentication is passed;
s3: acquiring an operation instruction, finishing communication with the gateway when the operation instruction is a second instruction, finishing testing, and executing the next step when the operation instruction is a first instruction;
s4: iteratively acquiring a request method according to the test case data until the request method is acquired;
s5: constructing a message body matched with the request method and sending the message body to the gateway;
s6: receiving a response message sent by a gateway;
s7: judging and storing a test result according to the response message;
s8: and generating a test report, and finishing the test.
The method of the present invention is described in detail below. The plug-in server provides a config.ini configuration file, and related data is configured before testing. And configuring an HTTP file server, and configuring a specified storage plug-in file directory by using an HFS file server tool.
The operation of this example is as follows:
(1) firstly, defining a JSON message structure body, a Result message state code and a config configuration file of a server.
(2) Secondly, introducing a third-party library configparser, defining a Config class, and providing methods for acquiring all key name lists and key name values of config.ini configuration files; introducing third-party library logging, defining a Log class, and providing four Log grade levels of debug, info, waring, error and the like for a packaging method; referring to third-party libraries os, sys, random, hashlib, shunt, ctypes, openpyxl, a Common class is defined, and get _ file (get file size), get _ MD5 (get MD5 value), challenge _ code (random 16 byte number), ID _ code (get random ID number), read _ excel (get file data list), write _ excel (write data to file), cprint (print color font), etc. are provided as methods; introducing a third-party library socket, threading, time, struct, json, os and sys, defining PluginApi class files, and providing encapsulation methods of socket _ close (closing socket communication), recv _ msg (receiving message), recv _ thread and send _ msg (sending message).
(3) And thirdly, changing gateway plug-in center information data, modifying the IP address of a plug-in service end by using a sidbg 1DB set Mobile AppInfo 0SpMgtURL command, modifying the port number of the service end by using the sidbg 1DB set Mobile AppInfo 0SpPort command, and then executing a command sidbg 1DB save to store the currently configured gateway plug-in center data.
As shown in fig. 5, as an embodiment of the present invention, the specific test method of this example includes the following steps:
1. initializing data and a socket instantiation object, and starting a gateway registration authentication request, an authentication result request, a heartbeat keep-alive request and other three stages of registration authentication process interaction requests and plug-in server responses.
The gateway registration authentication service logic processing flow is shown in fig. 4, and the specific processing method is as follows:
(1) initializing data, instantiating a socket object, binding an IP address and a port number of a server host, establishing 5 maximum connection numbers, and waiting for receiving a request of a client by using an accept () function of the socket. In this case, the number of other maximum connections may be set, and a plurality of gateways may be tested in parallel.
(2) And a message receiving thread is separately created, and the request JSON message sent from the gateway is received by loop monitoring.
(3) Judging whether a JSON message body RPCMethod key value of a gateway authentication request is a BootInitiation request method or not, judging whether an INI configuration file MAC address of a plug-in server platform is matched with a JSON message body MAC address or not, and constructing an authentication response JSON message body Result and returning to be 0; otherwise, the Result returns to-2, and the gateway can only be restarted and then the connection is re-authenticated by the gateway registration.
The authentication response JSON message body format is as follows:
{
“Result”:0|-2,
the "ID"// transaction ID correspondence is consistent with the requested transaction ID
Chanllengecode, sixteen byte random number "
}
And calling a function packaged by the challenge code field to randomly generate a character with 16 bytes, and referring to a choise method of a third-party library random to iterate a character type with 16 bytes formed by splicing numbers for 16 times.
(4) Judging whether a key value of a JSON message body RPCMethod of a gateway authentication request is a Register request method, checking whether the MD5 value of the JSON message body Checkgateway of the gateway request is consistent with an MD5 value calculated by splicing characters of MD5(Challengecode + SN + SSID (last four digits) + SSID initial Password (8 digits) + user initial Password (8 digits) + Password), and constructing an authentication Result to respond to a JSON message body Result and return to 0; otherwise, the Result returns to-5, and the gateway waits for 10 minutes in a silent mode and then carries out authentication again.
(5) And if the gateway authentication request JSON message body RPCMethod key value is judged to be the Hb request method, constructing a heartbeat keep-alive response JSON message body Result and returning to 0, wherein the gateway should keep a normal heartbeat period, and the default heartbeat interval time is 600 seconds.
(6) And if the authentication request JSON message body RPCMethod does not find the request method, throwing an abnormal message prompt.
2. And after the registration authentication is passed, entering heartbeat keep-alive to keep establishing connection data message interaction, displaying a main menu option in a CMD window, and exiting the program to finish communication with the gateway when the selection number is 2.
3. When the selection number is 1, calling a read _ excel function to obtain test case data of the excel file and iteratively obtain a request method, and if the request method is 'Install', automatically triggering and constructing an Install installation plug-in JSON request message structure body;
the installation plug-in JSON request message format is as follows:
{
”RPCMethod”:”Install”,
"ID"// transaction ID is used to identify the corresponding operation sequence number
The generation rule is that the 'plug _ Name', the 'plug _ ID', and/the platform generate the unique mark of the plug-in, and the generation rule is as follows: "third party plug-in name", the plug-in name shall be defined according to the naming rule of the corresponding OS
"Version" to "plug-in Version number",
"Download _ URL": plug-in Download URL address ",
"Plugin _ size": size "// unit is the size of Byte
"OS": plug-in type "
}
The value of the field plug _ size is calculated from the calling get _ filesize function reference os.
4. In the embodiment, a reading thread is used for calling a recv _ msg method to set an independent loop to receive a request or a response message thread from a gateway, a read _ excel interface is called to loop and iteratively read a use case data list to identify a request method and transmit the request method to a JSON message structure body, a jsON message structure body is loaded by calling a JSON. dumps method, the length of the message structure body is obtained, a struct. pack JSON message structure body is used for compiling into a network byte stream, and then a sendall method of socket is called to send a message request to the gateway.
(1) If the request method is 'ListPlugin', automatically triggering and constructing a ListPlugin query plug-in list to request a JSON message body;
the format of the request message for acquiring the inquiry plug-in list is as follows:
{
”RPCMethod”:”Install_query”,
the "ID" is a number of digits,
”Plugin_Name”:“Plugin_ID”,
}
(2) if the request method is 'Stop', automatically triggering and constructing a Stop plug-in to request a JSON message body;
the stop plug-in request message format is as follows:
{
”RPCMethod”:”Stop,
the "ID" is a number of digits,
”Plugin_Name”:“Plugin_ID”
}
(3) if the request method is 'Run', automatically triggering and constructing a Run enabling plug-in to request a JSON message body;
the plug-in request message format is enabled as follows:
{
”RPCMethod”:”Run”,
the "ID" is a number of digits,
”Plugin_Name”:“Plugin_ID”
}
(4) if the request method is 'UnInstalll', automatically triggering and constructing the UnInstalll unloading plug-in to request the JSON message body;
the unloaded plugin request message format is as follows:
{
”RPCMethod”:”UnInstall”,
the "ID" is a number of digits,
”Plugin_Name”:“Plugin_ID”,
}
(5) if the request method is 'FactoryPlugin', automatically triggering and constructing a FactoryPlugin restore plug-in request JSON message body;
the resume plug-in request message format is as follows:
{
”RPCMethod”:”FactoryPlugin”,
the "ID" is a number of digits,
”Plugin_Name”:“Plugin_ID”
}
(6) if the plug-in server where the request method is located does not exist, an abnormal message is thrown out to prompt that the test case does not find the request method and the test case file is required to be checked.
And after a request method JSON message body is constructed, a sendall method of socket is called uniformly to send a request message corresponding to the plug-in operation to the gateway.
5. Receiving a response JSON message body sent from the gateway by a receiving thread, judging whether a field 'Result' of the message body is 0 or not, if not, adding 'FAIL' to a status list for storage, and simultaneously adding the message body responded by the gateway to a gate _ msg list for storage; otherwise, add "PASS" to the status list store, while adding the message body of the gateway response to the gate _ msg list store. Transmitting two lists of status and gate _ msg to a write _ EXCEL function interface, loading an EXCEL test case file, instantiating an object sheet, iteratively writing into a specified cell according to the status and gate _ msg data of the lists, and filling the filling color to green according to the fact value of 'PASS'; if it is "FAIL", the fill color is red. And finally, saving and closing the current file by using a wb.
The innovation point of the scheme is as follows:
(1) a menu template is defined, two option functions of a main menu starting plug-in service test and a finishing program are provided, and the test convenience is provided by realizing man-machine interaction;
(2) when the plug-in server tool runs, the automatic initialization environment receives a registration authentication request message sent from the gateway to perform logic processing and respond the message to the gateway, after the authentication is passed, a heartbeat keep-alive stage is entered, then a program automatically outputs a main menu, and when the number 1 is selected, plug-in management operation integration is started to replace manual operation, so that automatic case execution testing is realized; when the number 2 is selected, the communication between the server and the gateway is ended;
(3) and when the case is completely executed, automatically generating an EXCEL test report file. The server tool meets the requirements of operations of automatic installation, unloading, query, upgrade, stop, start and the like of different plug-in services.
The invention can verify the plug-in service of the plug-in real scene, and can improve the testability of the product function and the test efficiency by interacting with the gateway, and simultaneously avoid the risk of the product quality.
The above-described embodiments are intended to be illustrative, and not restrictive, of the invention, and all changes that come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein.

Claims (10)

1. An automatic testing method based on an intelligent home gateway plug-in is characterized by comprising the following steps:
s1: initializing data;
s2: registering a gateway to be tested for authentication, and establishing communication with the gateway after the authentication is passed;
s3: acquiring an operation instruction, finishing communication with the gateway when the operation instruction is a second instruction, finishing testing, and executing the next step when the operation instruction is a first instruction;
s4: iteratively acquiring a request method according to the test case data until the request method is acquired;
s5: constructing a message body matched with the request method and sending the message body to the gateway;
s6: receiving a response message sent by a gateway;
s7: judging and storing a test result according to the response message;
s8: and generating a test report, and finishing the test.
2. The intelligent home gateway plugin-based automated testing method of claim 1, wherein: in step S1, the method for automatically testing the smart home gateway plug-in is implemented on a plug-in server, where the plug-in server is provided with a config.ini configuration file, and before the test starts, related data is configured,
in step S2, the method for registering and authenticating the tested gateway includes:
s21: the gateway registration authentication is started;
s22: creating a receiving thread, circularly monitoring the gateway, and receiving a gateway request message;
s23: judging the type of the gateway request message and the parameter value in the gateway request message;
s24: constructing different response message bodies to the gateway according to whether the parameter values are matched with the preset values in the plug-in server;
s25: and the gateway executes corresponding operation according to the content of the response message body.
3. The intelligent home gateway plugin-based automated testing method of claim 2, wherein: in step S22, the plug-in server and the smart home gateway monitor the IP and the port through the socket for network communication, and transmit JSON data, and in step S22, create a message receiving thread separately, and circularly monitor and receive a JSON message body requesting from the gateway.
4. The intelligent home gateway plugin-based automated testing method of claim 3, wherein: in step S23-25, firstly, judging whether a JSON message body RPCMethod key value of a gateway authentication request is a BootInitiation request method, if so, judging whether an INI configuration file MAC address of a plug-in server platform is matched with a JSON message body MAC, if so, constructing a field Result of an authentication response JSON message body and returning to 0, and ending; otherwise, the gateway returns to-2, and the gateway can only be connected after being restarted to perform gateway registration authentication again.
5. The intelligent home gateway plugin-based automated testing method of claim 4, wherein: in step S23-25, if the JSON message body RPCMethod key value of the gateway authentication request is not the BootInitiation request method, determining whether the JSON message body RPCMethod key value of the gateway authentication request is the Register request method, if so, checking whether the MD5 value of the JSON message body CheckGateway of the gateway request matches the MD5 value calculated by splicing the preset MD5 into characters, if so, constructing an authentication Result and returning to 0 in response to the field Result of the JSON message body, and ending; otherwise, returning to-5, and the gateway waits for the set time in a silent mode and then carries out authentication again.
6. The intelligent home gateway plugin-based automated testing method of claim 5, wherein: in step S23-25, if the key value of the gateway authentication request JSON message body RPCMethod is not the Register request method, it is determined whether the key value of the gateway authentication request JSON message body RPCMethod is the Hb request method, if so, a field Result of the heartbeat keep alive response JSON message body is constructed and returned to 0, the gateway maintains a normal heartbeat period for keeping the gateway connected to the authentication server, the plug-in server initiates a plug-in management operation to the intelligent home gateway,
and if the authentication request JSON message body RPCMethod does not find the request method, an abnormal message prompt is thrown out, and the authentication fails.
7. The intelligent home gateway plugin-based automated testing method of claim 6, wherein: in step S4, the request method includes an installation, upgrade, inquiry, stop, start, recovery, and uninstall request, and if the plug-in server where the request method is located does not exist, an exception message prompt is displayed.
8. The intelligent home gateway plugin-based automated testing method of claim 7, wherein: in step S5, the processing method includes the steps of:
s51: uniformly calling the packaged function ID _ cod to randomly construct a 5-bit digital integer in the message ID field of the plug-in request;
s52: after a request method JSON message body is constructed, loading the constructed JSON message body by using a JSON.
S53: packaging and encapsulating a JSON message body into a network byte stream by a struct.pack method;
s54: and uniformly calling the sendall method of the socket to send a request message corresponding to the plug-in operation to the gateway.
9. The intelligent home gateway plugin-based automated testing method of claim 8, wherein: the implementation method of the step S6-8 comprises the following steps:
receiving a response JSON message body sent from the gateway by a receiving thread, judging whether a field Result of the response JSON message body is 0 or not, if not, adding a Result FAIL to a status list for storage, and simultaneously adding a message body responded by the gateway to a gate _ msg list for storage; otherwise, adding PASS to the status list storage, simultaneously adding a message body responded by the gateway to the gate _ msg list storage, transmitting the status and gate _ msg lists to the write _ EXCEL function interface, loading the EXCEL test case file and instantiating the object sheet, iteratively writing the EXCEL test case file into the specified cell according to the status and gate _ msg data of the lists, and finally storing and closing the current file to generate the EXCEL test report file.
10. A system for implementing the intelligent home gateway plug-in based automation test method of any one of claims 1 to 9, characterized in that: the system comprises a plug-in server, an Optical Line Terminal (OLT) device and a file server, wherein the plug-in server is connected with the file server, a gateway to be tested is respectively connected with the plug-in server and the file server through the OLT device, the OLT device is used for enabling the gateway to be tested to be accessed into a network, the plug-in server runs an automatic testing method based on an intelligent home gateway plug-in and is used for performing plug-in testing on the gateway to be tested, and the file server is used for storing different plug-in version files and providing corresponding plug-ins for remote downloading in the plug-in installation process.
CN202110593981.5A 2021-05-28 2021-05-28 Automatic testing method and system based on intelligent home gateway plug-in Active CN113315681B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110593981.5A CN113315681B (en) 2021-05-28 2021-05-28 Automatic testing method and system based on intelligent home gateway plug-in

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110593981.5A CN113315681B (en) 2021-05-28 2021-05-28 Automatic testing method and system based on intelligent home gateway plug-in

Publications (2)

Publication Number Publication Date
CN113315681A true CN113315681A (en) 2021-08-27
CN113315681B CN113315681B (en) 2022-11-08

Family

ID=77376373

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110593981.5A Active CN113315681B (en) 2021-05-28 2021-05-28 Automatic testing method and system based on intelligent home gateway plug-in

Country Status (1)

Country Link
CN (1) CN113315681B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115250197A (en) * 2022-06-02 2022-10-28 苏州思萃工业互联网技术研究所有限公司 Device for automatically creating container discovery service
CN116915875A (en) * 2023-09-12 2023-10-20 深圳市天思智慧科技有限公司 General method for analyzing modbus equipment by Internet of things and modbus system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103259713A (en) * 2013-04-15 2013-08-21 海信集团有限公司 Message exchange system and method
US20130297973A1 (en) * 2012-05-04 2013-11-07 Aegis.Net, Inc. Automated Conformance and Interoperability Test Lab
CN109766278A (en) * 2019-01-10 2019-05-17 中天宽带技术有限公司 The backstage gateway WEB automatic test approach based on OSGI frame
CN111726607A (en) * 2020-06-28 2020-09-29 深圳市友华通信技术有限公司 Method and system for testing hardware of convergence gateway
CN112019405A (en) * 2020-08-31 2020-12-01 深圳市吉祥腾达科技有限公司 Automatic testing method and system
CN112350877A (en) * 2019-08-07 2021-02-09 ***通信有限公司研究院 Test method, test platform, intelligent gateway and test system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130297973A1 (en) * 2012-05-04 2013-11-07 Aegis.Net, Inc. Automated Conformance and Interoperability Test Lab
CN103259713A (en) * 2013-04-15 2013-08-21 海信集团有限公司 Message exchange system and method
CN109766278A (en) * 2019-01-10 2019-05-17 中天宽带技术有限公司 The backstage gateway WEB automatic test approach based on OSGI frame
CN112350877A (en) * 2019-08-07 2021-02-09 ***通信有限公司研究院 Test method, test platform, intelligent gateway and test system
CN111726607A (en) * 2020-06-28 2020-09-29 深圳市友华通信技术有限公司 Method and system for testing hardware of convergence gateway
CN112019405A (en) * 2020-08-31 2020-12-01 深圳市吉祥腾达科技有限公司 Automatic testing method and system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115250197A (en) * 2022-06-02 2022-10-28 苏州思萃工业互联网技术研究所有限公司 Device for automatically creating container discovery service
CN115250197B (en) * 2022-06-02 2024-04-12 苏州思萃工业互联网技术研究所有限公司 Device for automatically creating container discovery service
CN116915875A (en) * 2023-09-12 2023-10-20 深圳市天思智慧科技有限公司 General method for analyzing modbus equipment by Internet of things and modbus system
CN116915875B (en) * 2023-09-12 2023-12-05 深圳市天思智慧科技有限公司 General method for analyzing modbus equipment by Internet of things and modbus system

Also Published As

Publication number Publication date
CN113315681B (en) 2022-11-08

Similar Documents

Publication Publication Date Title
US10255102B2 (en) Transaction control arrangement for device management system
US8555273B1 (en) Network for updating electronic devices
US8893110B2 (en) Device management in a network
US7644405B2 (en) System with required enhancements to SyncML DM environment to support firmware updates
CN113315681B (en) Automatic testing method and system based on intelligent home gateway plug-in
CN109768970B (en) Configurable universal protocol generation method
US7296190B2 (en) Parallel text execution on low-end emulators and devices
CN112988485A (en) Simulation test method and device for power Internet of things equipment
CN111159019B (en) Application program testing method, testing control terminal and testing terminal
WO2022142153A1 (en) Electricity meter upgrading method and system, smart meter, and storage medium
CN110119350A (en) Software Development Kit test method, device and equipment and computer storage medium
CN112732231A (en) System of computer-implemented microservice development platform and method of providing microservices
CN116185460A (en) Method and device for automatically upgrading embedded system software
CN113259996A (en) IOT wireless debugging method and equipment
US20050148329A1 (en) Smartphone profiler system and method
EP2445171B1 (en) File transfer protocol client and implementing method thereof
CN112688800A (en) Remote maintenance method and system for intelligent equipment of intelligent power grid based on script technology
CN101938765B (en) The method and system of a kind of webmaster and network element automatic adaptation
WO2022257927A1 (en) Key burning method and apparatus, electronic device board card, and storage medium
US20120054326A1 (en) Remotely Managing an Application on a Device by a Management Server
CN114827967B (en) Software updating method, bluetooth device and storage medium
CN114356774A (en) Target service test method, device, equipment and storage medium
CN110955537B (en) Method and device for containing pipes by physical machine
CN113608993A (en) Automatic testing device, method, equipment and medium of MCS system
CN116866239A (en) Service interface testing method, device and equipment

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