Automatic testing method and device, electronic equipment and storage medium

文档序号:7403 发布日期:2021-09-17 浏览:27次 中文

1. An automatic test method is characterized by being used for a test system, wherein the test system comprises a tested device, a tester and an intermediate switch;

the method comprises the following steps:

determining target tested equipment, the number of ports of the required tester and idle tester ports;

determining a test path based on the target tested equipment, the number of ports of the required tester, the ports of the idle tester, a first mapping relation between the ports of the tester and the ports of the intermediate switches, a second mapping relation between the ports of the intermediate switches and the ports of the tested equipment, a third mapping relation between the ports of different intermediate switches and a preset rule; the test path comprises a target tester port, a target tested device port and a target intermediate switch port in the idle tester ports;

configuring the target intermediate switch port for testing the target device under test and setting the target tester port to a use state;

and when the target tested equipment is tested, releasing the port of the target tester, setting the port of the target tester to be in an idle state, and clearing the configuration of the port of the target intermediate switch.

2. The automated testing method of claim 1, wherein determining a testing path based on the target device under test, the number of ports of the required tester, the idle tester ports, the first mapping relationship between the tester ports and the intermediate switch ports, the second mapping relationship between the intermediate switch ports and the device under test ports, the third mapping relationship between the ports of different intermediate switches, and a preset rule comprises:

determining a candidate path from the idle tester port to the target device under test;

for each candidate path, determining a cascade path of a target intermediate switch contained in the candidate path and a weight coefficient corresponding to each cascade path;

determining a weighted hop count corresponding to the candidate path based on the cascade path and a weight coefficient;

and selecting the candidate path with the minimum weighted hop number as a test path, and taking an idle tester port in the test path as the target tester port.

3. The automated testing method of claim 2, wherein determining the weighted hop count corresponding to the candidate path based on the cascade path and a weighting factor comprises:

summing the weighting coefficients corresponding to the cascade paths in the candidate paths to obtain the weighted hop count corresponding to the candidate paths; wherein the weight coefficient is the reciprocal of the square of the number of idle ports of the cascade path.

4. The automated testing method of claim 1, wherein said determining the idle tester port comprises:

polling the state of the tester port at regular time, if the tester port is in an idle state, clearing the configuration of the tester port, and adding the tester port into an idle list;

determining the idle tester port based on the idle list.

5. The automated testing method of claim 1, wherein said configuring the target intermediate switch port for testing comprises:

and respectively configuring the target intermediate switch ports in each test path so as to enable the target intermediate switch ports of the same test path to be positioned in the same virtual local area network.

6. The automated testing method of claim 2, further comprising:

grouping the tester ports connected to the same intermediate switch;

if a plurality of candidate paths with the minimum weighted hop count exist, selecting the tester port with the most idle ports in the same group and the corresponding candidate path as the target tester port and the corresponding test path;

and if the number of the idle ports in the same group is the same, randomly selecting one candidate path from the candidate paths as a test path, and taking the idle tester port in the test path as the target tester port.

7. An automatic testing device is characterized by being used for a testing system, wherein the testing system comprises a tested device, a tester and an intermediate switch;

the device comprises:

the test preparation unit is used for determining target tested equipment, the number of ports of the required tester and idle tester ports;

determining a test path unit, and determining a test path based on the target tested equipment, the number of ports of the required tester, idle tester ports, a first mapping relation between the tester ports and the intermediate switch ports, a second mapping relation between the intermediate switch ports and the tested equipment ports, a third mapping relation between ports among different intermediate switches and a preset rule; the test path comprises a target tester port, a target tested device port and a target intermediate switch port in the idle tester ports;

the port configuration unit is used for configuring the target intermediate switch port so as to be used for testing the target tested device and setting the target tester port to be in a use state;

and the configuration clearing unit is used for releasing the port of the target tester and setting the port of the target tester to be in an idle state after the target tested equipment is tested, and clearing the configuration of the port of the target intermediate switch.

8. The automated testing device of claim 7, wherein the determine test path unit is further configured to:

determining a candidate path from the idle tester port to the target device under test;

for each candidate path, determining a cascade path of a target intermediate switch contained in the candidate path and a weight coefficient corresponding to each cascade path;

determining a weighted hop count corresponding to the candidate path based on the cascade path and a weight coefficient;

and selecting the candidate path with the minimum weighted hop number as a test path, and taking an idle tester port in the test path as the target tester port.

9. The automated testing device of claim 8, wherein the determine test path unit is further configured to:

summing the weighting coefficients corresponding to the cascade paths in the candidate paths to obtain the weighted hop count corresponding to the candidate paths; wherein the weight coefficient is the reciprocal of the square of the number of idle ports of the cascade path.

10. The automated testing device of claim 7, wherein the test preparation unit is further configured to:

polling the state of the tester port at regular time, if the tester port is in an idle state, clearing the configuration of the tester port, and adding the tester port into an idle list;

determining the idle tester port based on the idle list.

11. The automated testing apparatus of claim 7, wherein the port configuration unit is further configured to:

and respectively configuring the target intermediate switch ports in each test path so as to enable the target intermediate switch ports of the same test path to be positioned in the same virtual local area network.

12. The automated testing device of claim 8, wherein the determine test path unit is further configured to:

grouping the tester ports connected to the same intermediate switch;

if a plurality of candidate paths with the minimum weighted hop count exist, selecting the tester port with the most idle ports in the same group and the corresponding candidate path as the target tester port and the corresponding test path;

and if the number of the idle ports in the same group is the same, randomly selecting one candidate path from the candidate paths as a test path, and taking the idle tester port in the test path as the target tester port.

13. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the automated testing method according to any one of claims 1 to 6 are implemented when the program is executed by the processor.

14. A non-transitory computer readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the automated testing method according to any one of claims 1 to 6.

Background

When carrying out the test of digital equipment such as switch and router, need use the tester, because the tester port is limited, when carrying out the test of different equipment or need increase the port that equipment and tester link to each other, need artifical plug cable, link to each other tester port and equipment under test. Whether manual testing or automatic testing is adopted, under the condition that the port of the tester is limited, the service condition of the port of the tester needs to be manually evaluated and the testing topology needs to be frequently replaced, a large amount of time and energy are wasted, the working efficiency is low, the number of the ports of the tester which need to be used during testing is also dynamically changed, the ports of the tester are generally occupied too much, the resource waste of the ports of the tester is caused, and the flexible allocation of the ports cannot be realized.

Disclosure of Invention

The invention provides an automatic testing method and device, which are used for overcoming the defects that in the prior art, the use condition of a tester port is artificially evaluated and the test topology is frequently replaced, and realizing flexible allocation of the tester port.

The invention provides an automatic test method, which is used for a test system, wherein the test system comprises a tested device, a tester and an intermediate switch;

the method comprises the following steps:

determining target tested equipment, the number of ports of the required tester and idle tester ports;

determining a test path based on the target tested equipment, the number of ports of the required tester, the ports of the idle tester, a first mapping relation between the ports of the tester and the ports of the intermediate switches, a second mapping relation between the ports of the intermediate switches and the ports of the tested equipment, a third mapping relation between the ports of different intermediate switches and a preset rule; the test path comprises a target tester port, a target tested device port and a target intermediate switch port in the idle tester ports;

configuring the target intermediate switch port for testing the target device under test and setting the target tester port to a use state;

and when the target tested equipment is tested, releasing the port of the target tester, setting the port of the target tester to be in an idle state, and clearing the configuration of the port of the target intermediate switch.

According to an automated testing method provided by the present invention, the determining a testing path based on the target device under test, the number of ports of the required tester, the ports of the idle tester, the first mapping relationship between the ports of the tester and the ports of the intermediate switches, the second mapping relationship between the ports of the intermediate switches and the ports of the device under test, the third mapping relationship between the ports of different intermediate switches, and the preset rule includes:

determining a candidate path from the idle tester port to the target device under test;

for each candidate path, determining a cascade path of a target intermediate switch contained in the candidate path and a weight coefficient corresponding to each cascade path;

determining a weighted hop count corresponding to the candidate path based on the cascade path and a weight coefficient;

and selecting the candidate path with the minimum weighted hop number as a test path, and taking an idle tester port in the test path as the target tester port.

According to an automatic testing method provided by the present invention, the determining the weighted hop count corresponding to the candidate path based on the cascade path and the weight coefficient includes:

summing the weighting coefficients corresponding to the cascade paths in the candidate paths to obtain the weighted hop count corresponding to the candidate paths; wherein the weight coefficient is the reciprocal of the square of the number of idle ports of the cascade path.

According to an automated testing method provided by the invention, the determining the idle tester port comprises the following steps:

polling the state of the tester port at regular time, if the tester port is in an idle state, clearing the configuration of the tester port, and adding the tester port into an idle list;

determining the idle tester port based on the idle list.

According to an automated testing method provided by the present invention, the configuring the target intermediate switch port for testing includes:

and respectively configuring the target intermediate switch ports in each test path so as to enable the target intermediate switch ports of the same test path to be positioned in the same virtual local area network.

According to the automated testing method provided by the invention, the method further comprises the following steps:

grouping the tester ports connected to the same intermediate switch;

if a plurality of candidate paths with the minimum weighted hop count exist, selecting the tester port with the most idle ports in the same group and the corresponding candidate path as the target tester port and the corresponding test path;

and if the number of the idle ports in the same group is the same, randomly selecting one candidate path from the candidate paths as a test path, and taking the idle tester port in the test path as the target tester port.

The invention also provides an automatic testing device, which is used for testing a system, wherein the testing system comprises a tested device, a tester and an intermediate switch;

the device comprises:

the test preparation unit is used for determining target tested equipment, the number of ports of the required tester and idle tester ports;

determining a test path unit, and determining a test path based on the target tested equipment, the number of ports of the required tester, idle tester ports, a first mapping relation between the tester ports and the intermediate switch ports, a second mapping relation between the intermediate switch ports and the tested equipment ports, a third mapping relation between ports among different intermediate switches and a preset rule; the test path comprises a target tester port, a target tested device port and a target intermediate switch port in the idle tester ports;

the port configuration unit is used for configuring the target intermediate switch port so as to be used for testing the target tested device and setting the target tester port to be in a use state;

and the configuration clearing unit is used for releasing the port of the target tester and setting the port of the target tester to be in an idle state after the target tested equipment is tested, and clearing the configuration of the port of the target intermediate switch.

According to an automated testing device provided by the present invention, the test path determining unit is further configured to:

determining a candidate path from the idle tester port to the target device under test;

for each candidate path, determining a cascade path of a target intermediate switch contained in the candidate path and a weight coefficient corresponding to each cascade path;

determining a weighted hop count corresponding to the candidate path based on the cascade path and a weight coefficient;

and selecting the candidate path with the minimum weighted hop number as a test path, and taking an idle tester port in the test path as the target tester port.

According to an automated testing device provided by the present invention, the test path determining unit is further configured to:

summing the weighting coefficients corresponding to the cascade paths in the candidate paths to obtain the weighted hop count corresponding to the candidate paths; wherein the weight coefficient is the reciprocal of the square of the number of idle ports of the cascade path.

According to an automated testing device provided by the invention, the test preparation unit is further configured to:

polling the state of the tester port at regular time, if the tester port is in an idle state, clearing the configuration of the tester port, and adding the tester port into an idle list;

determining the idle tester port based on the idle list.

According to an automatic testing device provided by the present invention, the port configuration unit is further configured to:

and respectively configuring the target intermediate switch ports in each test path so as to enable the target intermediate switch ports of the same test path to be positioned in the same virtual local area network.

According to an automated testing device provided by the present invention, the test path determining unit is further configured to:

grouping the tester ports connected to the same intermediate switch;

if a plurality of candidate paths with the minimum weighted hop count exist, selecting the tester port with the most idle ports in the same group and the corresponding candidate path as the target tester port and the corresponding test path;

and if the number of the idle ports in the same group is the same, randomly selecting one candidate path from the candidate paths as a test path, and taking the idle tester port in the test path as the target tester port.

The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the steps of any one of the automatic testing methods.

The invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the automated testing method as described in any of the above.

According to the automatic testing method and device, the electronic equipment and the storage medium, the plurality of intermediate switches are connected in front of the tester and the tested equipment to logically expand the ports of the tester, the using condition of the ports of the tester is automatically evaluated, the optimal idle ports of the tester are selected and a logical path is planned, and then the intermediate switches are correspondingly configured to enable the link layers of the tester and the tested equipment to be communicated, so that the ports of the tester are flexibly distributed.

Drawings

In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.

FIG. 1 is a flow chart of an automated testing method according to an embodiment of the present invention;

FIG. 2 is a schematic diagram of a test cell topology according to an embodiment of the present invention;

FIG. 3 is a second schematic flowchart of an automated testing method according to an embodiment of the present invention;

FIG. 4 is a second schematic diagram of a test cell topology according to an embodiment of the present invention;

FIG. 5 is a third schematic flow chart of an automated testing method according to an embodiment of the present invention;

FIG. 6 is a fourth flowchart illustrating an automated testing method according to an embodiment of the present invention;

FIG. 7 is a schematic structural diagram of an automatic test apparatus according to an embodiment of the present invention;

fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

The technical solutions provided by the embodiments of the present invention are described below with reference to fig. 1 to 8.

Fig. 1 is a schematic flow chart of an automated testing method according to an embodiment of the present invention, where the method includes:

step 110, determining the target device under test, the number of ports of the required tester, and the idle tester ports.

Step 120, determining a test path based on the target tested device, the number of ports of the required tester, the ports of the idle tester, a first mapping relation between the ports of the tester and the ports of the intermediate switches, a second mapping relation between the ports of the intermediate switches and the ports of the tested device, a third mapping relation between the ports of different intermediate switches and a preset rule; the test path comprises a target tester port, a target tested device port and a target intermediate switch port in the idle tester ports.

Step 130, configuring the target intermediate switch port for testing the target device under test, and setting the target tester port to a use state.

And 140, after the target tested device finishes testing, releasing the port of the target tester, setting the port of the target tester to be in an idle state, and clearing the configuration of the port of the target intermediate switch.

It should be noted that, firstly, the test unit topology shown in fig. 2 needs to be built to realize the automatic flexible scheduling of the tester ports. Specifically, all ports of the tester are evenly distributed according to the number of the intermediate switches and are connected with the intermediate switches, 6 cables are connected between the intermediate switches and the intermediate switches to serve as cascade paths, all tested devices are connected with one of the intermediate switches when being put on the shelf, and the PC control unit which can reach the ip of the row test unit executes the scheduling of the ports of the tester, so that the target tested devices can be accessed into the tester at any time for testing.

According to the test unit topology, mapping relations among the device ports can be established, a first mapping relation between the tester port and the intermediate switch port, a second mapping relation between the intermediate switch port and the tested device port and a third mapping relation between the different intermediate switches are stored in a database, and the port name of the tester port and the device name of the tested device are used as indexes.

Based on the mapping relation between the device ports, the optimal idle tester port and the corresponding test path can be automatically selected according to the preset rule for testing the target tested device. If a plurality of tested devices need to be tested continuously, the device names of the tested devices can be input in sequence, and the corresponding target tested devices can be determined to be tested according to the device names. The test mode comprises automatic test and manual test, if the manual test is needed, the tester and the target tested equipment can be directly logged in for testing; if the automatic test is needed, the automatic test of the function of the tested device is carried out, the port of the tester is released after the test is finished, the port of the tester is set to be in an idle state, the configuration of the intermediate switch is cleared, and if a plurality of switches need to be tested, the step of selecting the test path is continuously executed to establish the link layer access between the tester and the tested device.

The automatic test method provided by the invention realizes logical expansion of the tester ports by connecting a plurality of intermediate switches before the tester and the tested equipment, simultaneously automatically evaluates the use condition of the tester ports, selects the optimal idle tester ports and plans a logical path, and then sends corresponding configuration to the intermediate switches to ensure that the tester is communicated with the link layer of the tested equipment, thereby realizing flexible distribution of the tester ports.

Further, in an embodiment of the present invention, step 120 specifically includes:

and step 310, determining a candidate path from the idle tester port to the target device under test.

And step 320, for each candidate path, determining the cascade path of the target intermediate switch included in the candidate path and the weight coefficient corresponding to each cascade path.

And step 330, determining the weighted hop count corresponding to the candidate path based on the cascade path and the weight coefficient.

And 340, selecting the candidate path with the minimum weighted hop count as a test path, and taking an idle tester port in the test path as a target tester port.

The following describes the process of determining the test path with reference to fig. 4, as shown in fig. 4, the device under test 1 needs to be tested, and finds that only the port connected to the intermediate switch 2 is an idle port by querying the use state of the tester port, and at this time, the following two candidate paths, candidate path 1, exist between the idle port and the device under test 1: in this embodiment, a weight coefficient corresponding to an intermediate switch cascade path of each candidate path and a weighted hop count of the candidate path are determined according to a load balancing principle of the intermediate switch and a least used intermediate switch principle, for example, assuming that the weight coefficient is the inverse of the square of the number of idle ports of the cascade path, the weight coefficients corresponding to the cascade paths in the candidate paths are summed to obtain the weighted hop count corresponding to the candidate path. Given that there are 2 idle ports between the intermediate switch 2 and the intermediate switch 1, 4 idle ports between the intermediate switch 2 and the intermediate switch 3, and 3 idle ports between the intermediate switch 3 and the intermediate switch 1, the weighted hop counts of the candidate path 1 and the candidate path 2 are 0.25 and 0.17, respectively, and the weighted hop count value of the candidate path 2 is the smallest, so that the candidate path 2 is selected as the test path.

Further, in an embodiment of the present invention, the idle tester port is determined by:

and step 510, polling the state of the tester port at regular time, clearing the configuration of the tester port if the tester port is in an idle state, and adding the tester port into an idle list.

Step 520 determines a free tester port based on the free list.

The present embodiment improves the utilization of the tester ports by periodically polling the status of the tester ports and maintaining a free port list.

Further, in an embodiment of the present invention, the step 130 specifically includes:

and respectively configuring the target intermediate switch ports in each test path to enable the target intermediate switch ports of the same test path to be positioned in the same virtual local area network, so that the tester is communicated with the link layer of the target tested equipment.

Further, in an embodiment of the present invention, considering that there may exist a plurality of candidate paths with the smallest weighted hop count, a screening rule needs to be further set to determine a final test path, which includes the following specific steps:

step 610, grouping tester ports connected to the same intermediate switch into a group.

And step 620, if a plurality of candidate paths with the minimum weighted hop count exist, selecting the tester port with the most idle ports in the same group and the corresponding candidate path as the target tester port and the corresponding test path.

Step 630, if the number of idle ports in the same group is the same, randomly selecting one candidate path from the candidate paths as a test path, and taking an idle tester port in the test path as a target tester port.

It should be noted that selecting the tester port with the most idle ports in the same group and the corresponding candidate path as the target tester port and the corresponding test path can implement load balancing of the intermediate switches, and avoid the situation that part of the intermediate switches are overloaded and other intermediate switches are in an idle state for a long time.

The following describes the automated testing device provided by the present invention, and the automated testing device described below and the automated testing method described above can be referred to correspondingly.

Fig. 7 is a schematic structural diagram of an automated testing apparatus according to an embodiment of the present invention, where the automated testing apparatus is used in a testing system including a device under test, a tester, and an intermediate switch, as shown in fig. 7, the automated testing apparatus includes:

a test preparation unit 710, configured to determine a target device under test, a required number of ports of a tester, and an idle tester port;

a determining test path unit 720, which determines a test path based on the target device under test, the number of ports of the required tester, the idle tester port, the first mapping relationship between the tester port and the intermediate switch port, the second mapping relationship between the intermediate switch port and the device under test port, the third mapping relationship between the ports of different intermediate switches, and a preset rule; the test path comprises a target tester port, a target tested device port and a target intermediate switch port in the idle tester ports;

a port configuration unit 730, configured to configure a target intermediate switch port for testing a target device under test, and set a target tester port to a use state;

and a configuration clearing unit 740, configured to, after the target device under test is completed, release the target tester port and set the target tester port to an idle state, and clear the configuration of the target intermediate switch port.

It should be noted that, firstly, the test unit topology shown in fig. 2 needs to be built to realize the automatic flexible scheduling of the tester ports. Specifically, all ports of the tester are evenly distributed according to the number of the intermediate switches and are connected with the intermediate switches, 6 cables are connected between the intermediate switches and the intermediate switches to serve as cascade paths, all tested devices are connected with one of the intermediate switches when being put on the shelf, and the PC control unit which can reach the ip of the row test unit executes the scheduling of the ports of the tester, so that the target tested devices can be accessed into the tester at any time for testing.

According to the test unit topology, mapping relations among the device ports can be established, a first mapping relation between the tester port and the intermediate switch port, a second mapping relation between the intermediate switch port and the tested device port and a third mapping relation between the different intermediate switches are stored in a database, and the port name of the tester port and the device name of the tested device are used as indexes.

Based on the mapping relation between the device ports, the optimal idle tester port and the corresponding test path can be automatically selected according to the preset rule for testing the target tested device. If a plurality of tested devices need to be tested continuously, the device names of the tested devices can be input in sequence, and the corresponding target tested devices can be determined to be tested according to the device names. The test mode comprises automatic test and manual test, if the manual test is needed, the tester and the target tested equipment can be directly logged in for testing; if the automatic test is needed, the automatic test of the function of the tested device is carried out, the port of the tester is released after the test is finished, the port of the tester is set to be in an idle state, the configuration of the intermediate switch is cleared, and if a plurality of switches need to be tested, the step of selecting the test path is continuously executed to establish the link layer access between the tester and the tested device.

The automatic testing device provided by the invention realizes logical expansion of the tester ports by connecting a plurality of intermediate switches before the tester and the tested equipment, simultaneously automatically evaluates the use condition of the tester ports, selects the optimal idle tester ports and plans a logical path, and then sends corresponding configuration to the intermediate switches to ensure that the tester is communicated with the link layer of the tested equipment, thereby realizing flexible allocation of the tester ports.

Further, in an embodiment of the present invention, the determine test path unit 720 is further configured to:

determining a candidate path from an idle tester port to a target tested device;

for each candidate path, determining a cascade path of a target intermediate switch contained in the candidate path and a weight coefficient corresponding to each cascade path;

determining a weighted hop count corresponding to the candidate path based on the cascade path and the weight coefficient;

and selecting the candidate path with the minimum weighted hop number as a test path, and taking an idle tester port in the test path as a target tester port.

Further, in an embodiment of the present invention, the determine test path unit 720 is further configured to:

summing the weight coefficients corresponding to the cascade paths in the candidate paths to obtain the weighted hop count corresponding to the candidate paths; the weight coefficient is the reciprocal of the square of the number of idle ports of the cascade path.

Further, in an embodiment of the present invention, the test preparation unit 710 is further configured to:

polling the state of the tester port at regular time, emptying the configuration of the tester port if the tester port is in an idle state, and adding the tester port into an idle list;

a free tester port is determined based on the free list.

Further, in an embodiment of the present invention, the port configuration unit 730 is further configured to:

and respectively configuring the target intermediate switch ports in each test path so as to enable the target intermediate switch ports of the same test path to be positioned in the same virtual local area network.

Further, in an embodiment of the present invention, the determine test path unit 720 is further configured to:

grouping tester ports connected to the same intermediate switch;

if a plurality of candidate paths with the minimum weighted hop count exist, selecting the tester port with the most idle ports in the same group and the corresponding candidate path as a target tester port and a corresponding test path;

and if the number of the idle ports in the same group is the same, randomly selecting one candidate path from the candidate paths as a test path, and taking the idle tester port in the test path as a target tester port.

Fig. 8 illustrates a physical structure diagram of an electronic device, and as shown in fig. 8, the electronic device may include: a processor (processor)810, a communication Interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication Interface 820 and the memory 830 communicate with each other via the communication bus 840. The processor 810 may invoke logic instructions in the memory 830 to perform an automated test method for testing a system, the test system including a device under test, a tester, and an intermediate switch, the method comprising: determining target tested equipment, the number of ports of the required tester and idle tester ports; determining a test path based on target tested equipment, the number of ports of required testers, idle tester ports, a first mapping relation between the tester ports and the intermediate switch ports, a second mapping relation between the intermediate switch ports and the tested equipment ports, a third mapping relation between ports among different intermediate switches and a preset rule; the test path comprises a target tester port, a target tested device port and a target intermediate switch port in the idle tester ports; configuring a target intermediate switch port for testing a target tested device, and setting a target tester port to be in a use state; and when the target tested equipment is tested, releasing the port of the target tester, setting the port of the target tester to be in an idle state, and clearing the configuration of the port of the target intermediate switch.

In addition, the logic instructions in the memory 830 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

In another aspect, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the automated testing method provided by the above embodiments, the method comprising: determining target tested equipment, the number of ports of the required tester and idle tester ports; determining a test path based on target tested equipment, the number of ports of required testers, idle tester ports, a first mapping relation between the tester ports and the intermediate switch ports, a second mapping relation between the intermediate switch ports and the tested equipment ports, a third mapping relation between ports among different intermediate switches and a preset rule; the test path comprises a target tester port, a target tested device port and a target intermediate switch port in the idle tester ports; configuring a target intermediate switch port for testing a target tested device, and setting a target tester port to be in a use state; and when the target tested equipment is tested, releasing the port of the target tester, setting the port of the target tester to be in an idle state, and clearing the configuration of the port of the target intermediate switch.

In yet another aspect, the present invention also provides a non-transitory computer readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to execute the automated testing method provided by the above embodiments, the method including: determining target tested equipment, the number of ports of the required tester and idle tester ports; determining a test path based on target tested equipment, the number of ports of required testers, idle tester ports, a first mapping relation between the tester ports and the intermediate switch ports, a second mapping relation between the intermediate switch ports and the tested equipment ports, a third mapping relation between ports among different intermediate switches and a preset rule; the test path comprises a target tester port, a target tested device port and a target intermediate switch port in the idle tester ports; configuring a target intermediate switch port for testing a target tested device, and setting a target tester port to be in a use state; and when the target tested equipment is tested, releasing the port of the target tester, setting the port of the target tester to be in an idle state, and clearing the configuration of the port of the target intermediate switch.

The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.

Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.

Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:SSD的自动化测试系统及方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!