Disclosure of Invention
The invention provides a management method of stacking equipment in an automatic test and an automatic test platform, which aim to solve the equipment management problem of the stacking equipment and member equipment in the stacking equipment in the automatic test in the prior art.
The invention mainly aims to provide a management method of stacking equipment in an automatic test, which comprises the following steps:
carrying out occupation check on stacking equipment required to be occupied by the test task;
and when checking that the stacking equipment and the member equipment in the stacking equipment are idle, setting the same occupation success marks for the stacking equipment and the member equipment.
Further, after the step of setting the same occupation success flag for both the stacking device and the member device, the method further comprises:
the step of logging in the member devices of the stacking device one by one to perform configuration check specifically includes:
when the member equipment is detected to be in the single machine mode, carrying out stacking configuration on the member equipment according to the preset configuration parameters of the stacking equipment and switching to the stacking mode;
and when the member equipment is detected to be in a stacking mode and the stacking configuration of the member equipment is judged to be not in accordance with the preset configuration requirement of the stacking equipment, the member equipment is subjected to stacking configuration according to the preset configuration parameters of the stacking equipment.
Further, after the step of performing configuration checking on the member devices logged into the stack device one by one, the method further includes:
and traversing member equipment in the stacking equipment, and selecting the member equipment in the Master state as main equipment.
Further, before the step of checking occupancy of the stacked device that needs to be occupied by the test task, the method further includes:
the configuration parameter structure of a member device among the stack devices and the configuration parameter structure of a stand-alone device that is not used as a member device of the stack devices are set in advance to the same format.
Another object of the present invention is to provide a method for managing devices under automatic test, the method comprising:
carrying out occupation check on member equipment in the stacking equipment which needs to be occupied by the test task;
and when the member equipment is checked to be idle, setting an occupation success mark for the member equipment.
Further, after the step of setting an occupancy success flag for the member device, the method further comprises: and switching the stacking mode of the member equipment into a single machine mode.
Further, before the step of checking occupancy of the member devices in the stacked device that needs to be occupied by the test task, the method further includes:
the configuration parameter structure of a member device among the stack devices and the configuration parameter structure of a stand-alone device that is not used as a member device of the stack devices are set in advance to the same format.
Still another object of the present invention is to provide an apparatus for managing stacked devices in an automated test, the apparatus comprising:
the inspection module is used for inspecting occupation of the stacking equipment and/or member equipment in the stacking equipment which needs to be occupied by the test task;
the setting module is used for setting the same occupation success marks for the stacking equipment and the member equipment when the checking module checks that the stacking equipment and the member equipment in the stacking equipment are idle;
the setting module is further configured to set an occupation success flag for the member device when the checking module checks that the member device is idle.
Further, the apparatus further includes a configuration module, configured to set, in advance, the configuration parameter structure of the member device in the stacking device and the configuration parameter structure of the stand-alone device that is not used as the member device of the stacking device to the same format.
Further, the configuration module is further configured to log in the member devices of the stacking device one by one to perform configuration check:
when the checking module checks that member equipment is in a single machine mode, the member equipment is subjected to stacking configuration according to preset configuration parameters of the stacking equipment and is switched into a stacking mode;
when the checking module checks that member equipment is in a stacking mode and judges that the stacking configuration of the member equipment does not meet the preset configuration requirement of the stacking equipment, the checking module performs stacking configuration on the member equipment according to the preset configuration parameters of the stacking equipment;
the checking module is also used for checking whether the member equipment of the stacking equipment is in a single machine mode or a stacking mode;
the configuration module is further configured to traverse member devices in the stacking device, and select a member device in a Master state as a Master device.
The invention has the beneficial effects that: the invention realizes that the construction of the stacking equipment can be automatically carried out when a test task selects the stacking equipment for testing in the automatic testing process, and the construction of the stacking equipment is carried out only when the stacking configuration of the member equipment in the stacking equipment does not meet the preset configuration requirement of the stacking equipment, thereby reducing the testing time spent on the construction of the stacking equipment to the maximum extent.
In the invention, when the test task occupies the member equipment in the stacking equipment for testing, the member equipment can be automatically switched into the single-machine mode and then becomes the single-machine equipment for use, thereby realizing that the equipment can be automatically switched between the stacking mode and the single-machine mode, and the equipment is more flexible to use. Meanwhile, the configuration parameter structure of the member equipment in the stacking equipment and the configuration parameter structure of the stand-alone equipment which is not used as the member equipment of the stacking equipment are set to be in the same format in advance, so that the consistent management of the stacking equipment and the stand-alone equipment can be realized, the form of the equipment does not need to be considered when a test script of the automatic test is written, the test flow is simplified, and the test efficiency is improved.
Detailed Description
In order to make the technical solutions of the present invention more clearly understood, the present invention will now be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. 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.
Example 1
In order to effectively manage the stacking equipment in the automatic test process and achieve the purpose of consistent management of the stacking equipment and the single-machine equipment, the embodiment of the invention provides a method for managing the stacking equipment in the automatic test. As shown in fig. 1, the management method includes:
step 101, carrying out occupation check on stacking equipment required to be occupied by a test task;
and 102, when the stacking equipment and the member equipment in the stacking equipment are checked to be idle, setting the same occupation success marks for the stacking equipment and the member equipment.
In this step, if it is checked that the stacking device is not idle or that the member device in any stacking device is not idle, the stacking device is not occupied. Waiting for the next occupancy check.
In the embodiment of the present invention, after the same occupation success flag is set for both the stacking device and the member devices thereof shown in fig. 1, the management method further includes, as shown in fig. 2, step 203 of logging in the member devices of the stacking device one by one to perform configuration check, specifically including;
and when the member equipment is detected to be in the stand-alone mode, carrying out stacking configuration on the member equipment according to the preset configuration parameters of the stacking equipment, switching to the stacking mode, and waiting for the state stability of the member equipment.
And when the member equipment is detected to be in a stacking mode and the stacking configuration of the member equipment is judged to be not in accordance with the preset configuration requirement of the stacking equipment, the member equipment is subjected to stacking configuration according to the preset configuration parameters of the stacking equipment.
In this step, the preset configuration requirement of the stacking device refers to the preset configuration information of the member devices included in the stacking device, such as a domain number, a device number, a stacking link interface, an IP address, and the like. Whether the stacking configuration of the member device in the embodiment of the present invention meets the preset configuration requirement of the stacking device means whether configuration information (such as a domain number, a device number of a corresponding member device, a stacking link interface, an IP address, and the like) of the member device included in the stacking device is the same as the preset configuration requirement of the stacking device, for example, whether a device number of one member device is the same as a device number set for the member device in the preset configuration requirement of the stacking device.
In the embodiment of the present invention, after the member devices logging in the stacking device one by one to perform configuration check as shown in fig. 2, the management method further includes, as shown in step 304 in fig. 3, traversing the member devices in the stacking device, selecting the member device in the Master state as a Master device, and completing the operation of the testing task on the stacking device on the Master device. During the automated testing of the test task, the master device may change due to a restart and a link state switch. The master device needs to be re-checked before each test.
In the embodiment of the invention, when the member device is detected to be in the stacking mode and the stacking configuration of the member device is judged to meet the preset configuration requirement of the stacking device, the member device in the stacking device is directly traversed, the member device in the Master state is selected as the main device, and the operation of the test task on the stacking device is completed on the main device.
The embodiment of the invention realizes that the construction of the stacking equipment can be automatically carried out when a test task selects the stacking equipment for testing in the automatic testing process, and the construction of the stacking equipment is carried out only when the stacking configuration of the member equipment in the stacking equipment does not meet the preset configuration requirement of the stacking equipment, thereby reducing the testing time spent on the construction of the stacking equipment to the greatest extent.
In the embodiment of the present invention, before the automated testing platform performs occupancy check on the stacking device that needs to be occupied by the testing task, the method for managing the stacking system in the automated testing further includes: the configuration parameter structure of the member equipment in the stacking equipment and the configuration parameter structure of the stand-alone equipment which is not used as the member equipment of the stacking equipment are set to be in the same format in advance, so that the configuration parameter structures are in the same format no matter whether one stand-alone equipment is used as the member equipment of the stacking equipment or not, the consistent management of the stacking equipment and the stand-alone equipment can be realized, the form of the equipment does not need to be considered when writing a test script of the automatic test, the test flow is simplified, and the test efficiency is improved.
In the embodiment of the present invention, the configuration information of the stand-alone device includes login parameter information (login port information, IP address, etc.) and link interface information, etc., and the configuration information of the stacking device, as a logical device, includes the names, numbers, priorities, channel interfaces, etc. of all member devices. After the stack configuration is successful, the login parameters of the stack device are the login parameters of all the member devices included in the stack device, and the link interface of the stack device is formed by combining the device number of each member device and the physical link interface. As shown in fig. 4, 3 physical single devices are connected by high-speed cables and stacked to form a stacked device VST, and the VST is a logical device. The 3 member devices included in the VST have respective information such as login address and link interface. After the stack is successful, the VST has 3 login addresses, and the 3 login addresses are the login addresses of 3 pieces of member equipment. The link interface of the VST is obtained by converting the combination of the device number of the member device in the stack device and the physical link interface, and if the interface name of the link interface of the member device can be set to the form of interface type + interface number, the format of the converted link interface of the stack device is interface type + device number + interface number. In fig. 4, if the preset stack device VST includes the device number X, the login address a1, and the interface name fa0/1 of the member device 1 (fa is an interface type, 0/1 is an interface number), the device number Y, the login address a2, and the interface name gi0/2 of the member device 2 (gi is an interface type, 0/2 is an interface number), the device number Z, the login address A3, and the interface name te0/3 of the member device 3 (te is an interface type, 0/3 is an interface number), then the link interfaces of the VST include faX/0/1, giY/0/2, and teZ/0/3.
An embodiment of the present invention further provides a method for managing stacked devices in an automated test, as shown in fig. 5, the method includes:
step 501, carrying out occupation check on member equipment which needs to be occupied by the test task;
step 502, when checking that the member equipment is idle, setting an occupation success mark for the member equipment; after this step is completed. Other free member devices of the stacked device may also be occupied separately at this time, but the stacked device cannot be occupied at this time.
In this step, when it is checked that the member device is not idle, the occupation of the member device is unsuccessful. Waiting for the next occupancy check.
Before the occupancy check is performed on the member device which needs to be occupied by the test task, the management method further comprises the following steps: the configuration parameter structure of the member equipment in the stacking equipment and the configuration parameter structure of the stand-alone equipment which is not used as the member equipment of the stacking equipment are set to be in the same format in advance, so that the configuration parameter structures are in the same format no matter whether one stand-alone equipment is used as the member equipment of the stacking equipment or not, the consistent management of the stacking equipment and the stand-alone equipment can be realized, the form of the equipment does not need to be considered when writing a test script of the automatic test, the test flow is simplified, and the test efficiency is improved.
As shown in fig. 6, after step 502, step 603 of switching the stack mode of the member device to the stand-alone mode is further included. Because the formats of the configuration parameter structure of the member devices in the stacking device and the configuration parameter structure of the stand-alone device are the same, the member devices of the stacking device in the stand-alone mode are not different from the stand-alone device, and the testing task can take the member devices of the stacking device as the stand-alone device to perform testing operation.
In the embodiment of the invention, the modes of the related equipment comprise a stacking mode and a stand-alone mode, and the equipment is equivalent to stand-alone equipment when in the stand-alone mode. The stand-alone equipment in the stand-alone mode is correctly connected and is switched to the stacking mode after being stacked and configured, when the member equipment occupying the stacking equipment is appointed by a test task to be tested, the member equipment can be automatically switched to the stand-alone mode and then becomes the stand-alone equipment to be used, the equipment can be automatically switched between the stacking mode and the stand-alone mode, and the equipment is more flexible to use.
In embodiments of the present invention, when a stack device is occupied, its member devices are automatically occupied. If a member device of a certain stack device is occupied, the stack device cannot be occupied, but other member devices of the stack device can be separately occupied to become stand-alone devices if the other member devices are also idle.
Example 2
An embodiment of the present invention provides a management apparatus for stacking devices in an automated test, as shown in fig. 7,
the device 70 comprises:
the checking module 701 is configured to perform occupancy checking on the stacked device and/or member devices in the stacked device that needs to be occupied by the test task;
a setting module 702, configured to set the same occupation success flag for the stacking device and the member device when the checking module 701 checks that the stacking device and the member device in the stacking device are both idle;
the setting module 702 is further configured to set an occupation success flag for the member device when the checking module 701 checks that the member device is idle.
In the embodiment of the present invention, on the basis of fig. 7, the apparatus 70 further includes a configuration module 803 shown in fig. 8, configured to set the configuration parameter structure of the member device in the stacking device and the configuration parameter structure of the stand-alone device that is not used as the member device of the stacking device to the same format in advance.
The configuration module 803 is further configured to log in the member devices of the stack device one by one to perform configuration check:
when the checking module 701 checks that member equipment is in a stand-alone mode, the member equipment is subjected to stacking configuration according to preset configuration parameters of the stacking equipment and is switched to the stacking mode;
when the checking module 701 checks that a member device is in a stacking mode and judges that the stacking configuration of the member device does not meet the preset configuration requirement of the stacking device, the member device is subjected to stacking configuration according to the preset configuration parameters of the stacking device;
the checking module 701 is further configured to check that the member device of the stacking device is in a standalone mode or a stacking mode;
the configuration module 803 is further configured to traverse member devices in the stacking device, and select a member device in a Master state as a Master device.
Example 3
The embodiment of the present invention describes, by way of example, a specific implementation process of a test task occupying a stacking device and testing a member device in the stacking device with reference to fig. 4, where a configuration requirement preset by a VST of the stacking device in fig. 4 is that 3 member devices are included. The 3 member devices are respectively a member device 1, a member device 2 and a member device 3, the device number of the member device 1 is X, the login address is A1, and the interface name is fa0/1, the device number of the member device 2 is Y, the login address is A2, and the interface name is gi0/2, the device number of the member device 3 is Z, the login address is A3, and the interface name is te0/3, after the stacking configuration is carried out, the link interfaces of the stacking device VST comprise faX/0/1, giY/0/2 and teZ/0/3, and the login address of the VST comprises A1, A2 and A3.
Logging in 3 pieces of member equipment one by one for configuration check, specifically comprising the steps of;
when it is detected that there is a member device (e.g., member device 1) in the standalone mode, the member device 1 is configured in a stacking manner according to the preset configuration parameters of the stacking device and switched to the stacking mode, and the state of the member device 1 is waited for to be stable.
When it is detected that a member device (e.g., the member device 2) is in the stacking mode and it is determined that the stacking configuration of the member device 2 does not meet the preset configuration requirement of the stacking device, the member device 2 is configured by stacking according to the preset configuration parameters of the stacking device.
After logging in 3 member devices one by one for configuration check, traversing the 3 member devices included in the VST, selecting the member device in the Master state as a main device, and completing the VST operation of the stack device by the test task on the main device.
When it is detected that member devices (such as the member device 2) are in a stacking mode and it is determined that the stacking configuration of the member device 2 meets the configuration requirement of the stacking device set in advance, 3 member devices included in the VST are directly traversed, the member device in the Master state is selected as a Master device, and the VST operation by the test task is completed on the Master device.
When a test task needs to occupy a stack device VST for testing, an automatic test platform firstly checks whether the stack device VST is idle, when the stack device VST is checked to be idle, then checks whether 3 member devices included in the stack device VST are idle, when the stack device VST and the 3 member devices included in the stack device VST are idle, the automatic test platform sets the same occupation success marks for the stack device VST and the 3 member devices included in the stack device VST, when the stack device VST is not idle or any member device included in the stack device VST is not idle, the stack device VST is occupied unsuccessfully, and the next occupation check is waited.
When a test task needs to occupy any member device of 3 member devices, if the member device 1 needs to be occupied, the automatic test platform checks the occupancy of the member device 1, and when the member device 1 is checked to be idle, an occupancy success mark is set for the member device 1, at this time, if the member device 2 and the member device 3 are also idle, the member device 2 and the member device 3 can be occupied separately, but the stack device VST cannot be occupied at this time. And when the member equipment 1 is not idle, the member equipment 1 is not occupied successfully. Waiting for the next occupancy check. The stacking mode of the member device 1 is switched to the standalone mode. At this time, the member device 1 becomes a stand-alone device to complete the testing task.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.