Background
The lower wireless router is connected with a wireless network of the upper wireless router through a wireless expansion function, and a lower terminal connected with the lower wireless router can access the Internet through the upper wireless router; thereby expanding wireless network signals of the uplink wireless router.
When the downlink wireless router starts a wireless extension function, the abnormal access of the wireless network is easy to occur, so that the downlink wireless router and the downlink terminal can not operate normally. In order to ensure that the downlink wireless router can normally operate, the wireless extension function of the downlink wireless router needs to be tested.
Currently, it is usually tested in a manual test mode whether the wireless extension function of the downstream wireless router is normal. Because the number of test items is large and the test task amount is large, the wireless extension function of the downlink wireless router is usually tested in a test mode.
However, the manual testing method has the defects of long testing time, low testing efficiency, incapability of testing for a long time in a circulating manner and the like; and the defect that the wireless extension function cannot be accurately tested due to the test is also existed.
Disclosure of Invention
The technical scheme provided by the invention is as follows:
the invention provides a test method of wireless extension function, comprising the following steps: s10, configuring wireless network parameters of the uplink network equipment on the second test terminal through the first test terminal; s20, configuring network connection parameters of the network equipment to be tested on the second test terminal according to the wireless network parameters of the uplink network equipment; and S30, testing the wireless network expansion function on the network equipment to be tested on the second test terminal according to the network environment parameters of the network equipment to be tested.
Further, the step S30 further includes: s31, detecting whether a network channel between the network equipment to be detected and the uplink network equipment is in a connected state; s32, when the network channel between the network equipment to be tested and the upper network equipment is in an unconnected state, ending the test process; and S33, when the network channel between the network equipment to be tested and the uplink network equipment is in a connected state, recording test reference data of the network equipment to be tested, wherein the test reference data comprises test cycle times, an encryption mode and a corresponding encryption standard.
Further, the step S30 further includes: s34, after recording the test reference data of the network equipment to be tested, detecting whether the network equipment to be tested can successfully access the Internet; s35, when the network equipment to be tested can access the Internet, recording the result of successful Internet access; and S36, recording the result of Internet access failure when the network equipment to be tested cannot access the Internet.
Further, the step S10 further includes: s11, accessing the first test terminal on the second test terminal, and enabling the uplink network device script configured on the first test terminal; s12, using the script of the upper network device to access the web page of the upper network device, and entering the wireless configuration page on the web page; s13, configuring the wireless encryption mode and the encryption standard of the uplink network equipment on the wireless configuration page.
Further, the step S20 further includes: s21, logging in a wireless extension page on the network equipment to be tested on the second test terminal; and S22, inputting the SSID name and the password of the network equipment for uploading on the wireless extension page.
Further, the method also comprises the following steps: s40, judging whether the cycle number of the network equipment to be tested meets a preset cycle number or not; when the cycle number of the network equipment to be tested does not meet the preset cycle number, repeating the steps, and testing the wireless expansion function of the network equipment to be tested in another wireless encryption mode and encryption standard on the uplink network equipment; otherwise, the test procedure is ended.
Further, the method also comprises the following steps: s01, configuring the same network environment parameters on the first test terminal and the second test terminal, wherein the first test terminal is connected to the second test terminal through a wired network; the first test terminal is connected to the uplink network equipment through a wired network, and the second test terminal is connected to the network equipment to be tested through the wired network.
The invention also provides a test system of wireless extension function, which comprises a first test terminal, a second test terminal, an uplink network device and a network device to be tested, wherein the second test terminal comprises: the configuration module is used for configuring wireless network parameters of the uplink network equipment on the second test terminal through the first test terminal; the configuration module is further configured to configure network connection parameters of the network device to be tested on the second test terminal according to the wireless network parameters of the uplink network device; and the test module is used for testing the wireless network expansion function on the network equipment to be tested on the second test terminal according to the network environment parameters of the network equipment to be tested.
Further, the second test terminal further includes: the detection module is used for detecting whether a network channel between the network equipment to be detected and the uplink network equipment is in a communication state; the test module is further configured to end the test process when the network channel between the network device to be tested and the uplink network device is in an unconnected state; and the recording module is used for recording the test reference data of the network equipment to be tested when the network channel between the network equipment to be tested and the uplink network equipment is in a communication state, wherein the test reference data comprises the test cycle number, an encryption mode and a corresponding encryption standard.
Further, the detection module is further configured to detect whether the network device to be tested can successfully access the internet after recording the test reference data of the network device to be tested; the recording module is further used for recording the result of successful internet access when the network equipment to be tested can access the internet; the recording module is further used for recording the result of internet access failure when the network equipment to be tested cannot access the internet.
Compared with the prior art, the invention provides a test method and a test system for wireless extension function, which has the following beneficial effects:
1) the invention configures the wireless network parameters of the network equipment on the second test terminal, then configures the network environment parameters of the network equipment to be tested on the second test terminal, and tests the wireless network expansion function of the network equipment to be tested on the second test terminal. The method can realize parameter configuration and wireless network extended function test only by operating on the second test terminal, thereby not only reducing the workload of testers, shortening the test period and reducing the test cost; and the testing strength is also enhanced, and the product quality is ensured.
2) The invention detects whether the network channel between the network equipment to be tested and the upper network equipment is in a connected state, the network between the network equipment to be tested and the upper network equipment is smooth and is a necessary hardware basic condition for accessing the Internet; the step-by-step test is beneficial to finding out the reason why the network equipment to be tested cannot normally run.
Detailed Description
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following description will be made with reference to the accompanying drawings. It is obvious that the drawings in the following description are only some examples of the invention, and that for a person skilled in the art, other drawings and embodiments can be derived from them without inventive effort.
For the sake of simplicity, the drawings only schematically show the parts relevant to the present invention, and they do not represent the actual structure as a product. In addition, in order to make the drawings concise and understandable, components having the same structure or function in some of the drawings are only schematically illustrated or only labeled. In this document, "one" means not only "only one" but also a case of "more than one".
As shown in fig. 1, according to an embodiment of the present invention, a method for testing a wireless extension function includes the following steps: s01, configuring the same network environment parameters on the first test terminal 10 and the second test terminal 20, where the network environment parameters include the same network segment static addresses, and the first test terminal 10 is connected to the second test terminal 20 through a wired network; the first test terminal 10 is connected to the uplink network device 30 through a wired network, and the second test terminal 20 is connected to the network device under test 40 through a wired network.
The first test terminal 10 is a test computer a, the second test terminal 20 is a test computer B, the network device 30 is an upper router, and the network device 40 is a router to be tested. The network port of the test computer A is connected with the LAN port of the upper router by a network cable, and the WAN port of the upper router is connected with the Internet; the network port of the test computer B is connected with the LAN port of the router to be tested by a network cable, and the test computer A and the test computer B (the two computers are double-network-card computers) are connected with each other by the network cable and are configured with static addresses in the same network segment.
S10, starting the test system on the second test terminal 20 (test computer B), and configuring the wireless network parameters of the uplink network device 30 on the second test terminal 20 (test computer B) through the first test terminal 10 (test computer a), where the wireless network parameters include a wireless encryption mode and an encryption standard;
s20, configuring network connection parameters of the network device to be tested 40 (router to be tested) on the second test terminal 20 (test computer B) according to the wireless network parameters of the network device to be tested 30 (router to be connected), where the network connection parameters include SSID names and passwords;
s30, testing the wireless network expansion function of the network device 40 (router under test) on the second test terminal 20 (test computer B) according to the network environment parameters of the network device 40 (router under test).
Specifically, after the test system is started on the test computer B, the test system calls a terminal script to access the test computer A and starts an upper-connection router configured on the test computer A; and configuring wireless network parameters of the uplink router, such as a wireless encryption mode and an encryption standard. The testing computer B is configured with the network connection parameters of the router to be tested, such as SSID name and password to be connected. Testing the wireless expansion function of the router to be tested on a testing computer B; the method comprises the steps that a tester does not need to manually set wireless network parameters on the router to be tested, and network connection parameters are manually set on the router to be tested; the method concentrates all operations on the testing computer B, saves the testing time and improves the testing efficiency.
As shown in fig. 4, according to another embodiment of the present invention, a method for testing a wireless extension function includes the following steps: s01, configuring the same network environment parameters on the first test terminal 10 and the second test terminal 20, where the network environment parameters include the same network segment static addresses, and the first test terminal 10 is connected to the second test terminal 20 through a wired network; the first test terminal 10 is connected to the uplink network device 30 through a wired network, and the second test terminal 20 is connected to the network device under test 40 through a wired network.
The first test terminal 10 is a test computer a, the second test terminal 20 is a test computer B, the uplink network device 30 is an uplink wireless router, and the network device to be tested 40 is a wireless router to be tested. The network port of the test computer A is connected with the LAN port of the upper wireless router by a network cable, and the WAN port of the upper wireless router is connected with the Internet; the network port of the test computer B is connected with the LAN port of the wireless router to be tested by a network cable, the test computer A and the test computer B (the two computers are double-network-card computers) are connected with each other by the network cable, and static addresses in the same network segment are configured.
S10, starting the test system on the second test terminal 20 (test computer B), and configuring the wireless network parameters of the uplink network device 30 (uplink wireless router) on the second test terminal 20 (test computer B) through the first test terminal 10 (test computer a), where the wireless network parameters include a wireless encryption mode and an encryption standard;
s20, configuring network connection parameters of the network device to be tested 40 (wireless router to be tested) on the second test terminal 20 (test computer B) according to the wireless network parameters of the network device to be connected 30 (wireless router to be connected), where the network connection parameters include SSID name and password;
s31, detecting whether a network channel between the network device under test 40 (wireless router under test) and the uplink network device 30 (uplink wireless router) is in a connected state;
s32, when the network channel between the network device under test 40 (wireless router under test) and the uplink network device 30 (uplink wireless router) is in an unconnected state, ending the test process;
s33, when the network channel between the network device to be tested 40 (wireless router to be tested) and the uplink network device 30 (wireless router to be connected) is in a connected state, recording the test reference data of the network device to be tested 40 (wireless router to be tested), where the test reference data includes the number of test cycles, an encryption manner, and a corresponding encryption standard.
S34, detecting whether the network equipment to be tested 40 (wireless router to be tested) can successfully access the Internet;
s35, when the network equipment to be tested 40 (wireless router to be tested) can access the Internet, calling getcode () to obtain the successful return value of Internet access, and recording the detection result of Internet access success (successful return value of Internet access) in the text;
s36, when the network equipment to be tested 40 (wireless router to be tested) can not access the Internet, invoking url lib2.url lopen to access the Internet and invoking getcode () to obtain an Internet access failure return value, and recording the detection result of Internet access failure (Internet access failure return value) in the text; the text is closed.
Specifically, a pop function is called to input a ping wireless router gateway command to be tested, and after an ICMP (Internet message control protocol) request data packet is sent to an upper wireless router by using the wireless router to be tested, whether the wireless router to be tested can receive an ICMP response packet responded by the upper wireless router or not is judged, so that whether a network between the wireless router to be tested and the upper wireless router is smooth or not is checked; the network between the wireless router to be tested and the uplink wireless router is smooth, and is a basic hardware condition that the wireless router to be tested can access the internet.
Under the condition that a network between the wireless router to be tested and the uplink wireless router is unobstructed, the wireless router to be tested can access the Internet, and under the condition that the wireless router to be tested can successfully access the Internet, the wireless expansion function of the wireless router to be tested is normal, so that wireless signals on the uplink wireless router can be expanded.
As shown in fig. 2, 3 and 5, according to still another embodiment of the present invention, a method for testing a wireless extension function includes the following steps: s01, configuring the same network environment parameters on the first test terminal 10 and the second test terminal 20, where the network environment parameters include the same network segment static addresses, and the first test terminal 10 is connected to the second test terminal 20 through a wired network; the first test terminal 10 is connected to the uplink network device 30 through a wired network, and the second test terminal 20 is connected to the network device under test 40 through a wired network.
The first test terminal 10 is a test computer a, the second test terminal 20 is a test computer B, the network device 30 is an upper router, and the network device 40 is a router to be tested. The network port of the test computer A is connected with the LAN port of the upper router by a network cable, and the WAN port of the upper router is connected with the Internet; the network port of the test computer B is connected with the LAN port of the router to be tested by a network cable, and the test computer A and the test computer B (the two computers are double-network-card computers) are connected with each other by the network cable and are configured with static addresses in the same network segment.
S11, calling a function telnetlib on the second test terminal 20, telnet accessing the first test terminal 10 (test computer a), and calling a function pybot to enable the script of the uplink network device 30 already configured on the first test terminal 10 (test computer a);
s12, calling a logic function to access a web page of the uplink network device 30 by using the script of the uplink network device 30, and calling a click element function to enter a wireless configuration page on the web page;
s13, calling an input text function to configure a wireless encryption manner of the uplink network device 30 on the wireless configuration page, the wireless encryption manner being one of open, wpa2 of 2.4G, wpa2 and open, wpa2 and wpa2 of 5G, and an encryption standard being one of aes and tkip.
S21, calling a logic function on the second test terminal 20 (test computer B) to start the network device 40 to be tested, and calling a click element function to log into a wireless extension page on the network device 40 to be tested;
s22, calling an input text function to input the SSID name and the password of the uplink network equipment 30 into the input box on the wireless extension page, and storing the SSID name and the password; the network device 30 is linked up on the network device under test 40 by SSID name and password association.
S31, detecting whether the network channel between the network device to be tested 40 and the uplink network device 30 is in a connected state;
s32, when the network channel between the network device to be tested 40 and the uplink network device 30 is in an unconnected state, ending the testing process;
s33, when the network channel between the network device to be tested 40 and the uplink network device 30 is in a connected state, recording test reference data of the network device to be tested 40, where the test reference data includes test cycle number, encryption mode, and corresponding encryption standard.
S34, detecting whether the network equipment 40 to be tested can successfully access the Internet;
s35, when the network device 40 to be tested can access the Internet, calling getcode () to obtain the successful return value of Internet access, and recording the detection result of Internet access success (successful return value of Internet access) in the text;
s36, when the network equipment 40 to be tested can not access the Internet, invoking url lib2.url lopen to access the Internet and invoking getcode () to obtain an Internet access failure return value, and recording the detection result of Internet access failure (Internet access failure return value) in the text; the text is closed.
Preferably, the method further includes step S40, determining whether the cycle number of the network device 40 to be tested meets a preset cycle number, where the preset cycle number is set according to wireless encryption modes in wireless networks under different transmission frequencies;
when the cycle number of the network device 40 to be tested does not meet the preset cycle number, repeating the above steps, and testing the wireless extension function of the network device 40 to be tested in another wireless encryption mode and encryption standard on the uplink network device 30; otherwise, the test procedure is ended.
Specifically, the testing computer A and the testing computer B are connected by a network cable, static addresses in the same network segment are configured, and the network between the testing computer A and the testing computer B is not communicated; when a function telnetlib, telnet is called, data interaction between the testing computer A and the testing computer B can be realized, and the testing computer B can access the testing computer A and configure a wireless encryption mode and an encryption standard on the uplink network equipment 30; telnet is closed, data interaction between the test computer a and the test computer B cannot be realized.
According to the wireless encryption mode of the 2.4G wireless network: wireless encryption for open, wpa (aes), wpa (tkip), wpa2(aes), wpa2(tkip), and 5G wireless networks: open, wpa (aes), wpa (tkip), wpa2(aes), wpa2(tkip) set the number of preset cycles required for the test, with aes \ tkip being the encryption standard.
As shown in fig. 6, according to an embodiment of the present invention, a test system for wireless extension function includes a first test terminal 10, a second test terminal 20, an uplink network device 30, and a network device under test 40:
preferably, the first test terminal 10 includes a configuration submodule 11, the second test terminal 20 includes a configuration module 21, the same network environment parameter is configured in the configuration submodule 11 on the first test terminal 10 and in the configuration module 21 on the second test terminal 20, the network environment parameter includes the same network segment static address, and the first test terminal 10 is connected to the second test terminal 20 through a wired network; the first test terminal 10 is connected to the uplink network device 30 through a wired network, and the second test terminal 20 is connected to the network device under test 40 through a wired network.
The first test terminal 10 is a test computer a, the second test terminal 20 is a test computer B, the network device 30 is an upper router, and the network device 40 is a router to be tested. The network port of the test computer A is connected with the LAN port of the upper router by a network cable, and the WAN port of the upper router is connected with the Internet; the network port of the test computer B is connected with the LAN port of the router to be tested by a network cable, and the test computer A and the test computer B (the two computers are double-network-card computers) are connected with each other by the network cable and are configured with static addresses in the same network segment.
The second test terminal 20 comprises an access module 22 and a starting module 23, the access module 22 is used for calling a function telnetlib. telnet on the second test terminal 20 to access the first test terminal 10 (test computer a), and the starting module 23 is used for calling a function pybot to enable the script of the uplink network device 30 configured on the first test terminal 10 (test computer a);
the second test terminal 20 comprises a page login module 24, the access module 22 is configured to call a logic function to access a web page of the uplink network device 30 by using the script of the uplink network device 30, and the page login module 24 is configured to call a click element function to enter a wireless configuration page on the web page;
the configuration module 21 is configured to invoke an input text function to configure a wireless encryption scheme of the upstream network device 30 on the wireless configuration page, the wireless encryption scheme being one of 2.4G open, wpa2, wpa2, and 5G open, wpa2, wpa2, and an encryption standard being one of aes and tkip.
The starting module 23 is configured to call a logic function on the second test terminal 20 (test computer B) to start the network device 40 to be tested, and the page login module 24 is configured to call a click element function to log in a wireless extension page on the network device 40 to be tested;
the second test terminal 20 includes an input module 25, configured to invoke an input text function to input the SSID name and the password of the uplink network device 30 in the input box on the wireless extension page, and store the SSID name and the password.
The second test terminal 20 includes a detection module 26, configured to detect whether a network channel between the network device to be tested 40 and the uplink network device 30 is in a connected state;
the second test terminal 20 includes a test module 27, configured to end a test process when a network channel between the network device to be tested 40 and the uplink network device 30 is in an unconnected state;
the second test terminal 20 includes a recording module 28, configured to record test reference data of the network device to be tested 40 when a network channel between the network device to be tested 40 and the uplink network device 30 is in a connected state, where the test reference data includes test cycle times, an encryption manner, and a corresponding encryption standard.
The detection module 26 is further configured to detect whether the network device 40 to be detected can successfully access the internet;
the recording module 28 is further configured to call when the network device 40 to be tested can access the internet, getcode () obtains a return value of successful internet access, and records a detection result of successful internet access (return value of successful internet access) in a text;
the recording module 28 is further configured to call url lib2.url lopen to access the Internet and call when the network device 40 to be tested cannot access the Internet, getcode () obtains an Internet access failure return value, and records a detection result of Internet access failure (Internet access failure return value) in a text; the text is closed.
Preferably, the second test terminal 20 includes a determining module 29, configured to determine whether the cycle number of the network device 40 to be tested meets a preset cycle number, where the preset cycle number is set according to a wireless encryption manner in a wireless network under different transmitting frequencies;
when the cycle number of the network device 40 to be tested does not meet the preset cycle number, repeating the above steps, and testing the wireless extension function of the network device 40 to be tested in another wireless encryption mode and encryption standard on the uplink network device 30; otherwise, the test procedure is ended.
As shown in fig. 7, according to another embodiment of the present invention, a method for testing a wireless extension function includes the following steps: and (3) testing the topology: the network port of a test computer A is connected with the LAN port of the wireless network equipment by a network cable, and the WAN port of the router is connected with the Internet; the network port of a test computer B is connected with the LAN port of the equipment to be tested by a network cable, the test computer A and the test computer B (the two computers are double-network-card computers) are connected with each other by the network cable, and static addresses in the same network segment are configured; begin testing the telent function of computer a.
The tester starts the test system on the test computer B.
Accessing a testing computer A by a system calling function telnetlib. Telnet, and calling a function pybot command to start a configuration uplink wireless router script in the testing computer A;
step 2, a script calls a logic function to access a web page of the uplink wireless router, a click element function is called to click to enter a wireless configuration page, an input text function is called to configure a wireless encryption mode of the uplink wireless router to be OPEN, and the wireless encryption mode is clicked and stored;
step 3, calling a close () function to end Telnet after the storage is finished;
step 4, the system calls a logic function to log in the equipment to be tested, calls a click element function to click to enter a wireless extension page, calls an input text function to position an input box, fills an upper connection SSID, clicks and stores the input text function;
calling a supbpprocesses.Popen function to input a command of ping a gateway of the device to be tested to monitor whether the device to be tested is abnormal, and ending the test if the device to be tested is abnormal;
step 6, if no abnormity exists, calling open to open the text in an insertion mode, and writing the cycle number, the encryption mode and the encryption standard into the text; getcode () acquires an access return value, if the access return value is acquired, the access is successful, and the Internet is successfully accessed in the text, and if the access return value is acquired, the access is failed, and the Internet is unsuccessfully accessed in the text; closing the text;
accessing the testing computer A by using telnetlib and Telnet, and calling a function pybot command to start a configuration uplink wireless router script in the testing computer A;
step 8, calling a logic function by a script to access a web page of the uplink wireless router, calling a click element function to click to enter a wireless configuration page, calling an input text function to select a wireless encryption mode encryption standard of the uplink wireless router, and filling a password to click for storage;
step 9, calling a close () function to end Telnet after the storage is finished;
step 10, a system calls a logic function to log in the equipment to be tested, calls a click element function to click to enter a wireless extension page, calls an input text function to position an input box, fills an upper connection SSID and a password, and clicks and stores the input text function;
and 11, repeating the steps 5-6.
And 12, judging whether the circulating value meets the test requirement, if so, ending the test, and if not, circulating the steps 1-12.
Cycles were performed sequentially with 2.4G open, wpa (aes), wpa (tkip), wpa2(aes), wpa2(tkip), and 5G open, wpa (aes), wpa (tkip), wpa2(aes), wpa2(tkip) (aes \ tkip is the encryption standard).
The invention realizes the remote automatic configuration of the wireless router of the uplink on another test computer by means of telnet and pybot commands. The method has the advantages that the testing strength is enhanced, and the product quality is ensured; the workload of a tester is reduced; the test period is shortened; and the testing cost is reduced.
It should be noted that the above embodiments can be freely combined as necessary. The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.