Summary of the invention
In view of above problem, the invention provides a kind of by control centre's server according to predefined conversion and operation strategy, realize the method that automatic test and manual test environment unattended operation switch mutually and support the hardware system that the method realizes.
Technical scheme of the present invention is: a kind of manual test and automatic test environment changing method, it is characterized in that, and comprise the following steps:
A, manual test environment changing are that the step of automatic test environment comprises:
A1, control centre's server obtain the attribute that takies of equipment under test;
A2, preserve each equipment under test manual test environment configurations and version information close Down and fall equipment under test ether port one by one;
The port that a3, the topological switch of recovery are connected with equipment under test is the normal Up of connection state;
And/or,
B, automatic test environment changing are that the step of manual test environment comprises:
Whether the server judgement of b1, control centre shares in environment has and is executing the task, and sends mail notification executed script and not test script information the task of stopping moving;
B2, close all ether ports that are connected with equipment under test in topological switch;
B3, the version information that recovers successively each equipment under test and configuration information.
Preferably, described step a2 comprises the following steps:
A21, the equipment under test that obtains in a1 take attribute-bit, obtain successively the equipment under test control that allows to participate in switched system;
A22, obtain the version information of equipment under test in a21;
A23, preserve that equipment under test is current to be configured in startup file and to back up startup file;
The configuration information of a24, removing equipment under test is also closed all ether ports of this equipment;
A25, judge whether the equipment under test that allows to switch to automated environment in the equipment under test of a1 all was acquired control, if jump to a3, otherwise carry out a21.
Further, described step a22 comprises the following steps:
A221, the predefined device version demand of control centre's server contrast, judge whether the current version information of described equipment under test is consistent with predefined information, if version information is inconsistent, enters step a222, and version information unanimously enters step a23;
A222, judge whether current equipment also has enough spaces to write new version file, is to enter step a223, otherwise locks this equipment, and jump to step a21;
A223, control centre's server are realized the device version replacing according to device upgrade configuration file and the version server interlock of storage, simultaneously original version file are backuped in version server, and described version server is positioned at control centre's server.
Preferably, described step b3 comprises the following steps:
B31, control centre's server obtain a certain control that is used in the automatic test environment and did not obtain the equipment under test of control through this step according to the test envelope configuration file;
B32, obtain the original version information that backs up when the manual test environment changing is the automatic test environment;
The device start file that b33, reduction manual test environment changing back up while being the automatic test environment;
B34, restart equipment under test, by flash, write the manual test version information, and reduce the manual test configuration order by startup file, recover to be switched to the state of the manual test environment before this automatic test environment;
B35, judge whether that all equipment under tests obtained control through step b31, if ending step, otherwise jump to step b31.
If device space deficiency occurs when a front manual test environment changing is the automatic test environment, cause version file correctly not write and then while causing equipment locked, above-mentioned step b32 is further comprising the steps of:
B321, discharge the attribute that takies of locked equipment under test.
When the equipment of step b34, restart abnormal and cause not having normal restorer manual test version and when configuration, step b34 is further comprising the steps of:
B341, the corresponding equipment under test user of transmission mail reminder.
Further, above-mentioned manual test and automatic test environment changing method can also can trigger by manual mode by the automatic triggering of timed task.
Further, described timing routine circulation is carried out and is comprised two timing points, and the first timing point is the automatic test environmental process for triggering the manual test environment changing, and the second timing point is the manual test environmental process for triggering the automatic test environment changing.
A kind of above-mentioned manual test and automatic test environment changing system of realizing, it is characterized in that, comprise control centre's server, control network switch and topological switch, described topological switch and equipment under test are direct-connected, described control network switch is connected with the equipment under test serial ports, and described equipment of serial is for reception control signal; Described control centre server is connected with the control network switch with topological switch simultaneously, be used to carrying out above-mentioned manual test and automatic test environment changing method.
Beneficial effect of the present invention: under timed task triggers, control centre's server obtains device attribute configuration file and upgrade requirement configuration file, and by the storage to the equipment configuration, the control of topology switch connection port and the contrast of upgrade requirement configuration file, reach switching and the operation of intelligence, loop-free manual test environment and automatic test environment.In sum, when two kinds of test environments reach intelligent switchover operation, control centre's server can be built into automatic test environment operation task automatically by the manual test environment, work hours can automatically switch to it manual test environment again by day, guarantee normal manual test work, so just rationally utilize efficiently all device resources, thereby reached significantly shortening and real efficient utilization of equipment of test period.
Embodiment
For making purpose of the present invention, technical scheme and advantage clearer, existing system constructing figure and conversion method flow chart in conjunction with the embodiment of the present invention is further elaborated.
The manual test environment changing that is depicted as one embodiment of the invention as a in Fig. 3 is the realization flow of the method for automatic test environment, and is existing that concrete steps and principle/process prescription are as follows:
A, manual test environment changing are that the step of automatic test environment comprises:
A1, control centre's server obtain the attribute that takies of equipment under test: detailed process is after task switching starts, control centre's server reads the profile information that is attached thereto the equipment under test that connects, and according to profile information, judges the situation that takies of equipment under test.
A2, preserve each equipment under test manual test environment configurations and version information Down one by one and fall equipment under test ether port.
The port that a3, the topological switch of recovery are connected with equipment under test is the Up state, and shared environment changing is the automatic test environment.In this step, the reason of recovering topological switch ports themselves and be the Up state is to build while sharing environment, the port default that is connected with equipment under test on the topology switch is Down, can say that initial condition is Down, because, after putting up shared environment, between equipment under test, have direct-connected, also have and connect by topological switch, if testing equipment is switch, be easy to cause loop, so under default situations, the port on topological switch is that Down falls.
Wherein, the effect of step a2 is that control centre's server operates each equipment under test respectively, and to preserve the configuring condition of the current manual test environment of equipment under test, then Down falls equipment under test ether port, and it specifically comprises the following steps:
The equipment under test that a21, control centre's server obtain in a1 takies attribute-bit, obtains successively the equipment under test control that allows to participate in switched system;
A22, obtain the version information of equipment under test in a21;
A23, preserve that equipment under test is current to be configured in startup file and to back up startup file; The purpose of this step is the recovery of being convenient to the next time of configuration information while being the manual test environment from the automatic test environment changing.Because when carrying out automatic test, in some scripts, can relate to the test command that configuration is relevant, control centre's server need to be preserved and configures and restart, so in this step, need the configuration backup of manual test, in startup file, to avoid automatic test is impacted.
Configuration information the Down of a24, removing equipment under test fall all ether ports of this equipment; The preparation that is the automatic test environment from the manual test environment changing through this equipment under test after this step namely completes.
A25, judge whether the equipment under test that allows to switch to automated environment in the equipment under test of a1 all was acquired control, if jump to a3, otherwise carry out a21.
Due in practical work process, also can run into the inconsistent situation of predefined equipment under test information in the current version information of equipment under test and control centre's server, in order to solve problems, above-mentioned steps a22 is further comprising the steps of:
A221, the predefined device version demand of control centre's server contrast, judge whether the current version information of described equipment is consistent with predefined information, if version information is inconsistent, enter step a05, version information unanimously enters step a07, wherein comparison process is completed by programming by control centre's server, because concrete comparison process belongs to prior art, at this, is not described further.
A222, judge whether current equipment under test also has enough spaces to write new version file, to enter step a06, otherwise lock this equipment under test, continue simultaneously to obtain the control of never obtaining and allow to switch to a certain equipment under test of automated environment in the equipment under test of a01.
A223, control centre's server are realized the replacing of equipment under test version according to pre-stored device upgrade configuration file and version server interlock, simultaneously original version file are backuped in the MC server, and described version server is positioned at control centre's server.A file that is specifically designed to storage version information for example is set as version server.
By executing above step, the equipment under test environment is the automatic test environment by the manual test environment changing, this moment, the control centre server only need be according to predefined execution script in task switching, and dispatching process and the operation of selection equipment under test, and equipment under test is carried out to automatic test.
Said process is that in the manual test of the present embodiment and automatic test environment changing method, the manual test environment changing is the detailed process of automatic test environment, below in conjunction with the flow process shown in b in Fig. 3, set forth the process of automatic test environment to the manual test environment changing, specifically comprise the following steps:
B, automatic test environment changing are that the step of manual test environment comprises:
B1, whether control centre's server judges in the automatic test environment have and executing the task, to send mail notification executed script and not test script information the task of stopping moving, wherein in mail reception person and concrete execution script in corresponding " Job " file arrange relevant, namely in " Job " file, added which recipient, which mail just sends.The purpose that sends mail is exactly to mail reception person, to inform the implementation status of script.Also having a purpose herein simultaneously is to inform which script mail reception person has carried out, this process is in the situation that need to be that the manual test environment is triggered and started by the triggering task by the automatic test environment changing, concrete mode is a lot, can adopt manual triggering, also can adopt the timed task under the automation mode to trigger, such as by timing routine, producing timed task, when being on duty the time, this timed task produces triggering signal, and by the automatic test environment changing, be the manual test environment automatically;
B2, close all ether ports that are connected with equipment under test in topological switch, when being to avoid recovering manual environment, the purpose of carrying out this process forms loop between equipment, the ether port that in this process, Down falls topological switch, owing to being prior art, is not described further at this yet.
B3, the version information that recovers successively each equipment under test and configuration information.
In step b3, the recovery of equipment under test version information and configuration information has several different methods, exemplifies in the present embodiment following a kind of concrete scheme, comprises the following steps:
B31, control centre's server obtain a certain control that is used in the automatic test environment and did not obtain the equipment under test of control through this step according to the test envelope configuration file;
B32, obtain the original version information that backs up when the manual test environment changing is the automatic test environment;
The device start file that b33, reduction manual test environment changing back up while being the automatic test environment;
B34, restart equipment under test, by flash, write the manual test version information, and reduce the manual test configuration order by startup file, recover to be switched to the state of the manual test environment before this automatic test environment;
B35, judge whether that all equipment under tests obtained control through step b31, if ending step, otherwise jump to step b31.
Will be understood by those skilled in the art that; the concrete scheme of above step b3 is the specific embodiment of enumerating for step b3 more easily is understood; should not be construed as the restriction to the present invention program's protection range, the solution of the present invention comprises but is not limited only to this kind concrete form.
In addition, if the equipment under test insufficient space occurs when a front manual test environment changing is the automatic test environment, cause version file correctly not write and then while causing equipment under test locked, above-mentioned step b32 is further comprising the steps of:
B321, control centre's server discharge the attribute that takies of blocked equipment under test.In this step, judge whether blocked method is by checking whether the version file backup realizes in the flash of equipment under test to equipment under test.Equipment under test for not original manual test version locks when manual test switches to automated environment, when reducing environment, need to discharge the attribute that takies of this equipment under test, the normal inspection while guaranteeing the lower whorl switching.
When the equipment under test of step b34, restart abnormal and cause abnormally while recovering equipment under test manual test version and configuration, step b34 is further comprising the steps of:
B341, the corresponding equipment under test user of transmission mail reminder.
In order to address the above problem, the invention allows for a kind of manual test and automatic test environment changing system, the design of graphics of this system as shown in Figure 4, comprise control centre's server, control network switch and topological switch, the ether port of described topological switch is direct-connected with equipment under test respectively, described control network switch is connected with the equipment under test serial ports, and described equipment under test serial ports is for reception control signal; Described control centre server is connected with the control network switch with topological switch simultaneously, be used to carrying out above-mentioned manual test and automatic test environment changing method.Usually, an equipment under test only has a serial ports (namely connecting by controlling network switch), can only there is a people to login equipment under test by serial ports, but telnet can many people login, because in present environment, exist many people to use the problem of an equipment under test, so these the 2 kinds modes that connect equipment under test are arranged.Direct connected link is illustrated in the tester while testing, what relate to many equipment under tests structure test environments is (in difference and automated environment, by topological switch, to build network by the direct form that is connected of the Ethernet interface of equipment under test, the Ethernet interface of equipment under test all is connected on topological switch, by the topological switch of centre, realizes transparent transmission.)
The mode that above-mentioned employing is regularly switched only is adapted to most situation usually, in engineering practice sometimes in order to improve equipment under test utilance or interim demand, have the needs that carry out the switching of equipment under test test environment at the non-timed point, in order to solve problems, the present embodiment being provided with thought trigger interface, by to this interface operation, realizing at any time starting the transfer process of test environment.
For the method by above-described embodiment, realize the switching of manual test environment and automatic test environment, the switched system of the present embodiment is newly-increased topological switch and automation control centre server on the basis of manual test environment.The port that in the manual test environment, equipment under test is not used in manual test all is linked on topological switch, and above equipment under test be connected the configuration file that writes the automatic test bed.The topology switch connects serial ports by controlling network switch, and for avoiding loop, Down falls the port that is connected with equipment under test.Automation control centre server needs to control switching and the operation of whole test according to test.
In sum, control centre's server (comprises switching time at predefined timed task, the management and running script) under triggering, obtain predefined device attribute configuration file and upgrade requirement configuration file, realize that intelligence completes the switching of manual test environment to automated environment, the reduction of script task scheduling and manual test environment.The operation of this sharing system, improved the utilance of equipment under test, enlarged the environmental field that automatic test is carried out, and further shortened test period.
The foregoing is only the specific embodiment of the present invention, one skilled in the art will appreciate that and can carry out various modifications, replacement and change to the present invention in the disclosed technical scope of the present invention.Therefore the present invention should not limited by above-mentioned example, and should limit with the protection range of claims.