WO2017107582A1 - Method and device for automated testing - Google Patents

Method and device for automated testing Download PDF

Info

Publication number
WO2017107582A1
WO2017107582A1 PCT/CN2016/098831 CN2016098831W WO2017107582A1 WO 2017107582 A1 WO2017107582 A1 WO 2017107582A1 CN 2016098831 W CN2016098831 W CN 2016098831W WO 2017107582 A1 WO2017107582 A1 WO 2017107582A1
Authority
WO
WIPO (PCT)
Prior art keywords
clock
test
synce
link
device under
Prior art date
Application number
PCT/CN2016/098831
Other languages
French (fr)
Chinese (zh)
Inventor
何为
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017107582A1 publication Critical patent/WO2017107582A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements

Definitions

  • Embodiments of the present invention relate to the field of automated testing technologies, and in particular, to an automated testing method and apparatus.
  • the network Ethernet SyncE 1588 clock of the device under test is mainly tested by manual testing. Since the test of the SyncE 1588 clock of the tested device needs to test various functions of the SyncE 1588 clock, when the SyncE 1588 clock of the tested device is manually tested, each test state and test result need to be manually detected, so that the tested device is The SyncE 1588 clock test has a large workload, which in turn leads to low test efficiency of the SyncE 1588 clock of the device under test.
  • the embodiment of the invention provides an automatic testing method and device, which aims to solve the technical problem of low testing efficiency of manual testing of the SyncE 1588 clock of the tested device.
  • an automated testing method provided by an embodiment of the present invention includes the following steps:
  • test case and the test script of the synchronous Ethernet SyncE 1588 clock corresponding to the test command are obtained, where the test case includes the current clock source of the device under test is the SyncE 1588 clock, and The SyncE 1588 clock is locked;
  • a test report is generated when the test script runs.
  • the step of running the test script based on the obtained test case includes:
  • the step of generating a test report includes: generating a test report of successful test when the detected clock state of the SyncE 1588 clock is in a warm-up state, a free running state, a fast-capture state, and a locked state.
  • the step of running the test script based on the obtained test case includes:
  • the step of generating a test report includes: generating a test report of successful test when it is detected that the SyncE 1588 clock of the device under test is in a locked state.
  • the obtained test case is based on the obtained test case.
  • the steps to run the test script include:
  • the standby link After detecting that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in the locked state, the standby link is closed, and the primary link is turned on;
  • the step of generating a test report includes: generating a test report of successful test when the SyncE 1588 clock of the current clock source of the device under test is detected as the active link and the SyncE 1588 clock is in the locked state.
  • test instruction is a clock switching test instruction of the clock of the device under test SyncE 1588
  • the current clock source of the device under test is the SyncE 1588 clock of the primary link
  • the operation is performed based on the obtained test case.
  • the steps of the test script include:
  • the current clock source of the device under test is a GNSS clock
  • the GNSS clock is in a locked state
  • setting the GNSS clock state to a pseudo normal state and enabling the backup link of the switch and the SyncE 1588 clock
  • the GNSS clock state is restored from the pseudo normal state to the normal state, and the primary link is closed.
  • the standby link After detecting that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in the locked state, the standby link is closed;
  • the link between the switch and the GNSS clock is closed and the active link is started;
  • the step of generating a test report includes: generating a test report of successful test when the SyncE 1588 clock of the current clock source of the device under test is detected as the primary link and the SyncE 1588 clock is locked.
  • an embodiment of the present invention further provides an automatic testing device, where the automated testing device includes:
  • the obtaining module is configured to obtain a test case and a test script of the synchronous Ethernet SyncE 1588 clock corresponding to the test command when receiving the test command sent by the user, where the test case includes the current clock source of the device under test is SyncE 1588 clock, and the SyncE 1588 clock is locked;
  • Running a module configured to run the test script based on the obtained test case
  • a generation module is configured to generate a test report when the test script runs.
  • the running module includes:
  • control unit configured to control the device to be tested to restart
  • the detecting unit is configured to detect the running state of the SyncE 1588 clock in real time during the restart of the device under test;
  • the generating module is further configured to generate a test successful test when the detected clock state of the SyncE 1588 clock is in a warm-up state, a free running state, a fast-capture state, and a locked state. report.
  • the running module includes:
  • a clock pull unit configured to perform a clock pull operation on the device under test
  • a link down unit configured to: close the switch and the SyncE 1588 clock link when detecting that the SyncE 1588 clock of the device under test is in a fast capture state
  • a link open unit configured to enable a link between the switch and the SyncE 1588 clock when detecting that the SyncE 1588 clock of the device under test is in a free running state
  • the generating module is further configured to generate a test report that the test is successful when detecting that the SyncE 1588 clock of the device under test is in a locked state.
  • the running module includes:
  • the primary link closing unit is configured to close the primary link and enable a backup link between the switch and the SyncE 1588 clock;
  • the first standby link shutting down unit is configured to: when detecting that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in the locked state, shutting down the standby link, and turning on the main Use link
  • the generating module is further configured to generate a test report of successful testing when the SyncE 1588 clock of the current clock source of the device under test is detected as the primary link and the SyncE 1588 clock is in the locked state.
  • the running module includes:
  • a GNSS clock link open unit configured to enable a link between the switch and the GNSS clock of the global navigation satellite system
  • a unit configured to set the GNSS clock state to a pseudo normal state when detecting that the current clock source of the device under test is a GNSS clock and the GNSS clock is in a locked state, and Opening a backup link between the switch and the SyncE 1588 clock;
  • the recovery unit is configured to restore the GNSS clock state from the pseudo normal state to the normal state when the SyncE 1588 clock of the current clock source of the device under test is detected as the active link, and the SyncE 1588 clock is in the locked state, and close the Said primary link;
  • a second standby link shutdown unit configured to: when detecting that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in a locked state, shutting down the standby link;
  • the GNSS clock link closing unit is configured to: when detecting that the current clock source of the device under test is a GNSS clock, and the GNSS clock is in a locked state, close the link between the switch and the GNSS clock and enable the active link;
  • the generating module is further configured to generate a test report that the test is successful when the SyncE 1588 clock of the current clock source of the device under test is detected as the active link and the SyncE 1588 clock is in the locked state.
  • a computer storage medium is further provided, and the computer storage medium may store an execution instruction for executing the automated test method in the above embodiment.
  • the embodiment of the present invention obtains a test case and a test script of the SyncE 1588 clock corresponding to the test instruction when receiving the test instruction sent by the user, and then runs the test script based on the obtained test case, and then performs the test.
  • the script runs, the test report is generated, and the automatic test of the SyncE 1588 clock of the tested device is realized.
  • the test script corresponding to different test instructions is used to realize the automatic test of various functions of the test device SyncE 1588 clock, and the test is reduced.
  • the process of manually detecting the test status and test results in the process greatly reduces the workload of the SyncE 1588 clock test of the device under test, avoids the problem of inaccurate test caused by inaccurate manual detection, and improves the test equipment.
  • the efficiency and accuracy of the SyncE 1588 clock test improves the quality of the device under test.
  • FIG. 1 is a schematic flow chart of a first embodiment of an automated test method according to the present invention.
  • FIG. 2 is a schematic flowchart of a step of running the test script in the second embodiment of the automated test method of the present invention
  • FIG. 3 is a schematic flowchart of a step of running the test script in the third embodiment of the automated test method of the present invention.
  • FIG. 4 is a schematic flowchart of a step of running the test script in the fourth embodiment of the automated test method of the present invention.
  • FIG. 5 is a schematic flowchart of a step of running the test script in the fifth embodiment of the automated test method according to the present invention.
  • FIG. 6 is a schematic diagram of functional modules of a first embodiment of an automated test apparatus according to the present invention.
  • FIG. 7 is a schematic diagram of a refinement function module of a running module in a second embodiment of the automatic testing device of the present invention.
  • FIG. 8 is a schematic diagram of a refinement function module of a running module in a third embodiment of the automatic testing device of the present invention.
  • FIG. 9 is a schematic diagram of a refinement function module of a running module in a fourth embodiment of the automatic testing device of the present invention.
  • FIG. 10 is a schematic diagram of a refinement function module of a running module in a fifth embodiment of the automatic testing device of the present invention.
  • the present invention provides an automated test method.
  • 1 is a schematic flow chart of a first embodiment of an automated test method according to the present invention.
  • the automated test method includes:
  • Step S100 Acquire a test case and a test script of a synchronous Ethernet SyncE 1588 clock corresponding to the test command when receiving a test command sent by the user, where the test
  • the trial example includes the current clock source of the device under test being the SyncE 1588 clock, and the SyncE 1588 clock is locked;
  • the test command includes a test command for performing a clock state positive transition test on the SyncE 1588 clock of the device under test, a test command for performing a clock state reverse transition test on the SyncE 1588 clock of the device under test, and SyncE 1588 for the device under test.
  • the clock performs a test instruction of the clock source smoothing switching test and a test instruction for performing a link smoothing switching test on the SyncE 1588 clock of the device under test.
  • the clock source is switched to the clock of the device under test in the SyncE 1588 clock and the GNSS (Global Navigation Satellite System (full name is Global Navigation Satellite System) switching between clocks, the link is switched to the switch between the primary link and the standby link of the SyncE 1588 clock, each test command corresponds to different test cases and Test the script.
  • the automated test method can be executed on a terminal such as a three-network card computer, the first network card is used to upload test data, the second network card is used to control the device under test and the clock source device, and the third network card is used. On the control switch, the terminal first acquires the clock source device, the device under test, and the switch data.
  • the data includes: the device Ip address and port; and the connection relationship between the three devices.
  • the primary and backup clock source devices are respectively connected to the switch 2 And 3 ports, the device under test is connected to the switch 4 port.
  • the terminal starts the active link according to the obtained switch address and the connection data of the clock source and the switch, and closes the standby link, that is, opens the switch port 2, closes the switch port 3, and receives the test command sent by the user, the terminal real-time Detects the current clock source of the device under test.
  • Step S200 running the test script based on the obtained test case
  • the test script obtained according to the obtained test case of the SyncE 1588 clock is specifically determined to be consistent with the test case in the test environment of the test device, that is, The test machine's current clock source is the SyncE 1588 clock, and the test script is run when the SyncE 1588 clock is locked.
  • the test environment of the test device does not match the test case, that is, the current clock source of the device under test is not the SyncE 1588 clock, or the current clock source of the device under test is the SyncE 1588 clock, but the SyncE 1588 clock is not locked. Terminating the test stops running the test script and generates a test report that the test failed.
  • Step S300 generating a test report when the test script is completed.
  • test report with a successful test is generated, and when the test script running result does not match the test target, a test report of the test failure is generated.
  • the test script corresponding to different test instructions is used to realize the automatic test of various functions of the test device SyncE 1588 clock, and the test process is reduced.
  • the process of manually testing the test status and test results greatly reduces the workload of the SyncE 1588 clock test of the device under test, avoids the problem of inaccurate test caused by inaccurate manual detection, and improves the SyncE of the tested device.
  • the efficiency and accuracy of the 1588 clock test improves the quality of the equipment being tested.
  • step S200 includes :
  • Step S211 controlling the device under test to restart
  • the test environment of the test device is consistent with the test case, that is, when the current clock source of the device under test is the SyncE 1588 clock, and the SyncE 1588 clock is locked, the device under test is restarted, which is easy to understand and test.
  • the script includes controlling the device to be restarted.
  • Step S212 detecting the running state of the SyncE 1588 clock in real time during the restart of the device under test
  • the test script further includes detecting the running status of the SyncE 1588 clock in real time during the restart of the tested device.
  • Step S300 includes: performing a warm-up state on the detected clock state of the SyncE 1588 clock, After the free running state, fast catching state, and locked state, a test report of successful test is generated.
  • the detected running state is consistent with the preset running state, that is, the clock state of the SyncE 1588 clock passes through the warm-up state, the free running state, the fast-capture state, and finally enters the locked state, and generates a test report of successful test; in SyncE 1588 After the clock state of the clock is not in the warm-up state, the free-running state, the fast-capture state, and finally enters the locked state, the test script is stopped when the test is terminated, and a test report of the test failure is generated.
  • the running state of the SyncE 1588 clock is detected in real time, and then the detected clock state of the SyncE 1588 clock is preheated.
  • a test report of successful test is generated, and the automatic test of the clock state positive transition of the SyncE 1588 clock of the tested device is realized, and the SyncE 1588 clock of the tested device is reduced.
  • the workload of the transition test improves the efficiency and accuracy of the clock state forward transition test of the SyncE 1588 clock of the device under test.
  • step S200 includes :
  • Step S221 performing a clock pull operation on the device under test
  • the test environment of the test device is consistent with the test case, that is, when the current clock source of the device under test is the SyncE 1588 clock, and the SyncE 1588 clock is in the locked state, the device is subjected to a clock pull operation.
  • the test script includes performing a clock pull operation on the device under test.
  • Step S222 when detecting that the SyncE 1588 clock of the device under test is in a fast-capture state, shutting down the link between the switch and the SyncE 1588 clock;
  • the link between the switch and the SyncE 1588 clock is turned off, that is, the SyncE 1588 clock is disconnected.
  • a link wherein the test script further includes a link that closes the switch to the SyncE 1588 clock; further, if the device under test is detected
  • the SyncE 1588 clock is in a non-fast-capture state. For example, if the SyncE 1588 clock is unable to enter the fast-capture state, the test will be stopped and the test report of the test failure will be generated.
  • Step S223 when detecting that the SyncE 1588 clock of the device under test is in a free running state, turning on a link between the switch and the SyncE 1588 clock;
  • the link between the switch and the SyncE 1588 clock is closed, if the SyncE 1588 clock of the device under test is detected to be in a free running state, the link between the switch and the SyncE 1588 clock is turned on again, wherein the test script further includes opening the switch. a link to the SyncE 1588 clock; further, if it is detected that the SyncE 1588 clock of the device under test is in a non-free running state, for example, the SyncE 1588 clock cannot always enter the free running state, then the test is terminated and the test script is stopped, and Generate a test report that the test failed.
  • Step S300 includes: generating a test report that the test is successful when detecting that the SyncE 1588 clock of the device under test is in a locked state.
  • the SyncE 1588 clock of the device under test After the link between the switch and the SyncE 1588 clock is enabled, when the SyncE 1588 clock of the device under test is detected to be in a locked state, a test report of successful test is generated. Further, if the SyncE 1588 clock of the device under test is detected to be non- Locked state, such as the SyncE 1588 clock, can never enter the locked state, then the test is terminated and the test script is stopped, and a test report of the test failure is generated.
  • the link between the switch and the SyncE 1588 clock is closed, and then the When the SyncE 1588 clock of the test device is in a free running state, the link between the switch and the SyncE 1588 clock is turned on, and finally, when the SyncE 1588 clock of the device under test is detected to be in a locked state, a test report of successful test is generated, and the test report is realized.
  • Automated testing of the clock state reverse transition of the SyncE 1588 clock of the test equipment reduces the workload of the SyncE 1588 clock forward and reverse test of the device under test, and improves the clock state reverse transition test of the SyncE 1588 clock of the tested device. Efficiency and accuracy.
  • step S200 includes:
  • Step S231 the primary link is closed, and a standby link between the switch and the SyncE 1588 clock is enabled.
  • the test environment of the test device is consistent with the test case, that is, when the current clock source of the device under test is the SyncE 1588 clock of the active link, and the SyncE 1588 clock is locked, the main chain is closed. And opening a standby link between the switch and the SyncE 1588 clock, wherein the test script includes turning off the primary link and turning on the standby link of the switch with the SyncE 1588 clock.
  • Step S232 when it is detected that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in the locked state, the standby link is closed, and the primary link is started;
  • the standby link is closed, and the host is turned on.
  • the clock source of the device under test is smoothly switched from the clock source of the primary link to the clock source of the standby link, wherein the test script further includes closing the standby link and enabling the primary chain. road.
  • the test script further includes closing the standby link and enabling the primary chain. road.
  • Step S300 includes: when detecting the SyncE 1588 clock of the current clock source of the device under test as the primary link, and the SyncE 1588 clock is in the locked state, generating a test report of successful testing.
  • the active link of the clock source After the active link of the clock source is enabled, if the current clock source of the device under test is detected as the SyncE 1588 clock of the primary link and the SyncE 1588 clock is locked, a test report indicating successful test is generated and tested.
  • the clock source of the device is smoothly switched from the clock source of the standby link to the clock source of the primary link.
  • the current clock source of the device under test is not the main chain The SyncE 1588 clock of the path, or the SyncE 1588 clock of the current clock source of the device under test for the primary link, but the SyncE 1588 clock is not locked, then the test is terminated when the test is terminated, and a test report of the test failure is generated. .
  • the primary link is closed, and the standby link of the switch and the SyncE 1588 clock is enabled; then, the SyncE 1588 clock of the standby link of the device under test is detected, and the SyncE 1588 clock is detected.
  • the standby link is closed and the primary link is turned on; then, the SyncE 1588 clock of the current clock source of the device under test is detected as the primary link, and the SyncE 1588 clock is locked.
  • a test report of successful test is generated; an automated test for smooth switching of the SyncE 1588 clock link of the tested device is implemented, and the workload of the SyncE 1588 clock link switching test of the tested device is reduced, thereby avoiding manual detection.
  • the inaccurate test result caused by inaccuracy improves the efficiency and accuracy of the SyncE 1588 clock link smooth switching test of the device under test.
  • step S200 includes:
  • Step S241 starting a link between the switch and the GNSS clock of the global navigation satellite system
  • the test environment of the test device is consistent with the test case, that is, when the current clock source of the device under test is the SyncE 1588 clock of the active link, and the SyncE 1588 clock is locked, the switch and the GNSS clock are enabled.
  • the link, wherein the test script also includes a link to open the switch to the GNSS clock of the Global Navigation Satellite System.
  • Step S242 when it is detected that the current clock source of the device under test is a GNSS clock, and the GNSS clock is in a locked state, the GNSS clock state is set to a pseudo normal state, and the standby link of the switch and the SyncE 1588 clock is enabled.
  • the GNSS clock state is set to a pseudo normal state, and the switch and the SyncE 1588 are enabled.
  • Alternate link of the clock, its The pseudo normal state means that the GNSS clock is in a normal state, but the GNSS clock state detected by the processor is abnormal by constructing a GNSS clock receiver fault or the like, and the clock source of the device under test is used by the active link.
  • the SyncE 1588 clock smoothly switches to the GNSS clock, where the test script also includes setting the GNSS clock state to a pseudo-normal state and turning on the alternate link between the switch and the SyncE 1588 clock.
  • the test script also includes setting the GNSS clock state to a pseudo-normal state and turning on the alternate link between the switch and the SyncE 1588 clock.
  • the test is terminated and the test script is stopped, and a test report of the test failure is generated. .
  • Step S243 when detecting the SyncE 1588 clock of the current clock source of the device under test as the primary link, and the SyncE 1588 clock is in the locked state, the GNSS clock state is restored from the pseudo normal state to the normal state, and the main Use link
  • the current clock source of the device under test is the SyncE 1588 clock of the primary link, and when the SyncE 1588 clock is in the locked state, the GNSS clock state is restored from the pseudo normal state to the normal state, and the On the primary link, when the GNSS clock is unavailable, the clock source of the device under test is smoothly switched from the GNSS clock to the SyncE 1588 clock of the active link.
  • the test script also includes restoring the GNSS clock state from the pseudo normal state to the normal state. And close the primary link.
  • the test is terminated. That is, stop running the test script and generate a test report that the test failed.
  • Step S244 when detecting that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in the locked state, the standby link is closed;
  • the clock source of the device under test When the GNSS clock recovery is available, the clock source of the device under test still switches to the SyncE 1588 clock of the standby link. The clock source of the device under test is smoothly switched from the SyncE 1588 clock of the active link to the SyncE 1588 of the standby link. A clock, wherein the test script further comprises closing the alternate link. If the current clock source of the device under test is not the SyncE 1588 clock of the standby link, or the current clock source of the device under test is the SyncE 1588 clock of the standby link, but the SyncE 1588 clock is not locked, the test is terminated when the test is terminated. Script, And generate a test report of the test failure.
  • Step S245 when detecting that the current clock source of the device under test is a GNSS clock, and the GNSS clock is in a locked state, the link between the switch and the GNSS clock is closed and the active link is started.
  • the current clock source of the device under test is detected as the GNSS clock, and when the GNSS clock is in the locked state, the link between the switch and the GNSS clock is closed and the active link is started.
  • the clock source of the device under test is The SyncE 1588 clock of the alternate link is smoothly switched to the GNSS clock.
  • the test script also includes closing the link between the switch and the GNSS clock and turning on the active link.
  • the current clock source of the device under test is not a GNSS clock, or the current clock source of the device under test is a GNSS clock, but the GNSS clock is in an unlocked state, then the test is terminated and the test script is stopped, and a test report of the test failure is generated. .
  • Step S300 includes: when detecting the SyncE 1588 clock of the current clock source of the device under test as the primary link, and the SyncE 1588 clock is in the locked state, generating a test report of successful testing.
  • the current clock source of the device under test is the SyncE 1588 clock of the primary link, and the SyncE 1588 clock is locked.
  • a test report indicating that the test is successful is generated.
  • the clock source of the tested device is the GNSS clock. Smoothly switches to the SyncE 1588 clock of the primary link.
  • the test is terminated. That is, stop running the test script and generate a test report that the test failed.
  • the link between the switch and the GNSS clock of the global navigation satellite system is turned on; then, when the current clock source of the device under test is detected as the GNSS clock, and the GNSS clock is in the locked state, the GNSS clock state is set to a pseudo normal state.
  • the current clock source is the GNSS clock, and when the GNSS clock is in the locked state, the link between the switch and the GNSS clock is closed and the active link is opened; finally, the SyncE 1588 of the current clock source of the device under test is detected as the active link.
  • a test report of successful test is generated, which realizes the automatic test of the SyncE 1588 clock smooth switching of the tested device, reduces the workload of the clock switching test of the tested device, and avoids manual detection. The inaccurate test results caused by inaccuracies, improving the efficiency and accuracy of the SyncE 1588 clock smooth switching test of the device under test.
  • FIG. 6 is a schematic diagram of functional modules of a first embodiment of an automated test apparatus according to the present invention.
  • the automated testing device includes:
  • the obtaining module 100 is configured to acquire a test case and a test script of a synchronous Ethernet SyncE 1588 clock corresponding to the test command when receiving a test command sent by the user, where the test case includes a current clock source of the device under test Clock for SyncE 1588, and the SyncE 1588 clock is locked;
  • the test command includes a test command for performing a clock state positive transition test on the SyncE 1588 clock of the device under test, a test command for performing a clock state reverse transition test on the SyncE 1588 clock of the device under test, and SyncE 1588 for the device under test.
  • the clock performs a test instruction of the clock source smoothing switching test and a test instruction for performing a link smoothing switching test on the SyncE 1588 clock of the device under test.
  • the clock source is switched to the clock of the device under test in the SyncE 1588 clock and the GNSS (Global Navigation Satellite System (full name is Global Navigation Satellite System) switching between clocks, the link is switched to the switch between the primary link and the standby link of the SyncE 1588 clock, each test command corresponds to different test cases and Test the script.
  • the automated test method can be executed on a terminal such as a three-network card computer, the first network card is used to upload test data, the second network card is used to control the device under test and the clock source device, and the third network card is used. On the control switch, the terminal first acquires the clock source device, the device under test, and the switch data.
  • the data includes: the device Ip address and port; and the connection relationship between the three devices.
  • the primary and backup clock source devices are respectively connected to the switch 2 And 3 mouths, being The test equipment is connected to the switch 4 port.
  • the terminal starts the active link according to the obtained switch address and the connection data of the clock source and the switch, and closes the standby link, that is, opens the switch port 2, closes the switch port 3, and receives the test command sent by the user, the terminal real-time Detect the current clock of the device under test.
  • the running module 200 is configured to run the test script based on the obtained test case
  • the running module 200 runs the obtained test script according to the obtained test case of the SyncE 1588 clock, which specifically means that the test environment of the test device matches the test case. That is, when the current clock source of the device under test is the SyncE 1588 clock, and the SyncE 1588 clock is in the locked state, the running module 200 runs the test script.
  • the test environment of the test device does not match the test case, that is, the current clock source of the device under test is not the SyncE 1588 clock, or the current clock source of the device under test is the SyncE 1588 clock, but the SyncE 1588 clock is not locked. Terminating the test stops running the test script and generates a test report that the test failed.
  • the generating module 300 is configured to generate a test report when the test script runs.
  • the generating module 300 when the test script is successfully run, the generating module 300 generates a test report that the test succeeds. When the test script running result does not match the test target, the generating module 300 generates a test report that the test fails.
  • the acquiring module 100 acquires the test case and the test script of the SyncE 1588 clock corresponding to the test command, and then the running module 200 runs the test script based on the obtained test case. Then, when the test script runs, the generating module 300 generates a test report, implements an automated test of the SyncE 1588 clock of the tested device, and implements a test device SyncE 1588 clock by running test scripts corresponding to different test instructions. Automated testing of functions reduces the process of manually testing test status and test results during the test process, greatly reducing the workload of the SyncE 1588 clock test of the device under test, and avoiding inaccurate test results caused by inaccurate manual detection. The problem is to improve the efficiency and accuracy of the SyncE 1588 clock test of the tested device and improve the quality of the device under test.
  • a second embodiment of the automated test apparatus of the present invention is proposed based on the first embodiment.
  • the test command is a forward transition test command of the clock of the device under test SyncE 1588
  • the module 200 is operated.
  • the control unit 211 is configured to control the device to be tested to restart;
  • the test environment of the test device is consistent with the test case, that is, when the current clock source of the device under test is the SyncE 1588 clock, and the SyncE 1588 clock is locked, the device under test is restarted, which is easy to understand and test.
  • the script includes controlling the device to be restarted.
  • the detecting unit 212 is configured to detect an operating state of the SyncE 1588 clock in real time during the restart of the device under test;
  • the detecting unit 212 detects the running state of the SyncE 1588 clock in real time, and determines whether the detected running state is consistent with the preset running state.
  • the test script further includes detecting the running status of the SyncE 1588 clock in real time during the restart of the tested device.
  • the generating module 300 is further configured to generate a test report of successful testing after the detected clock state of the SyncE 1588 clock passes through the warm-up state, the free running state, the fast-capture state, and the locked state.
  • the generating module 300 After the detected running state is consistent with the preset running state, that is, after the clock state of the SyncE 1588 clock goes through the warm-up state, the free running state, the fast-capture state, and finally enters the locked state, the generating module 300 generates a test report of successful testing; After the clock state of the SyncE 1588 clock is not in the warm-up state, the free-running state, the fast-capture state, and finally enters the locked state, the test script is stopped when the test is terminated, and the generating module 300 generates a test report of the test failure.
  • the control device 211 controls the device to be restarted. Then, during the restart of the device under test, the detecting unit 212 detects the running status of the SyncE 1588 clock in real time, and then detects the SyncE 1588 clock.
  • the generating module 300 When the clock state passes through the warm-up state, the free running state, the fast-capture state, and the locked state, the generating module 300 generates a test report of successful testing, and implements an automatic test of the clock state forward transition of the SyncE 1588 clock of the tested device, reducing The workload of the SyncE 1588 clock forward transition test of the device under test, Improves the efficiency and accuracy of the clock state forward transition test of the SyncE 1588 clock of the device under test.
  • a third embodiment of the automated test apparatus of the present invention is proposed based on the first embodiment.
  • the test command is a reverse transition test command of the clock of the device under test SyncE 1588
  • the module 200 is operated.
  • the clock pull unit 221 is configured to perform a clock pull operation on the device under test
  • the test environment of the test device is consistent with the test case, that is, when the current clock source of the device under test is the SyncE 1588 clock, and the SyncE 1588 clock is in the locked state, the clock pull unit 221 is to the device under test.
  • the test script includes performing a clock pull operation on the device under test.
  • the link closing unit 222 is configured to: when detecting that the SyncE 1588 clock of the device under test is in a fast-capture state, close the link between the switch and the SyncE 1588 clock;
  • the link down unit 222 turns off the link between the switch and the SyncE 1588 clock, that is, the link is broken.
  • the link of the SyncE 1588 clock is opened, wherein the test script further includes: closing the link of the switch with the SyncE 1588 clock; further, if detecting that the SyncE 1588 clock of the device under test is in a non-fast-capture state, for example, the SyncE 1588 clock is always If the fast capture state cannot be entered, the test script is stopped when the test is terminated, and the generation module 300 generates a test report of the test failure.
  • the link-on unit 223 is configured to enable a link between the switch and the SyncE 1588 clock when detecting that the SyncE 1588 clock of the device under test is in a free running state;
  • the link-on unit 223 turns on the link of the switch and the SyncE 1588 clock again, where the test is performed.
  • the script also includes a link to open the switch with the SyncE 1588 clock; further, if it is detected that the SyncE 1588 clock of the device under test is in a non-free running state, for example, the SyncE 1588 clock cannot enter the free running state, the test is terminated. Run the test script, and generate module 300 to generate the test. Test the failed test report.
  • the generating module 300 is further configured to generate a test report of successful testing when it is detected that the SyncE 1588 clock of the device under test is in a locked state.
  • the generating module 300 After the link between the switch and the SyncE 1588 clock is turned on, when the SyncE 1588 clock of the device under test is detected to be in the locked state, the generating module 300 generates a test report that the test is successful, and further, if the SyncE 1588 of the device under test is detected.
  • the clock is in an unlocked state. For example, the SyncE 1588 clock cannot enter the locked state at all times. If the test is terminated, the test script is stopped, and the generating module 300 generates a test report of the test failure.
  • the device is subjected to a clock pull operation by the clock pull unit 221, and then when the SyncE 1588 clock of the device under test is detected to be in a fast capture state, the link close unit 222 turns off the switch and the SyncE 1588.
  • the generating module 300 When in the locked state, the generating module 300 generates a test report of successful test, realizes the automatic test of the clock state reverse transition of the SyncE 1588 clock of the tested device, and reduces the workload of the SyncE 1588 clock reverse transition test of the tested device. The problem of inaccurate test caused by inaccurate manual detection is avoided, and the efficiency and accuracy of the clock state reverse transition test of the SyncE 1588 clock of the tested device are improved.
  • the test command is a link switching test command of the clock of the device under test SyncE 1588, and the device under test is tested.
  • the running module 200 includes:
  • the primary link closing unit 231 is configured to close the primary link and enable a backup link between the switch and the SyncE 1588 clock;
  • the test environment of the test device is consistent with the test case, that is, when the current clock source of the device under test is the SyncE 1588 clock of the primary link, and the SyncE 1588 clock is locked, the primary link is shut down.
  • 231 close the primary link and open the switch An alternate link to the SyncE 1588 clock, wherein the test script includes shutting down the primary link and turning on the alternate link of the switch to the SyncE 1588 clock.
  • the first standby link closing unit 232 is configured to: when detecting that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in the locked state, shutting down the standby link, and turning on the Primary link
  • the first standby link shutdown unit 232 turns off the standby.
  • the link is opened, and the active link is started.
  • the clock source of the device under test is smoothly switched from the clock source of the active link to the clock source of the standby link.
  • the test script further includes closing the standby link. And open the primary link.
  • the test is terminated.
  • the test script is stopped running, and the generation module 300 generates a test report of the test failure.
  • the generating module 300 is further configured to generate a test report of successful testing when the SyncE 1588 clock of the current clock source of the device under test is detected as the primary link and the SyncE 1588 clock is in the locked state.
  • the generating module 300 After the primary link of the clock source is enabled, if the current clock source of the device under test is detected as the SyncE 1588 clock of the primary link, and the SyncE 1588 clock is locked, the generating module 300 generates a test report of successful testing.
  • the clock source of the device under test is smoothly switched from the clock source of the standby link to the clock source of the active link.
  • the current clock source of the device under test is not the SyncE 1588 clock of the primary link, or the current clock source of the device under test is the SyncE 1588 clock of the primary link, but the SyncE 1588 clock is not locked, then terminate.
  • the test stops running the test script, and the generation module 300 generates a test report of the test failure.
  • the primary link is closed by the primary link down unit 231, and the standby link of the switch and the SyncE 1588 clock is enabled; then, the SyncE of the current clock source of the device under test is detected as the standby link. 1588 clock, and when the SyncE 1588 clock is in the locked state, the first standby link closing unit 232 closes the standby link and turns on the primary link; Then, when the SyncE 1588 clock of the current clock source of the device under test is detected as the active link, and the SyncE 1588 clock is in the locked state, the generating module 300 generates a test report of successful testing; and implements the SyncE 1588 of the tested device.
  • the automated test of the smooth switching of the clock link reduces the workload of the SyncE 1588 clock link switching test of the tested device, avoids the problem of inaccurate testing caused by inaccurate manual detection, and improves the SyncE of the tested device. 1588 Clock Link Smooth Switching Test Efficiency and Accuracy.
  • test command is a clock switch test command of the clock of the device under test SyncE 1588
  • test device is When the current clock source is the SyncE 1588 clock of the primary link
  • running module 200 includes:
  • a GNSS clock link open unit 241, configured to enable a link between the switch and the GNSS clock of the global navigation satellite system
  • the test environment of the test device is consistent with the test case, that is, when the current clock source of the device under test is the SyncE 1588 clock of the active link, and the SyncE 1588 clock is locked, the switch and the GNSS clock are enabled.
  • the link, wherein the test script also includes a link to open the switch to the GNSS clock of the Global Navigation Satellite System.
  • the setting unit 242 is configured to: when detecting that the current clock source of the device under test is a GNSS clock, and the GNSS clock is in a locked state, set the GNSS clock state to a pseudo normal state, and enable the backup chain of the switch and the SyncE 1588 clock. road;
  • the setting unit 242 sets the GNSS clock state to a pseudo normal state, and opens the switch and the switch.
  • the standby link of the SyncE 1588 clock wherein the pseudo normal state means that the GNSS clock is in a normal state, but the GNSS clock state detected by the processor is abnormal by constructing a GNSS clock receiver fault or the like, and is tested at this time.
  • the clock source of the device is smoothly switched to the GNSS clock by the SyncE 1588 clock of the primary link.
  • the test script further includes setting the GNSS clock state to a pseudo normal state and enabling the backup link of the switch and the SyncE 1588 clock.
  • the current clock source of the device is not the GNSS clock, or the current clock source of the device under test is the GNSS clock.
  • the test script is stopped when the test is terminated, and the generation module 300 generates a test report of the test failure.
  • the recovery unit 243 is configured to restore the GNSS clock state from the pseudo normal state to the normal state when the SyncE 1588 clock of the current clock source of the device under test is detected as the active link, and the SyncE 1588 clock is in the locked state, and is turned off.
  • the current clock source of the device under test is the SyncE 1588 clock of the primary link, and when the SyncE 1588 clock is in the locked state, the recovery unit 243 restores the GNSS clock state from the pseudo normal state to the normal state, and The main link is closed.
  • the clock source of the device under test is smoothly switched from the GNSS clock to the SyncE 1588 clock of the active link.
  • the test script also includes restoring the GNSS clock state from the pseudo normal state. It is in a normal state and the primary link is closed.
  • the test is terminated. That is, the test script is stopped, and the generation module 300 generates a test report of the test failure.
  • the second standby link closing unit 244 is configured to: when detecting that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in the locked state, the standby link is closed;
  • the clock source of the device under test When the GNSS clock recovery is available, the clock source of the device under test still switches to the SyncE 1588 clock of the standby link. The clock source of the device under test is smoothly switched from the SyncE 1588 clock of the active link to the SyncE 1588 of the standby link. A clock, wherein the test script further comprises closing the alternate link. If the current clock source of the device under test is not the SyncE 1588 clock of the standby link, or the current clock source of the device under test is the SyncE 1588 clock of the standby link, but the SyncE 1588 clock is not locked, the test is terminated when the test is terminated. The script, the generation module 300 generates a test report that the test failed.
  • the GNSS clock link closing unit 245 is configured to: when detecting that the current clock source of the device under test is a GNSS clock, and the GNSS clock is in a locked state, close the link between the switch and the GNSS clock and enable the active link;
  • the GNSS clock link closing unit 245 closes the link between the switch and the GNSS clock and turns on the active link.
  • the clock source of the device under test is smoothly switched from the SyncE 1588 clock of the standby link to the GNSS clock.
  • the test script also includes closing the link between the switch and the GNSS clock and turning on the active link.
  • the test is terminated when the test is terminated, and the generating module 300 generates a test failure. testing report.
  • the generating module 300 is further configured to generate a test report that the test is successful when the SyncE 1588 clock of the current clock source of the device under test is detected as the active link and the SyncE 1588 clock is in the locked state.
  • the current clock source of the device under test is the SyncE 1588 clock of the primary link, and the SyncE 1588 clock is in the locked state
  • the generating module 300 generates a test report of the successful test, and the clock source of the tested device.
  • the GNSS clock is smoothly switched to the SyncE 1588 clock of the primary link.
  • the test is terminated. That is, the test script is stopped, and the generation module 300 generates a test report of the test failure.
  • the GNSS clock link opening unit 241 is used to enable the link between the switch and the GNSS clock of the global navigation satellite system; and then when the current clock source of the device under test is detected as the GNSS clock and the GNSS clock is in the locked state, the setting unit 242 is configured.
  • the recovery unit 243 restores the GNSS clock state from the pseudo normal state to the normal state, and closes the primary link; and then detects the SyncE 1588 clock of the standby link of the current clock source of the device under test,
  • the second standby link closing unit 244 turns off the standby link; then, when detecting that the current clock source of the device under test is the GNSS clock, and the GNSS clock is in the lock
  • the GNSS clock link closing unit 245 turns off the link of the switch and the GNSS clock and turns on the active link; finally, the SyncE 1588 clock of the current clock source of the device under test is detected as the active link
  • Embodiments of the present invention also provide a storage medium.
  • the foregoing storage medium may be configured to store program code for performing the following steps:
  • test case S1 when receiving the test command sent by the user, obtain a test case and a test script of the synchronous Ethernet SyncE 1588 clock corresponding to the test command, where the test case includes the current clock source of the device under test is the SyncE 1588 clock, and the SyncE 1588 The clock is locked;
  • the storage medium is further arranged to store program code for performing the following steps:
  • test command when the test command is a forward transition test command of the SyncE 1588 clock of the device under test, controlling the device under test to restart;
  • the step of generating a test report includes: generating a test report of successful test after the detected clock state of the SyncE 1588 clock is in a warm-up state, a free running state, a fast-capture state, and a locked state.
  • the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • the test script corresponding to the different test instructions is used to implement automatic testing of various functions of the SyncE 1588 clock of the test device.
  • the process of manually detecting the test state and the test result during the test process is reduced, the workload of the SyncE 1588 clock test of the tested device is greatly reduced, and the problem of inaccurate test caused by the inaccuracy of the manual detection is avoided, and the problem is improved.
  • the efficiency and accuracy of the SyncE 1588 clock test of the test equipment improves the quality of the equipment under test.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)
  • Tests Of Electronic Circuits (AREA)

Abstract

The invention discloses an automated testing method comprising: acquiring test cases and test scripts for a SyncE 1588 clock corresponding to test commands from a client upon receiving the commands; running the test scrips based on the obtained test cases; and generating a test report when the test scripts complete running. The invention further discloses an automated testing device. The invention achieves automated testing of the SyncE 1588 clock of the device being tested. By running test scripts corresponding to different test commands, automated testing of the various functions of the SyncE 1588 clock of the tested device is realized, and the workload involved in testing the SyncE 1588 clock of the tested device is greatly reduced. Automated testing also prevents inaccurate tests due to inaccuracies of human testing, and the accuracy and efficiency of the testing of the SyncE 1588 clock of the tested device as well as the quality thereof are therefore improved.

Description

自动化测试方法及装置Automated test method and device 技术领域Technical field
本发明实施例涉及自动化测试技术领域,尤其涉及一种自动化测试方法及装置。Embodiments of the present invention relate to the field of automated testing technologies, and in particular, to an automated testing method and apparatus.
背景技术Background technique
目前,主要是采用手工测试的方式对被测试设备的网络以太网SyncE 1588时钟进行测试。由于被测试设备SyncE 1588时钟的测试需要测试SyncE 1588时钟的多种功能,在被测试设备的SyncE 1588时钟进行手工测试时,需要对每一个测试状态及测试结果进行人工检测,使得被测试设备的SyncE 1588时钟测试的工作量大,进而导致被测试设备SyncE 1588时钟的测试效率低。At present, the network Ethernet SyncE 1588 clock of the device under test is mainly tested by manual testing. Since the test of the SyncE 1588 clock of the tested device needs to test various functions of the SyncE 1588 clock, when the SyncE 1588 clock of the tested device is manually tested, each test state and test result need to be manually detected, so that the tested device is The SyncE 1588 clock test has a large workload, which in turn leads to low test efficiency of the SyncE 1588 clock of the device under test.
发明内容Summary of the invention
本发明实施例提供一种自动化测试方法及装置,旨在解决被测试设备的SyncE 1588时钟进行手工测试的测试效率低的技术问题。The embodiment of the invention provides an automatic testing method and device, which aims to solve the technical problem of low testing efficiency of manual testing of the SyncE 1588 clock of the tested device.
为实现上述目的,本发明实施例提供的一种自动化测试方法,所述自动化测试方法包括以下步骤:To achieve the above objective, an automated testing method provided by an embodiment of the present invention includes the following steps:
在接收到用户发送的测试指令时,获取所述测试指令对应的同步以太网SyncE 1588时钟的测试用例及测试脚本,其中,所述测试用例包括被测试设备的当前时钟源为SyncE 1588时钟,且SyncE 1588时钟处于锁定状态;When the test command sent by the user is received, the test case and the test script of the synchronous Ethernet SyncE 1588 clock corresponding to the test command are obtained, where the test case includes the current clock source of the device under test is the SyncE 1588 clock, and The SyncE 1588 clock is locked;
基于获取到的测试用例运行所述测试脚本;Running the test script based on the obtained test case;
在所述测试脚本运行完成时,生成测试报告。A test report is generated when the test script runs.
可选地,在所述测试指令为被测试设备SyncE 1588时钟的正向跃迁测试指令时,所述基于获取到的测试用例运行所述测试脚本的步骤包括:Optionally, when the test instruction is a forward transition test instruction of the tested device SyncE 1588 clock, the step of running the test script based on the obtained test case includes:
控制所述被测试设备重启;Controlling the device under test to restart;
在所述被测试设备重启过程中,实时侦测所述SyncE 1588时钟的运 行状态;During the restart of the device under test, the SyncE 1588 clock is detected in real time. Line status
生成测试报告的步骤包括:在侦测的SyncE 1588时钟的时钟状态历经预热状态、自由运行状态、快捕状态以及锁定状态时,生成测试成功的测试报告。The step of generating a test report includes: generating a test report of successful test when the detected clock state of the SyncE 1588 clock is in a warm-up state, a free running state, a fast-capture state, and a locked state.
可选地,在所述测试指令为被测试设备SyncE 1588时钟的反向跃迁测试指令时,所述基于获取到的测试用例运行所述测试脚本的步骤包括:Optionally, when the test instruction is a reverse transition test instruction of the clock of the device under test SyncE 1588, the step of running the test script based on the obtained test case includes:
对所述被测试设备进行时钟拉偏操作;Performing a clock pull operation on the device under test;
在检测到被测试设备的SyncE 1588时钟处于快捕状态时,关闭交换机与所述SyncE 1588时钟的链路;Turning off the link between the switch and the SyncE 1588 clock when detecting that the SyncE 1588 clock of the device under test is in a fast capture state;
在检测到被测试设备的SyncE 1588时钟处于自由运行状态时,开启交换机与所述SyncE 1588时钟的链路;Turning on the link between the switch and the SyncE 1588 clock when detecting that the SyncE 1588 clock of the device under test is in a free running state;
生成测试报告的步骤包括:在检测到被测试设备的SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告。The step of generating a test report includes: generating a test report of successful test when it is detected that the SyncE 1588 clock of the device under test is in a locked state.
可选地,在所述测试指令为被测试设备SyncE 1588时钟的链路切换测试指令,且被测试设备的当前时钟源为主用链路的SyncE 1588时钟时,所述基于获取到的测试用例运行所述测试脚本的步骤包括:Optionally, when the test instruction is a link switching test instruction of the clock of the device under test SyncE 1588, and the current clock source of the device under test is the SyncE 1588 clock of the primary link, the obtained test case is based on the obtained test case. The steps to run the test script include:
关闭所述主用链路,并开启交换机与所述SyncE 1588时钟的备用链路;Closing the primary link and enabling a backup link between the switch and the SyncE 1588 clock;
在检测到被测试设备的当前时钟源为备用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,关闭所述备用链路,并开启所述主用链路;After detecting that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in the locked state, the standby link is closed, and the primary link is turned on;
生成测试报告的步骤包括:在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且所述SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告。The step of generating a test report includes: generating a test report of successful test when the SyncE 1588 clock of the current clock source of the device under test is detected as the active link and the SyncE 1588 clock is in the locked state.
可选地,在所述测试指令为被测试设备SyncE 1588时钟的时钟切换测试指令,且被测试设备的当前时钟源为主用链路的SyncE 1588时钟时,所述基于获取到的测试用例运行所述测试脚本的步骤包括:Optionally, when the test instruction is a clock switching test instruction of the clock of the device under test SyncE 1588, and the current clock source of the device under test is the SyncE 1588 clock of the primary link, the operation is performed based on the obtained test case. The steps of the test script include:
开启交换机与全球导航卫星系统GNSS时钟的链路; Open the link between the switch and the GNSS clock of the Global Navigation Satellite System;
在检测到被测试设备的当前时钟源为GNSS时钟,且GNSS时钟处于锁定状态时,将GNSS时钟状态设置为伪正常状态,并开启交换机与所述SyncE 1588时钟的备用链路;After detecting that the current clock source of the device under test is a GNSS clock, and the GNSS clock is in a locked state, setting the GNSS clock state to a pseudo normal state, and enabling the backup link of the switch and the SyncE 1588 clock;
在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,将GNSS时钟状态从伪正常状态恢复为正常状态,并关闭所述主用链路;After detecting the SyncE 1588 clock of the current clock source of the device under test as the primary link, and the SyncE 1588 clock is in the locked state, the GNSS clock state is restored from the pseudo normal state to the normal state, and the primary link is closed. ;
在检测到被测试设备的当前时钟源为备用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,关闭所述备用链路;After detecting that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in the locked state, the standby link is closed;
在检测到被测试设备的当前时钟源为GNSS时钟,且GNSS时钟处于锁定状态时,关闭交换机与GNSS时钟的链路并开启主用链路;After detecting that the current clock source of the device under test is a GNSS clock, and the GNSS clock is in a locked state, the link between the switch and the GNSS clock is closed and the active link is started;
生成测试报告的步骤包括:在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告。The step of generating a test report includes: generating a test report of successful test when the SyncE 1588 clock of the current clock source of the device under test is detected as the primary link and the SyncE 1588 clock is locked.
此外,为实现上述目的,本发明实施例还提供一种自动化测试装置,所述自动化测试装置包括:In addition, in order to achieve the above object, an embodiment of the present invention further provides an automatic testing device, where the automated testing device includes:
获取模块,设置为在接收到用户发送的测试指令时,获取所述测试指令对应的同步以太网SyncE 1588时钟的测试用例及测试脚本,其中,所述测试用例包括被测试设备的当前时钟源为SyncE 1588时钟,且SyncE 1588时钟处于锁定状态;;The obtaining module is configured to obtain a test case and a test script of the synchronous Ethernet SyncE 1588 clock corresponding to the test command when receiving the test command sent by the user, where the test case includes the current clock source of the device under test is SyncE 1588 clock, and the SyncE 1588 clock is locked;
运行模块,设置为基于获取到的测试用例运行所述测试脚本;Running a module, configured to run the test script based on the obtained test case;
生成模块,设置为在所述测试脚本运行完成时,生成测试报告。A generation module is configured to generate a test report when the test script runs.
可选地,在所述测试指令为被测试设备SyncE 1588时钟的正向跃迁测试指令时,所述运行模块包括:Optionally, when the test instruction is a forward transition test instruction of a clock of the device under test SyncE 1588, the running module includes:
控制单元,设置为控制所述被测试设备重启;a control unit, configured to control the device to be tested to restart;
侦测单元,设置为在所述被测试设备重启过程中,实时侦测所述SyncE 1588时钟的运行状态;The detecting unit is configured to detect the running state of the SyncE 1588 clock in real time during the restart of the device under test;
所述生成模块还设置为在侦测的SyncE 1588时钟的时钟状态历经预热状态、自由运行状态、快捕状态以及锁定状态时,生成测试成功的测试 报告。The generating module is further configured to generate a test successful test when the detected clock state of the SyncE 1588 clock is in a warm-up state, a free running state, a fast-capture state, and a locked state. report.
可选地,在所述测试指令为被测试设备SyncE 1588时钟的反向跃迁测试指令时,所述运行模块包括:Optionally, when the test instruction is a reverse transition test instruction of a clock of the device under test SyncE 1588, the running module includes:
时钟拉偏单元,设置为对所述被测试设备进行时钟拉偏操作;a clock pull unit configured to perform a clock pull operation on the device under test;
链路关闭单元,设置为在检测到被测试设备的SyncE 1588时钟处于快捕状态时,关闭交换机与所述SyncE 1588时钟的链路;a link down unit, configured to: close the switch and the SyncE 1588 clock link when detecting that the SyncE 1588 clock of the device under test is in a fast capture state;
链路开启单元,设置为在检测到被测试设备的SyncE 1588时钟处于自由运行状态时,开启交换机与所述SyncE 1588时钟的链路;a link open unit, configured to enable a link between the switch and the SyncE 1588 clock when detecting that the SyncE 1588 clock of the device under test is in a free running state;
所述生成模块还设置为在检测到被测试设备的SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告。The generating module is further configured to generate a test report that the test is successful when detecting that the SyncE 1588 clock of the device under test is in a locked state.
可选地,在所述测试指令为被测试设备SyncE 1588时钟的链路切换测试指令,且被测试设备的当前时钟源为主用链路的SyncE 1588时钟时,所述运行模块包括:Optionally, when the test command is a link switch test command of the clock of the device under test SyncE 1588, and the current clock source of the device under test is the SyncE 1588 clock of the active link, the running module includes:
主用链路关闭单元,设置为关闭所述主用链路,并开启交换机与所述SyncE 1588时钟的备用链路;The primary link closing unit is configured to close the primary link and enable a backup link between the switch and the SyncE 1588 clock;
第一备用链路关闭单元,设置为在检测到被测试设备的当前时钟源为备用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,关闭所述备用链路,并开启所述主用链路;The first standby link shutting down unit is configured to: when detecting that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in the locked state, shutting down the standby link, and turning on the main Use link
所述生成模块还设置为在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且所述SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告。The generating module is further configured to generate a test report of successful testing when the SyncE 1588 clock of the current clock source of the device under test is detected as the primary link and the SyncE 1588 clock is in the locked state.
可选地,在所述测试指令为被测试设备SyncE 1588时钟的时钟切换测试指令,且被测试设备的当前时钟源为主用链路的SyncE 1588时钟时,所述运行模块包括:Optionally, when the test instruction is a clock switching test instruction of the clock of the device under test SyncE 1588, and the current clock source of the device under test is the SyncE 1588 clock of the primary link, the running module includes:
GNSS时钟链路开启单元,设置为开启交换机与全球导航卫星系统GNSS时钟的链路;a GNSS clock link open unit, configured to enable a link between the switch and the GNSS clock of the global navigation satellite system;
设置单元,设置为在检测到被测试设备的当前时钟源为GNSS时钟,且GNSS时钟处于锁定状态时,将GNSS时钟状态设置为伪正常状态,并 开启交换机与所述SyncE 1588时钟的备用链路;Setting a unit, configured to set the GNSS clock state to a pseudo normal state when detecting that the current clock source of the device under test is a GNSS clock and the GNSS clock is in a locked state, and Opening a backup link between the switch and the SyncE 1588 clock;
恢复单元,设置为在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,将GNSS时钟状态从伪正常状态恢复为正常状态,并关闭所述主用链路;The recovery unit is configured to restore the GNSS clock state from the pseudo normal state to the normal state when the SyncE 1588 clock of the current clock source of the device under test is detected as the active link, and the SyncE 1588 clock is in the locked state, and close the Said primary link;
第二备用链路关闭单元,设置为在检测到被测试设备的当前时钟源为备用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,关闭所述备用链路;a second standby link shutdown unit, configured to: when detecting that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in a locked state, shutting down the standby link;
GNSS时钟链路关闭单元,设置为在检测到被测试设备的当前时钟源为GNSS时钟,且GNSS时钟处于锁定状态时,关闭交换机与GNSS时钟的链路并开启主用链路;The GNSS clock link closing unit is configured to: when detecting that the current clock source of the device under test is a GNSS clock, and the GNSS clock is in a locked state, close the link between the switch and the GNSS clock and enable the active link;
所述生成模块还设置为在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告。The generating module is further configured to generate a test report that the test is successful when the SyncE 1588 clock of the current clock source of the device under test is detected as the active link and the SyncE 1588 clock is in the locked state.
在本发明实施例中,还提供了一种计算机存储介质,该计算机存储介质可以存储有执行指令,该执行指令用于执行上述实施例中的自动化测试方法。In an embodiment of the present invention, a computer storage medium is further provided, and the computer storage medium may store an execution instruction for executing the automated test method in the above embodiment.
本发明实施例通过在接收到用户发送的测试指令时,获取所述测试指令对应的SyncE 1588时钟的测试用例及测试脚本,接着基于获取到的测试用例运行所述测试脚本,然后在所述测试脚本运行完成时,生成测试报告,实现了被测试设备的SyncE 1588时钟的自动化测试,通过运行不同的测试指令对应的测试脚本实现了测试设备的SyncE 1588时钟各种功能的自动化测试,减少了测试过程中人工检测测试状态及测试结果的流程,大大减少了被测试设备的SyncE 1588时钟测试的工作量,避免了因人工检测的不准确而造成的测试不准确的问题,提高了被测试设备的SyncE 1588时钟测试的效率及准确率,提高了被测试设备的质量。The embodiment of the present invention obtains a test case and a test script of the SyncE 1588 clock corresponding to the test instruction when receiving the test instruction sent by the user, and then runs the test script based on the obtained test case, and then performs the test. When the script runs, the test report is generated, and the automatic test of the SyncE 1588 clock of the tested device is realized. The test script corresponding to different test instructions is used to realize the automatic test of various functions of the test device SyncE 1588 clock, and the test is reduced. The process of manually detecting the test status and test results in the process greatly reduces the workload of the SyncE 1588 clock test of the device under test, avoids the problem of inaccurate test caused by inaccurate manual detection, and improves the test equipment. The efficiency and accuracy of the SyncE 1588 clock test improves the quality of the device under test.
附图说明DRAWINGS
图1为本发明自动化测试方法第一实施例的流程示意图; 1 is a schematic flow chart of a first embodiment of an automated test method according to the present invention;
图2为本发明自动化测试方法第二实施例中运行所述测试脚本步骤的细化流程示意图;2 is a schematic flowchart of a step of running the test script in the second embodiment of the automated test method of the present invention;
图3为本发明自动化测试方法第三实施例中运行所述测试脚本步骤的细化流程示意图;3 is a schematic flowchart of a step of running the test script in the third embodiment of the automated test method of the present invention;
图4为本发明自动化测试方法第四实施例中运行所述测试脚本步骤的细化流程示意图;4 is a schematic flowchart of a step of running the test script in the fourth embodiment of the automated test method of the present invention;
图5为本发明自动化测试方法第五实施例中运行所述测试脚本步骤的细化流程示意图;FIG. 5 is a schematic flowchart of a step of running the test script in the fifth embodiment of the automated test method according to the present invention; FIG.
图6为本发明自动化测试装置第一实施例的功能模块示意图;6 is a schematic diagram of functional modules of a first embodiment of an automated test apparatus according to the present invention;
图7为本发明自动化测试装置第二实施例中运行模块的细化功能模块示意图;7 is a schematic diagram of a refinement function module of a running module in a second embodiment of the automatic testing device of the present invention;
图8为本发明自动化测试装置第三实施例中运行模块的细化功能模块示意图;8 is a schematic diagram of a refinement function module of a running module in a third embodiment of the automatic testing device of the present invention;
图9为本发明自动化测试装置第四实施例中运行模块的细化功能模块示意图;9 is a schematic diagram of a refinement function module of a running module in a fourth embodiment of the automatic testing device of the present invention;
图10为本发明自动化测试装置第五实施例中运行模块的细化功能模块示意图。FIG. 10 is a schematic diagram of a refinement function module of a running module in a fifth embodiment of the automatic testing device of the present invention.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features, and advantages of the present invention will be further described in conjunction with the embodiments.
具体实施方式detailed description
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
本发明提供一种自动化测试方法。参照图1,图1为本发明自动化测试方法第一实施例的流程示意图。The present invention provides an automated test method. 1 is a schematic flow chart of a first embodiment of an automated test method according to the present invention.
在本实施例中,该自动化测试方法包括:In this embodiment, the automated test method includes:
步骤S100,在接收到用户发送的测试指令时,获取所述测试指令对应的同步以太网SyncE 1588时钟的测试用例及测试脚本,其中,所述测 试用例包括被测试设备的当前时钟源为SyncE 1588时钟,且SyncE 1588时钟处于锁定状态;Step S100: Acquire a test case and a test script of a synchronous Ethernet SyncE 1588 clock corresponding to the test command when receiving a test command sent by the user, where the test The trial example includes the current clock source of the device under test being the SyncE 1588 clock, and the SyncE 1588 clock is locked;
其中,测试指令包括对被测试设备的SyncE 1588时钟进行时钟状态正向跃迁测试的测试指令、对被测试设备的SyncE 1588时钟进行时钟状态反向跃迁测试的测试指令、对被测试设备的SyncE 1588时钟进行时钟源平滑切换测试的测试指令以及对被测试设备的SyncE 1588时钟进行链路平滑切换测试的测试指令,本实施例中,时钟源切换为被测试设备的时钟在SyncE 1588时钟与GNSS(Global Navigation Satellite System,全称是全球导航卫星系统)时钟之间的切换,链路切换为SyncE 1588时钟的主用链路与备用链路之间的切换,每一种测试指令对应不同的测试用例及测试脚本。本实施例中,该自动化测试方法可以在三网卡计算机等终端上执行,其第一个网卡用于上传测试数据,第二个网卡用于控制被测设备及时钟源设备,第三个网卡用于控制交换机,终端首先获取时钟源设备、被测设备、交换机数据,数据包括:设备Ip地址及端口;以及三种设备的连接关系,例如,主用和备用时钟源设备分别连向交换机的2和3口,被测设备连向交换机4口。终端根据获取的交换机地址,以及时钟源与交换机的连接数据,开启主用链路,关闭备用链路,即开启交换机端口2,关闭交换机端口3,在接收到用户发送的测试指令时,终端实时检测被测试设备的当前时钟源。The test command includes a test command for performing a clock state positive transition test on the SyncE 1588 clock of the device under test, a test command for performing a clock state reverse transition test on the SyncE 1588 clock of the device under test, and SyncE 1588 for the device under test. The clock performs a test instruction of the clock source smoothing switching test and a test instruction for performing a link smoothing switching test on the SyncE 1588 clock of the device under test. In this embodiment, the clock source is switched to the clock of the device under test in the SyncE 1588 clock and the GNSS ( Global Navigation Satellite System (full name is Global Navigation Satellite System) switching between clocks, the link is switched to the switch between the primary link and the standby link of the SyncE 1588 clock, each test command corresponds to different test cases and Test the script. In this embodiment, the automated test method can be executed on a terminal such as a three-network card computer, the first network card is used to upload test data, the second network card is used to control the device under test and the clock source device, and the third network card is used. On the control switch, the terminal first acquires the clock source device, the device under test, and the switch data. The data includes: the device Ip address and port; and the connection relationship between the three devices. For example, the primary and backup clock source devices are respectively connected to the switch 2 And 3 ports, the device under test is connected to the switch 4 port. The terminal starts the active link according to the obtained switch address and the connection data of the clock source and the switch, and closes the standby link, that is, opens the switch port 2, closes the switch port 3, and receives the test command sent by the user, the terminal real-time Detects the current clock source of the device under test.
步骤S200,基于获取到的测试用例运行所述测试脚本;Step S200, running the test script based on the obtained test case;
在获取到测试指令对应的SyncE 1588时钟的测试用例及测试脚本时,根据获取的SyncE 1588时钟的测试用例运行获取的测试脚本,具体是指在测试设备的测试环境与测试用例相符,即在被测试设备的当前时钟源为SyncE 1588时钟,并且SyncE 1588时钟处于锁定状态时,运行测试脚本。当然,在测试设备的测试环境与测试用例不相符,即被测试设备的当前时钟源不是SyncE 1588时钟,或被测试设备的当前时钟源为SyncE 1588时钟,但是SyncE 1588时钟处于非锁定状态,则终止测试即停止运行测试脚本,并生成测试失败的测试报告。 When the test case and the test script of the SyncE 1588 clock corresponding to the test instruction are obtained, the test script obtained according to the obtained test case of the SyncE 1588 clock is specifically determined to be consistent with the test case in the test environment of the test device, that is, The test machine's current clock source is the SyncE 1588 clock, and the test script is run when the SyncE 1588 clock is locked. Of course, the test environment of the test device does not match the test case, that is, the current clock source of the device under test is not the SyncE 1588 clock, or the current clock source of the device under test is the SyncE 1588 clock, but the SyncE 1588 clock is not locked. Terminating the test stops running the test script and generates a test report that the test failed.
步骤S300,在所述测试脚本运行完成时,生成测试报告。Step S300, generating a test report when the test script is completed.
本实施例中,在测试脚本成功运行完成时,生成测试成功的测试报告,在测试脚本运行结果与测试目标不符时,生成测试失败的测试报告。In this embodiment, when the test script is successfully run, a test report with a successful test is generated, and when the test script running result does not match the test target, a test report of the test failure is generated.
本实施例通过在接收到用户发送的测试指令时,获取所述测试指令对应的SyncE 1588时钟的测试用例及测试脚本,接着基于获取到的测试用例运行所述测试脚本,然后在所述测试脚本运行完成时,生成测试报告,实现了被测试设备的SyncE 1588时钟的自动化测试,通过运行不同的测试指令对应的测试脚本实现了测试设备的SyncE 1588时钟各种功能的自动化测试,减少了测试过程中人工检测测试状态及测试结果的流程,大大减少了被测试设备的SyncE 1588时钟测试的工作量,避免了因人工检测的不准确而造成的测试不准确的问题,提高了被测试设备的SyncE 1588时钟测试的效率及准确率,提高了被测试设备的质量。In this embodiment, when receiving the test instruction sent by the user, acquiring a test case and a test script of the SyncE 1588 clock corresponding to the test instruction, and then running the test script based on the obtained test case, and then in the test script When the operation is completed, the test report is generated, and the automatic test of the SyncE 1588 clock of the tested device is realized. The test script corresponding to different test instructions is used to realize the automatic test of various functions of the test device SyncE 1588 clock, and the test process is reduced. The process of manually testing the test status and test results greatly reduces the workload of the SyncE 1588 clock test of the device under test, avoids the problem of inaccurate test caused by inaccurate manual detection, and improves the SyncE of the tested device. The efficiency and accuracy of the 1588 clock test improves the quality of the equipment being tested.
基于第一实施例提出本发明自动化测试方法的第二实施例,参照图2,在本实施例中,在所述测试指令为被测试设备SyncE 1588时钟的正向跃迁测试指令时,步骤S200包括:A second embodiment of the automated test method of the present invention is proposed based on the first embodiment. Referring to FIG. 2, in the embodiment, when the test command is a forward transition test command of the clock of the device under test SyncE 1588, step S200 includes :
步骤S211,控制所述被测试设备重启;Step S211, controlling the device under test to restart;
本实施例中,在测试设备的测试环境与测试用例相符,即在被测试设备的当前时钟源为SyncE 1588时钟,并且SyncE 1588时钟处于锁定状态时,控制被测试设备重新启动,容易理解,测试脚本包括控制所述被测试设备重启。In this embodiment, the test environment of the test device is consistent with the test case, that is, when the current clock source of the device under test is the SyncE 1588 clock, and the SyncE 1588 clock is locked, the device under test is restarted, which is easy to understand and test. The script includes controlling the device to be restarted.
步骤S212,在所述被测试设备重启过程中,实时侦测所述SyncE 1588时钟的运行状态;Step S212, detecting the running state of the SyncE 1588 clock in real time during the restart of the device under test;
在被测试设备重启过程中,实时侦测所述SyncE 1588时钟的运行状态,并确定侦测到的运行状态是否与预设运行状态一致。本实施例中,测试脚本还包括在所述被测试设备重启过程中,实时侦测所述SyncE 1588时钟的运行状态。During the restart of the device under test, the running status of the SyncE 1588 clock is detected in real time, and it is determined whether the detected running state is consistent with the preset running state. In this embodiment, the test script further includes detecting the running status of the SyncE 1588 clock in real time during the restart of the tested device.
步骤S300包括:在侦测的SyncE 1588时钟的时钟状态历经预热状态、 自由运行状态、快捕状态以及锁定状态后,生成测试成功的测试报告。Step S300 includes: performing a warm-up state on the detected clock state of the SyncE 1588 clock, After the free running state, fast catching state, and locked state, a test report of successful test is generated.
在侦测到的运行状态与预设运行状态一致,即SyncE 1588时钟的时钟状态历经预热状态、自由运行状态、快捕状态并最后进入锁定状态后,生成测试成功的测试报告;在SyncE 1588时钟的时钟状态不是历经预热状态、自由运行状态、快捕状态并最后进入锁定状态后,终止测试即停止运行测试脚本,并生成测试失败的测试报告。The detected running state is consistent with the preset running state, that is, the clock state of the SyncE 1588 clock passes through the warm-up state, the free running state, the fast-capture state, and finally enters the locked state, and generates a test report of successful test; in SyncE 1588 After the clock state of the clock is not in the warm-up state, the free-running state, the fast-capture state, and finally enters the locked state, the test script is stopped when the test is terminated, and a test report of the test failure is generated.
本实施例通过控制所述被测试设备重启,接着在所述被测试设备重启过程中,实时侦测所述SyncE 1588时钟的运行状态,然后在侦测的SyncE 1588时钟的时钟状态历经预热状态、自由运行状态、快捕状态以及锁定状态后,生成测试成功的测试报告,实现了被测试设备的SyncE 1588时钟的时钟状态正向跃迁的自动化测试,减少了被测试设备的SyncE 1588时钟正向跃迁测试的工作量,提高了被测试设备的SyncE 1588时钟的时钟状态正向跃迁测试的效率及准确率。In this embodiment, by controlling the device to be restarted, and then during the restart of the device under test, the running state of the SyncE 1588 clock is detected in real time, and then the detected clock state of the SyncE 1588 clock is preheated. After the free running state, the fast catching state, and the locked state, a test report of successful test is generated, and the automatic test of the clock state positive transition of the SyncE 1588 clock of the tested device is realized, and the SyncE 1588 clock of the tested device is reduced. The workload of the transition test improves the efficiency and accuracy of the clock state forward transition test of the SyncE 1588 clock of the device under test.
基于第一实施例提出本发明自动化测试方法的第三实施例,参照图3,在本实施例中,在所述测试指令为被测试设备SyncE 1588时钟的反向跃迁测试指令时,步骤S200包括:A third embodiment of the automated test method of the present invention is proposed based on the first embodiment. Referring to FIG. 3, in the embodiment, when the test command is a reverse transition test command of the clock of the device under test SyncE 1588, step S200 includes :
步骤S221,对所述被测试设备进行时钟拉偏操作;Step S221, performing a clock pull operation on the device under test;
本实施例中,在测试设备的测试环境与测试用例相符,即在被测试设备的当前时钟源为SyncE 1588时钟,并且SyncE 1588时钟处于锁定状态时,对所述被测试设备进行时钟拉偏操作,其中,测试脚本包括对所述被测试设备进行时钟拉偏操作。In this embodiment, the test environment of the test device is consistent with the test case, that is, when the current clock source of the device under test is the SyncE 1588 clock, and the SyncE 1588 clock is in the locked state, the device is subjected to a clock pull operation. The test script includes performing a clock pull operation on the device under test.
步骤S222,在检测到被测试设备的SyncE 1588时钟处于快捕状态时,关闭交换机与所述SyncE 1588时钟的链路;Step S222, when detecting that the SyncE 1588 clock of the device under test is in a fast-capture state, shutting down the link between the switch and the SyncE 1588 clock;
在对所述被测试设备进行时钟拉偏操作之后,若检测到被测试设备的SyncE 1588时钟处于快捕状态时,则关闭交换机与所述SyncE 1588时钟的链路,即断开SyncE 1588时钟的链路,其中,测试脚本还包括关闭交换机与所述SyncE 1588时钟的链路;进一步地,若检测到被测试设备的 SyncE 1588时钟处于非快捕状态,例如SyncE 1588时钟始终无法进入快捕状态,则终止测试即停止运行测试脚本,并生成测试失败的测试报告。After detecting the clock pull operation of the device under test, if it is detected that the SyncE 1588 clock of the device under test is in a fast capture state, the link between the switch and the SyncE 1588 clock is turned off, that is, the SyncE 1588 clock is disconnected. a link, wherein the test script further includes a link that closes the switch to the SyncE 1588 clock; further, if the device under test is detected The SyncE 1588 clock is in a non-fast-capture state. For example, if the SyncE 1588 clock is unable to enter the fast-capture state, the test will be stopped and the test report of the test failure will be generated.
步骤S223,在检测到被测试设备的SyncE 1588时钟处于自由运行状态时,开启交换机与所述SyncE 1588时钟的链路;Step S223, when detecting that the SyncE 1588 clock of the device under test is in a free running state, turning on a link between the switch and the SyncE 1588 clock;
在关闭交换机与所述SyncE 1588时钟的链路之后,若检测到被测试设备的SyncE 1588时钟处于自由运行状态,再次开启交换机与所述SyncE 1588时钟的链路,其中,测试脚本还包括开启交换机与所述SyncE 1588时钟的链路;进一步地,若检测到被测试设备的SyncE 1588时钟处于非自由运行状态,例如SyncE 1588时钟始终无法进入自由运行状态,则终止测试即停止运行测试脚本,并生成测试失败的测试报告。After the link between the switch and the SyncE 1588 clock is closed, if the SyncE 1588 clock of the device under test is detected to be in a free running state, the link between the switch and the SyncE 1588 clock is turned on again, wherein the test script further includes opening the switch. a link to the SyncE 1588 clock; further, if it is detected that the SyncE 1588 clock of the device under test is in a non-free running state, for example, the SyncE 1588 clock cannot always enter the free running state, then the test is terminated and the test script is stopped, and Generate a test report that the test failed.
步骤S300包括:在检测到被测试设备的SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告。Step S300 includes: generating a test report that the test is successful when detecting that the SyncE 1588 clock of the device under test is in a locked state.
在开启交换机与所述SyncE 1588时钟的链路之后,检测到被测试设备的SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告,进一步地,若检测到被测试设备的SyncE 1588时钟处于非锁定状态,例如SyncE 1588时钟始终无法进入锁定状态,则终止测试即停止运行测试脚本,并生成测试失败的测试报告。After the link between the switch and the SyncE 1588 clock is enabled, when the SyncE 1588 clock of the device under test is detected to be in a locked state, a test report of successful test is generated. Further, if the SyncE 1588 clock of the device under test is detected to be non- Locked state, such as the SyncE 1588 clock, can never enter the locked state, then the test is terminated and the test script is stopped, and a test report of the test failure is generated.
本实施例通过对所述被测试设备进行时钟拉偏操作,接着在检测到被测试设备的SyncE 1588时钟处于快捕状态时,关闭交换机与所述SyncE 1588时钟的链路,然后在检测到被测试设备的SyncE 1588时钟处于自由运行状态时,开启交换机与所述SyncE 1588时钟的链路,最后在检测到被测试设备的SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告,实现了被测试设备的SyncE 1588时钟的时钟状态反向跃迁的自动化测试,减少了被测试设备的SyncE 1588时钟正反向迁测试的工作量,提高了被测试设备的SyncE 1588时钟的时钟状态反向跃迁测试的效率及准确率。In this embodiment, by performing a clock pull operation on the device under test, and then detecting that the SyncE 1588 clock of the device under test is in a fast capture state, the link between the switch and the SyncE 1588 clock is closed, and then the When the SyncE 1588 clock of the test device is in a free running state, the link between the switch and the SyncE 1588 clock is turned on, and finally, when the SyncE 1588 clock of the device under test is detected to be in a locked state, a test report of successful test is generated, and the test report is realized. Automated testing of the clock state reverse transition of the SyncE 1588 clock of the test equipment reduces the workload of the SyncE 1588 clock forward and reverse test of the device under test, and improves the clock state reverse transition test of the SyncE 1588 clock of the tested device. Efficiency and accuracy.
基于第一实施例提出本发明自动化测试方法的第四实施例,参照图4, 在本实施例中,在所述测试指令为被测试设备SyncE 1588时钟的链路切换测试指令,且被测试设备的当前时钟源为主用链路的SyncE 1588时钟时,步骤S200包括:A fourth embodiment of the automated test method of the present invention is proposed based on the first embodiment. Referring to FIG. 4, In this embodiment, when the test command is a link switching test command of the clock of the device under test SyncE 1588, and the current clock source of the device under test is the SyncE 1588 clock of the active link, step S200 includes:
步骤S231,关闭所述主用链路,并开启交换机与所述SyncE 1588时钟的备用链路;Step S231, the primary link is closed, and a standby link between the switch and the SyncE 1588 clock is enabled.
本实施例中,在测试设备的测试环境与测试用例相符,即在被测试设备的当前时钟源为主用链路的SyncE 1588时钟,并且SyncE 1588时钟处于锁定状态时,关闭所述主用链路,并开启交换机与所述SyncE 1588时钟的备用链路,其中,测试脚本包括关闭所述主用链路,并开启交换机与所述SyncE 1588时钟的备用链路。In this embodiment, the test environment of the test device is consistent with the test case, that is, when the current clock source of the device under test is the SyncE 1588 clock of the active link, and the SyncE 1588 clock is locked, the main chain is closed. And opening a standby link between the switch and the SyncE 1588 clock, wherein the test script includes turning off the primary link and turning on the standby link of the switch with the SyncE 1588 clock.
步骤S232,在检测到被测试设备的当前时钟源为备用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,关闭所述备用链路,并开启所述主用链路;Step S232, when it is detected that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in the locked state, the standby link is closed, and the primary link is started;
在开启时钟源的备用链路之后,若检测到被测试设备的当前时钟源为备用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态,则关闭所述备用链路,并开启所述主用链路,此时被测试设备的时钟源从主用链路的时钟源平滑切换到了备用链路的时钟源,其中,测试脚本还包括关闭所述备用链路,并开启所述主用链路。当然,若被测试设备的当前时钟源不是备用链路的SyncE 1588时钟,或者在被测试设备的当前时钟源为备用链路的SyncE 1588时钟,但SyncE 1588时钟处于非锁定状态,则终止测试即停止运行测试脚本,并生成测试失败的测试报告。After the backup link of the clock source is turned on, if the current clock source of the device under test is detected as the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in the locked state, the standby link is closed, and the host is turned on. With the link, the clock source of the device under test is smoothly switched from the clock source of the primary link to the clock source of the standby link, wherein the test script further includes closing the standby link and enabling the primary chain. road. Of course, if the current clock source of the device under test is not the SyncE 1588 clock of the standby link, or the current clock source of the device under test is the SyncE 1588 clock of the standby link, but the SyncE 1588 clock is not locked, the test is terminated. Stop running the test script and generate a test report that failed the test.
步骤S300包括:在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且所述SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告。Step S300 includes: when detecting the SyncE 1588 clock of the current clock source of the device under test as the primary link, and the SyncE 1588 clock is in the locked state, generating a test report of successful testing.
在开启时钟源的主用链路之后,若检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态,生成测试成功的测试报告,此时被测试设备的时钟源从备用链路的时钟源平滑切换到了主用链路的时钟源。当然,若被测试设备的当前时钟源不是主用链 路的SyncE 1588时钟,或者在被测试设备的当前时钟源为主用链路的SyncE 1588时钟,但SyncE 1588时钟处于非锁定状态,则终止测试即停止运行测试脚本,并生成测试失败的测试报告。After the active link of the clock source is enabled, if the current clock source of the device under test is detected as the SyncE 1588 clock of the primary link and the SyncE 1588 clock is locked, a test report indicating successful test is generated and tested. The clock source of the device is smoothly switched from the clock source of the standby link to the clock source of the primary link. Of course, if the current clock source of the device under test is not the main chain The SyncE 1588 clock of the path, or the SyncE 1588 clock of the current clock source of the device under test for the primary link, but the SyncE 1588 clock is not locked, then the test is terminated when the test is terminated, and a test report of the test failure is generated. .
本实施例通过关闭所述主用链路,并开启交换机与所述SyncE 1588时钟的备用链路;接着在检测到被测试设备的当前时钟源为备用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,关闭所述备用链路,并开启所述主用链路;然后在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且所述SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告;实现了被测试设备的SyncE 1588时钟链路平滑切换的自动化测试,减少了被测试设备的SyncE 1588时钟链路切换测试的工作量,避免了因人工检测的不准确而造成的测试不准确的问题,提高了被测试设备的SyncE 1588时钟链路平滑切换测试的效率及准确率。In this embodiment, the primary link is closed, and the standby link of the switch and the SyncE 1588 clock is enabled; then, the SyncE 1588 clock of the standby link of the device under test is detected, and the SyncE 1588 clock is detected. When in the locked state, the standby link is closed and the primary link is turned on; then, the SyncE 1588 clock of the current clock source of the device under test is detected as the primary link, and the SyncE 1588 clock is locked. In the state, a test report of successful test is generated; an automated test for smooth switching of the SyncE 1588 clock link of the tested device is implemented, and the workload of the SyncE 1588 clock link switching test of the tested device is reduced, thereby avoiding manual detection. The inaccurate test result caused by inaccuracy improves the efficiency and accuracy of the SyncE 1588 clock link smooth switching test of the device under test.
基于第一实施例提出本发明自动化测试方法的第五实施例,参照图5,在本实施例中,在所述测试指令为被测试设备SyncE 1588时钟的时钟切换测试指令,且被测试设备的当前时钟源为主用链路的SyncE 1588时钟时,步骤S200包括:A fifth embodiment of the automated test method of the present invention is proposed based on the first embodiment. Referring to FIG. 5, in the embodiment, the test command is a clock switch test command of the clock of the device under test SyncE 1588, and the test device is When the current clock source is the SyncE 1588 clock of the primary link, step S200 includes:
步骤S241,开启交换机与全球导航卫星系统GNSS时钟的链路;Step S241, starting a link between the switch and the GNSS clock of the global navigation satellite system;
本实施例中,在测试设备的测试环境与测试用例相符,即在被测试设备的当前时钟源为主用链路的SyncE 1588时钟,并且SyncE 1588时钟处于锁定状态时,开启交换机与GNSS时钟的链路,其中,测试脚本还包括开启交换机与全球导航卫星系统GNSS时钟的链路。In this embodiment, the test environment of the test device is consistent with the test case, that is, when the current clock source of the device under test is the SyncE 1588 clock of the active link, and the SyncE 1588 clock is locked, the switch and the GNSS clock are enabled. The link, wherein the test script also includes a link to open the switch to the GNSS clock of the Global Navigation Satellite System.
步骤S242,在检测到被测试设备的当前时钟源为GNSS时钟,且GNSS时钟处于锁定状态时,将GNSS时钟状态设置为伪正常状态,并开启交换机与所述SyncE 1588时钟的备用链路;Step S242, when it is detected that the current clock source of the device under test is a GNSS clock, and the GNSS clock is in a locked state, the GNSS clock state is set to a pseudo normal state, and the standby link of the switch and the SyncE 1588 clock is enabled.
在开启交换机与GNSS时钟的链路之后,检测到被测试设备的当前时钟源为GNSS时钟,且GNSS时钟处于锁定状态,则将GNSS时钟状态设置为伪正常状态,并开启交换机与所述SyncE 1588时钟的备用链路,其 中,伪正常状态是指GNSS时钟为正常状态,但是通过构造GNSS时钟接收机故障等以使处理器检测到的GNSS时钟状态为非正常状态,此时被测试设备的时钟源由主用链路的SyncE 1588时钟平滑切换到了GNSS时钟,其中,测试脚本还包括将GNSS时钟状态设置为伪正常状态,并开启交换机与所述SyncE 1588时钟的备用链路。当然,若被测试设备的当前时钟源不是GNSS时钟,或被测试设备的当前时钟源为GNSS时钟,但是GNSS时钟处于非锁定状态,则终止测试即停止运行测试脚本,并生成测试失败的测试报告。After the link between the switch and the GNSS clock is enabled, detecting that the current clock source of the device under test is the GNSS clock, and the GNSS clock is in the locked state, the GNSS clock state is set to a pseudo normal state, and the switch and the SyncE 1588 are enabled. Alternate link of the clock, its The pseudo normal state means that the GNSS clock is in a normal state, but the GNSS clock state detected by the processor is abnormal by constructing a GNSS clock receiver fault or the like, and the clock source of the device under test is used by the active link. The SyncE 1588 clock smoothly switches to the GNSS clock, where the test script also includes setting the GNSS clock state to a pseudo-normal state and turning on the alternate link between the switch and the SyncE 1588 clock. Of course, if the current clock source of the device under test is not a GNSS clock, or the current clock source of the device under test is a GNSS clock, but the GNSS clock is in an unlocked state, then the test is terminated and the test script is stopped, and a test report of the test failure is generated. .
步骤S243,在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,将GNSS时钟状态从伪正常状态恢复为正常状态,并关闭所述主用链路;Step S243, when detecting the SyncE 1588 clock of the current clock source of the device under test as the primary link, and the SyncE 1588 clock is in the locked state, the GNSS clock state is restored from the pseudo normal state to the normal state, and the main Use link
在开启备用链路之后,被测试设备的当前时钟源为主用链路的SyncE 1588时钟,并且SyncE 1588时钟处于锁定状态时,将GNSS时钟状态从伪正常状态恢复为正常状态,并关闭所述主用链路,在GNSS时钟不可用时,被测试设备的时钟源由GNSS时钟平滑切换到了主用链路的SyncE 1588时钟,其中,测试脚本还包括将GNSS时钟状态从伪正常状态恢复为正常状态,并关闭所述主用链路。当然,若被测试设备的当前时钟源不是主用链路的SyncE 1588时钟,或被测试设备的当前时钟源为主用链路的SyncE 1588时钟,但是SyncE 1588时钟处于非锁定状态,则终止测试即停止运行测试脚本,并生成测试失败的测试报告。After the standby link is enabled, the current clock source of the device under test is the SyncE 1588 clock of the primary link, and when the SyncE 1588 clock is in the locked state, the GNSS clock state is restored from the pseudo normal state to the normal state, and the On the primary link, when the GNSS clock is unavailable, the clock source of the device under test is smoothly switched from the GNSS clock to the SyncE 1588 clock of the active link. The test script also includes restoring the GNSS clock state from the pseudo normal state to the normal state. And close the primary link. Of course, if the current clock source of the device under test is not the SyncE 1588 clock of the primary link, or the current clock source of the device under test is the SyncE 1588 clock of the primary link, but the SyncE 1588 clock is not locked, the test is terminated. That is, stop running the test script and generate a test report that the test failed.
步骤S244,在检测到被测试设备的当前时钟源为备用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,关闭所述备用链路;Step S244, when detecting that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in the locked state, the standby link is closed;
在GNSS时钟恢复可用时,被测试设备的时钟源仍然优先切换至备用链路的SyncE 1588时钟,即被测试设备的时钟源由主用链路的SyncE 1588时钟平滑切换到了备用链路的SyncE 1588时钟,其中,测试脚本还包括关闭所述备用链路。若被测试设备的当前时钟源不是备用链路的SyncE 1588时钟,或被测试设备的当前时钟源为备用链路的SyncE 1588时钟,但是SyncE 1588时钟处于非锁定状态,则终止测试即停止运行测试脚本, 并生成测试失败的测试报告。When the GNSS clock recovery is available, the clock source of the device under test still switches to the SyncE 1588 clock of the standby link. The clock source of the device under test is smoothly switched from the SyncE 1588 clock of the active link to the SyncE 1588 of the standby link. A clock, wherein the test script further comprises closing the alternate link. If the current clock source of the device under test is not the SyncE 1588 clock of the standby link, or the current clock source of the device under test is the SyncE 1588 clock of the standby link, but the SyncE 1588 clock is not locked, the test is terminated when the test is terminated. Script, And generate a test report of the test failure.
步骤S245,在检测到被测试设备的当前时钟源为GNSS时钟,且GNSS时钟处于锁定状态时,关闭交换机与GNSS时钟的链路并开启主用链路;Step S245, when detecting that the current clock source of the device under test is a GNSS clock, and the GNSS clock is in a locked state, the link between the switch and the GNSS clock is closed and the active link is started.
在关闭备用链路之后,检测到被测试设备的当前时钟源为GNSS时钟,且GNSS时钟处于锁定状态时,关闭交换机与GNSS时钟的链路并开启主用链路,被测试设备的时钟源由备用链路的SyncE 1588时钟平滑切换到了GNSS时钟,其中,测试脚本还包括关闭交换机与GNSS时钟的链路并开启主用链路。当然,若被测试设备的当前时钟源不是GNSS时钟,或被测试设备的当前时钟源为GNSS时钟,但是GNSS时钟处于非锁定状态,则终止测试即停止运行测试脚本,并生成测试失败的测试报告。After the standby link is closed, the current clock source of the device under test is detected as the GNSS clock, and when the GNSS clock is in the locked state, the link between the switch and the GNSS clock is closed and the active link is started. The clock source of the device under test is The SyncE 1588 clock of the alternate link is smoothly switched to the GNSS clock. The test script also includes closing the link between the switch and the GNSS clock and turning on the active link. Of course, if the current clock source of the device under test is not a GNSS clock, or the current clock source of the device under test is a GNSS clock, but the GNSS clock is in an unlocked state, then the test is terminated and the test script is stopped, and a test report of the test failure is generated. .
步骤S300包括:在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告。Step S300 includes: when detecting the SyncE 1588 clock of the current clock source of the device under test as the primary link, and the SyncE 1588 clock is in the locked state, generating a test report of successful testing.
在开启主用链路之后,被测试设备的当前时钟源为主用链路的SyncE 1588时钟,并且SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告,被测试设备的时钟源由GNSS时钟平滑切换到了主用链路的SyncE 1588时钟。当然,若被测试设备的当前时钟源不是主用链路的SyncE 1588时钟,或被测试设备的当前时钟源为主用链路的SyncE 1588时钟,但是SyncE 1588时钟处于非锁定状态,则终止测试即停止运行测试脚本,并生成测试失败的测试报告。After the active link is enabled, the current clock source of the device under test is the SyncE 1588 clock of the primary link, and the SyncE 1588 clock is locked. A test report indicating that the test is successful is generated. The clock source of the tested device is the GNSS clock. Smoothly switches to the SyncE 1588 clock of the primary link. Of course, if the current clock source of the device under test is not the SyncE 1588 clock of the primary link, or the current clock source of the device under test is the SyncE 1588 clock of the primary link, but the SyncE 1588 clock is not locked, the test is terminated. That is, stop running the test script and generate a test report that the test failed.
本实施例通过开启交换机与全球导航卫星系统GNSS时钟的链路;接着在检测到被测试设备的当前时钟源为GNSS时钟,且GNSS时钟处于锁定状态时,将GNSS时钟状态设置为伪正常状态,并开启交换机与所述SyncE 1588时钟的备用链路;然后在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,将GNSS时钟状态从伪正常状态恢复为正常状态,并关闭所述主用链路;再接着在检测到被测试设备的当前时钟源为备用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,关闭所述备用链路;然后在检测到被测试设备 的当前时钟源为GNSS时钟,且GNSS时钟处于锁定状态时,关闭交换机与GNSS时钟的链路并开启主用链路;最后在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告,实现了被测试设备的SyncE 1588时钟平滑切换的自动化测试,减少了被测试设备时钟切换测试的工作量,避免了因人工检测的不准确而造成的测试不准确的问题,提高了被测试设备的SyncE 1588时钟平滑切换测试的效率及准确率。In this embodiment, the link between the switch and the GNSS clock of the global navigation satellite system is turned on; then, when the current clock source of the device under test is detected as the GNSS clock, and the GNSS clock is in the locked state, the GNSS clock state is set to a pseudo normal state. And turning on the standby link of the switch and the SyncE 1588 clock; then detecting the SyncE 1588 clock of the current clock source of the device under test as the primary link, and the GNSS clock state is from the pseudo state when the SyncE 1588 clock is in the locked state The normal state returns to the normal state, and the primary link is closed; then, when the current clock source of the device under test is detected as the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is locked, the standby is turned off. Link; then the device under test is detected The current clock source is the GNSS clock, and when the GNSS clock is in the locked state, the link between the switch and the GNSS clock is closed and the active link is opened; finally, the SyncE 1588 of the current clock source of the device under test is detected as the active link. When the clock and the SyncE 1588 clock are in the locked state, a test report of successful test is generated, which realizes the automatic test of the SyncE 1588 clock smooth switching of the tested device, reduces the workload of the clock switching test of the tested device, and avoids manual detection. The inaccurate test results caused by inaccuracies, improving the efficiency and accuracy of the SyncE 1588 clock smooth switching test of the device under test.
本发明进一步提供一种自动化测试装置。参照图6,图6为本发明自动化测试装置第一实施例的功能模块示意图。The invention further provides an automated test device. Referring to FIG. 6, FIG. 6 is a schematic diagram of functional modules of a first embodiment of an automated test apparatus according to the present invention.
在本实施例中,该自动化测试装置包括:In this embodiment, the automated testing device includes:
获取模块100,设置为在接收到用户发送的测试指令时,获取所述测试指令对应的同步以太网SyncE 1588时钟的测试用例及测试脚本,其中,所述测试用例包括被测试设备的当前时钟源为SyncE 1588时钟,且SyncE 1588时钟处于锁定状态;The obtaining module 100 is configured to acquire a test case and a test script of a synchronous Ethernet SyncE 1588 clock corresponding to the test command when receiving a test command sent by the user, where the test case includes a current clock source of the device under test Clock for SyncE 1588, and the SyncE 1588 clock is locked;
其中,测试指令包括对被测试设备的SyncE 1588时钟进行时钟状态正向跃迁测试的测试指令、对被测试设备的SyncE 1588时钟进行时钟状态反向跃迁测试的测试指令、对被测试设备的SyncE 1588时钟进行时钟源平滑切换测试的测试指令以及对被测试设备的SyncE 1588时钟进行链路平滑切换测试的测试指令,本实施例中,时钟源切换为被测试设备的时钟在SyncE 1588时钟与GNSS(Global Navigation Satellite System,全称是全球导航卫星系统)时钟之间的切换,链路切换为SyncE 1588时钟的主用链路与备用链路之间的切换,每一种测试指令对应不同的测试用例及测试脚本。本实施例中,该自动化测试方法可以在三网卡计算机等终端上执行,其第一个网卡用于上传测试数据,第二个网卡用于控制被测设备及时钟源设备,第三个网卡用于控制交换机,终端首先获取时钟源设备、被测设备、交换机数据,数据包括:设备Ip地址及端口;以及三种设备的连接关系,例如,主用和备用时钟源设备分别连向交换机的2和3口,被 测设备连向交换机4口。终端根据获取的交换机地址,以及时钟源与交换机的连接数据,开启主用链路,关闭备用链路,即开启交换机端口2,关闭交换机端口3,在接收到用户发送的测试指令时,终端实时检测被测试设备的当前时钟。The test command includes a test command for performing a clock state positive transition test on the SyncE 1588 clock of the device under test, a test command for performing a clock state reverse transition test on the SyncE 1588 clock of the device under test, and SyncE 1588 for the device under test. The clock performs a test instruction of the clock source smoothing switching test and a test instruction for performing a link smoothing switching test on the SyncE 1588 clock of the device under test. In this embodiment, the clock source is switched to the clock of the device under test in the SyncE 1588 clock and the GNSS ( Global Navigation Satellite System (full name is Global Navigation Satellite System) switching between clocks, the link is switched to the switch between the primary link and the standby link of the SyncE 1588 clock, each test command corresponds to different test cases and Test the script. In this embodiment, the automated test method can be executed on a terminal such as a three-network card computer, the first network card is used to upload test data, the second network card is used to control the device under test and the clock source device, and the third network card is used. On the control switch, the terminal first acquires the clock source device, the device under test, and the switch data. The data includes: the device Ip address and port; and the connection relationship between the three devices. For example, the primary and backup clock source devices are respectively connected to the switch 2 And 3 mouths, being The test equipment is connected to the switch 4 port. The terminal starts the active link according to the obtained switch address and the connection data of the clock source and the switch, and closes the standby link, that is, opens the switch port 2, closes the switch port 3, and receives the test command sent by the user, the terminal real-time Detect the current clock of the device under test.
运行模块200,设置为基于获取到的测试用例运行所述测试脚本;The running module 200 is configured to run the test script based on the obtained test case;
在获取到测试指令对应的SyncE 1588时钟的测试用例及测试脚本时,运行模块200根据获取的SyncE 1588时钟的测试用例运行获取的测试脚本,具体是指在测试设备的测试环境与测试用例相符,即在被测试设备的当前时钟源为SyncE 1588时钟,并且SyncE 1588时钟处于锁定状态时,运行模块200运行测试脚本。当然,在测试设备的测试环境与测试用例不相符,即被测试设备的当前时钟源不是SyncE 1588时钟,或被测试设备的当前时钟源为SyncE 1588时钟,但是SyncE 1588时钟处于非锁定状态,则终止测试即停止运行测试脚本,并生成测试失败的测试报告。When the test case and the test script of the SyncE 1588 clock corresponding to the test instruction are obtained, the running module 200 runs the obtained test script according to the obtained test case of the SyncE 1588 clock, which specifically means that the test environment of the test device matches the test case. That is, when the current clock source of the device under test is the SyncE 1588 clock, and the SyncE 1588 clock is in the locked state, the running module 200 runs the test script. Of course, the test environment of the test device does not match the test case, that is, the current clock source of the device under test is not the SyncE 1588 clock, or the current clock source of the device under test is the SyncE 1588 clock, but the SyncE 1588 clock is not locked. Terminating the test stops running the test script and generates a test report that the test failed.
生成模块300,设置为在所述测试脚本运行完成时,生成测试报告。The generating module 300 is configured to generate a test report when the test script runs.
本实施例中,在测试脚本成功运行完成时,生成模块300生成测试成功的测试报告,在测试脚本运行结果与测试目标不符时,生成模块300生成测试失败的测试报告。In this embodiment, when the test script is successfully run, the generating module 300 generates a test report that the test succeeds. When the test script running result does not match the test target, the generating module 300 generates a test report that the test fails.
本实施例通过在接收到用户发送的测试指令时,获取模块100获取所述测试指令对应的SyncE 1588时钟的测试用例及测试脚本,接着运行模块200基于获取到的测试用例运行所述测试脚本,然后在所述测试脚本运行完成时,生成模块300生成测试报告,实现了被测试设备的SyncE 1588时钟的自动化测试,通过运行不同的测试指令对应的测试脚本实现了测试设备的SyncE 1588时钟各种功能的自动化测试,减少了测试过程中人工检测测试状态及测试结果的流程,大大减少了被测试设备的SyncE 1588时钟测试的工作量,避免了因人工检测的不准确而造成的测试不准确的问题,提高了被测试设备的SyncE 1588时钟测试的效率及准确率,提高了被测试设备的质量。 In this embodiment, when the test command sent by the user is received, the acquiring module 100 acquires the test case and the test script of the SyncE 1588 clock corresponding to the test command, and then the running module 200 runs the test script based on the obtained test case. Then, when the test script runs, the generating module 300 generates a test report, implements an automated test of the SyncE 1588 clock of the tested device, and implements a test device SyncE 1588 clock by running test scripts corresponding to different test instructions. Automated testing of functions reduces the process of manually testing test status and test results during the test process, greatly reducing the workload of the SyncE 1588 clock test of the device under test, and avoiding inaccurate test results caused by inaccurate manual detection. The problem is to improve the efficiency and accuracy of the SyncE 1588 clock test of the tested device and improve the quality of the device under test.
基于第一实施例提出本发明自动化测试装置的第二实施例,参照图7,在本实施例中,在所述测试指令为被测试设备SyncE 1588时钟的正向跃迁测试指令时,运行模块200包括:A second embodiment of the automated test apparatus of the present invention is proposed based on the first embodiment. Referring to FIG. 7, in the embodiment, when the test command is a forward transition test command of the clock of the device under test SyncE 1588, the module 200 is operated. include:
控制单元211,设置为控制所述被测试设备重启;The control unit 211 is configured to control the device to be tested to restart;
本实施例中,在测试设备的测试环境与测试用例相符,即在被测试设备的当前时钟源为SyncE 1588时钟,并且SyncE 1588时钟处于锁定状态时,控制被测试设备重新启动,容易理解,测试脚本包括控制所述被测试设备重启。In this embodiment, the test environment of the test device is consistent with the test case, that is, when the current clock source of the device under test is the SyncE 1588 clock, and the SyncE 1588 clock is locked, the device under test is restarted, which is easy to understand and test. The script includes controlling the device to be restarted.
侦测单元212,设置为在所述被测试设备重启过程中,实时侦测所述SyncE 1588时钟的运行状态;The detecting unit 212 is configured to detect an operating state of the SyncE 1588 clock in real time during the restart of the device under test;
在被测试设备重启过程中,侦测单元212实时侦测所述SyncE 1588时钟的运行状态,并确定侦测到的运行状态是否与预设运行状态一致。本实施例中,测试脚本还包括在所述被测试设备重启过程中,实时侦测所述SyncE 1588时钟的运行状态。During the restart of the device under test, the detecting unit 212 detects the running state of the SyncE 1588 clock in real time, and determines whether the detected running state is consistent with the preset running state. In this embodiment, the test script further includes detecting the running status of the SyncE 1588 clock in real time during the restart of the tested device.
所述生成模块300还设置为在侦测的SyncE 1588时钟的时钟状态历经预热状态、自由运行状态、快捕状态以及锁定状态后,生成测试成功的测试报告。The generating module 300 is further configured to generate a test report of successful testing after the detected clock state of the SyncE 1588 clock passes through the warm-up state, the free running state, the fast-capture state, and the locked state.
在侦测到的运行状态与预设运行状态一致,即SyncE 1588时钟的时钟状态历经预热状态、自由运行状态、快捕状态并最后进入锁定状态后,生成模块300生成测试成功的测试报告;在SyncE 1588时钟的时钟状态不是历经预热状态、自由运行状态、快捕状态并最后进入锁定状态后,终止测试即停止运行测试脚本,生成模块300生成测试失败的测试报告。After the detected running state is consistent with the preset running state, that is, after the clock state of the SyncE 1588 clock goes through the warm-up state, the free running state, the fast-capture state, and finally enters the locked state, the generating module 300 generates a test report of successful testing; After the clock state of the SyncE 1588 clock is not in the warm-up state, the free-running state, the fast-capture state, and finally enters the locked state, the test script is stopped when the test is terminated, and the generating module 300 generates a test report of the test failure.
本实施例通过控制单元211控制所述被测试设备重启,接着在所述被测试设备重启过程中,侦测单元212实时侦测所述SyncE 1588时钟的运行状态,然后在侦测的SyncE 1588时钟的时钟状态历经预热状态、自由运行状态、快捕状态以及锁定状态时,生成模块300生成测试成功的测试报告,实现了被测试设备的SyncE 1588时钟的时钟状态正向跃迁的自动化测试,减少了被测试设备的SyncE 1588时钟正向跃迁测试的工作量, 提高了被测试设备的SyncE 1588时钟的时钟状态正向跃迁测试的效率及准确率。In this embodiment, the control device 211 controls the device to be restarted. Then, during the restart of the device under test, the detecting unit 212 detects the running status of the SyncE 1588 clock in real time, and then detects the SyncE 1588 clock. When the clock state passes through the warm-up state, the free running state, the fast-capture state, and the locked state, the generating module 300 generates a test report of successful testing, and implements an automatic test of the clock state forward transition of the SyncE 1588 clock of the tested device, reducing The workload of the SyncE 1588 clock forward transition test of the device under test, Improves the efficiency and accuracy of the clock state forward transition test of the SyncE 1588 clock of the device under test.
基于第一实施例提出本发明自动化测试装置的第三实施例,参照图8,在本实施例中,在所述测试指令为被测试设备SyncE 1588时钟的反向跃迁测试指令时,运行模块200包括:A third embodiment of the automated test apparatus of the present invention is proposed based on the first embodiment. Referring to FIG. 8, in the embodiment, when the test command is a reverse transition test command of the clock of the device under test SyncE 1588, the module 200 is operated. include:
时钟拉偏单元221,设置为对所述被测试设备进行时钟拉偏操作;The clock pull unit 221 is configured to perform a clock pull operation on the device under test;
本实施例中,在测试设备的测试环境与测试用例相符,即在被测试设备的当前时钟源为SyncE 1588时钟,并且SyncE 1588时钟处于锁定状态时,时钟拉偏单元221对所述被测试设备进行时钟拉偏操作,其中,测试脚本包括对所述被测试设备进行时钟拉偏操作。In this embodiment, the test environment of the test device is consistent with the test case, that is, when the current clock source of the device under test is the SyncE 1588 clock, and the SyncE 1588 clock is in the locked state, the clock pull unit 221 is to the device under test. Performing a clock pull operation, wherein the test script includes performing a clock pull operation on the device under test.
链路关闭单元222,设置为在检测到被测试设备的SyncE 1588时钟处于快捕状态时,关闭交换机与所述SyncE 1588时钟的链路;The link closing unit 222 is configured to: when detecting that the SyncE 1588 clock of the device under test is in a fast-capture state, close the link between the switch and the SyncE 1588 clock;
在对所述被测试设备进行时钟拉偏操作之后,若检测到被测试设备的SyncE 1588时钟处于快捕状态时,则链路关闭单元222关闭交换机与所述SyncE 1588时钟的链路,即断开SyncE 1588时钟的链路,其中,测试脚本还包括关闭交换机与所述SyncE 1588时钟的链路;进一步地,若检测到被测试设备的SyncE 1588时钟处于非快捕状态,例如SyncE 1588时钟始终无法进入快捕状态,则终止测试即停止运行测试脚本,生成模块300生成测试失败的测试报告。After the clock pull operation of the device under test is performed, if the SyncE 1588 clock of the device under test is detected to be in a fast capture state, the link down unit 222 turns off the link between the switch and the SyncE 1588 clock, that is, the link is broken. The link of the SyncE 1588 clock is opened, wherein the test script further includes: closing the link of the switch with the SyncE 1588 clock; further, if detecting that the SyncE 1588 clock of the device under test is in a non-fast-capture state, for example, the SyncE 1588 clock is always If the fast capture state cannot be entered, the test script is stopped when the test is terminated, and the generation module 300 generates a test report of the test failure.
链路开启单元223,设置为在检测到被测试设备的SyncE 1588时钟处于自由运行状态时,开启交换机与所述SyncE 1588时钟的链路;The link-on unit 223 is configured to enable a link between the switch and the SyncE 1588 clock when detecting that the SyncE 1588 clock of the device under test is in a free running state;
在关闭交换机与所述SyncE 1588时钟的链路之后,若检测到被测试设备的SyncE 1588时钟处于自由运行状态,链路开启单元223再次开启交换机与所述SyncE 1588时钟的链路,其中,测试脚本还包括开启交换机与所述SyncE 1588时钟的链路;进一步地,若检测到被测试设备的SyncE 1588时钟处于非自由运行状态,例如SyncE 1588时钟始终无法进入自由运行状态,则终止测试即停止运行测试脚本,生成模块300生成测 试失败的测试报告。After the link of the switch and the SyncE 1588 clock is closed, if it is detected that the SyncE 1588 clock of the device under test is in a free running state, the link-on unit 223 turns on the link of the switch and the SyncE 1588 clock again, where the test is performed. The script also includes a link to open the switch with the SyncE 1588 clock; further, if it is detected that the SyncE 1588 clock of the device under test is in a non-free running state, for example, the SyncE 1588 clock cannot enter the free running state, the test is terminated. Run the test script, and generate module 300 to generate the test. Test the failed test report.
所述生成模块300还设置为在检测到被测试设备的SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告。The generating module 300 is further configured to generate a test report of successful testing when it is detected that the SyncE 1588 clock of the device under test is in a locked state.
在开启交换机与所述SyncE 1588时钟的链路之后,检测到被测试设备的SyncE 1588时钟处于锁定状态时,生成模块300生成测试成功的测试报告,进一步地,若检测到被测试设备的SyncE 1588时钟处于非锁定状态,例如SyncE 1588时钟始终无法进入锁定状态,则终止测试即停止运行测试脚本,生成模块300生成测试失败的测试报告。After the link between the switch and the SyncE 1588 clock is turned on, when the SyncE 1588 clock of the device under test is detected to be in the locked state, the generating module 300 generates a test report that the test is successful, and further, if the SyncE 1588 of the device under test is detected. The clock is in an unlocked state. For example, the SyncE 1588 clock cannot enter the locked state at all times. If the test is terminated, the test script is stopped, and the generating module 300 generates a test report of the test failure.
本实施例通过时钟拉偏单元221对所述被测试设备进行时钟拉偏操作,接着在检测到被测试设备的SyncE 1588时钟处于快捕状态时,链路关闭单元222关闭交换机与所述SyncE 1588时钟的链路,然后在检测到被测试设备的SyncE 1588时钟处于自由运行状态时,链路开启单元222开启交换机与所述SyncE 1588时钟的链路,最后在检测到被测试设备的SyncE 1588时钟处于锁定状态时,生成模块300生成测试成功的测试报告,实现了被测试设备的SyncE 1588时钟的时钟状态反向跃迁的自动化测试,减少了被测试设备的SyncE 1588时钟反向跃迁测试的工作量,避免了因人工检测的不准确而造成的测试不准确的问题,提高了被测试设备的SyncE 1588时钟的时钟状态反向跃迁测试的效率及准确率。In this embodiment, the device is subjected to a clock pull operation by the clock pull unit 221, and then when the SyncE 1588 clock of the device under test is detected to be in a fast capture state, the link close unit 222 turns off the switch and the SyncE 1588. The link of the clock, and then detecting that the SyncE 1588 clock of the device under test is in a free running state, the link-on unit 222 turns on the link of the switch with the SyncE 1588 clock, and finally detects the SyncE 1588 clock of the device under test. When in the locked state, the generating module 300 generates a test report of successful test, realizes the automatic test of the clock state reverse transition of the SyncE 1588 clock of the tested device, and reduces the workload of the SyncE 1588 clock reverse transition test of the tested device. The problem of inaccurate test caused by inaccurate manual detection is avoided, and the efficiency and accuracy of the clock state reverse transition test of the SyncE 1588 clock of the tested device are improved.
基于第一实施例提出本发明自动化测试装置的第四实施例,参照图9,在本实施例中,在所述测试指令为被测试设备SyncE 1588时钟的链路切换测试指令,且被测试设备的当前时钟源为主用链路的SyncE 1588时钟时,运行模块200包括:A fourth embodiment of the automated test apparatus of the present invention is proposed based on the first embodiment. Referring to FIG. 9, in the embodiment, the test command is a link switching test command of the clock of the device under test SyncE 1588, and the device under test is tested. When the current clock source is the SyncE 1588 clock of the primary link, the running module 200 includes:
主用链路关闭单元231,设置为关闭所述主用链路,并开启交换机与所述SyncE 1588时钟的备用链路;The primary link closing unit 231 is configured to close the primary link and enable a backup link between the switch and the SyncE 1588 clock;
本实施例中,在测试设备的测试环境与测试用例相符,即在被测试设备的当前时钟源为主用链路的SyncE 1588时钟,并且SyncE 1588时钟处于锁定状态时,主用链路关闭单元231关闭所述主用链路,并开启交换机 与所述SyncE 1588时钟的备用链路,其中,测试脚本包括关闭所述主用链路,并开启交换机与所述SyncE 1588时钟的备用链路。In this embodiment, the test environment of the test device is consistent with the test case, that is, when the current clock source of the device under test is the SyncE 1588 clock of the primary link, and the SyncE 1588 clock is locked, the primary link is shut down. 231 close the primary link and open the switch An alternate link to the SyncE 1588 clock, wherein the test script includes shutting down the primary link and turning on the alternate link of the switch to the SyncE 1588 clock.
第一备用链路关闭单元232,设置为在检测到被测试设备的当前时钟源为备用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,关闭所述备用链路,并开启所述主用链路;The first standby link closing unit 232 is configured to: when detecting that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in the locked state, shutting down the standby link, and turning on the Primary link
在开启时钟源的备用链路之后,若检测到被测试设备的当前时钟源为备用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态,则第一备用链路关闭单元232关闭所述备用链路,并开启所述主用链路,此时被测试设备的时钟源从主用链路的时钟源平滑切换到了备用链路的时钟源,其中,测试脚本还包括关闭所述备用链路,并开启所述主用链路。当然,若被测试设备的当前时钟源不是备用链路的SyncE 1588时钟,或者在被测试设备的当前时钟源为备用链路的SyncE 1588时钟,但SyncE 1588时钟处于非锁定状态,则终止测试即停止运行测试脚本,生成模块300生成测试失败的测试报告。After the backup link of the clock source is turned on, if it is detected that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in the locked state, the first standby link shutdown unit 232 turns off the standby. The link is opened, and the active link is started. The clock source of the device under test is smoothly switched from the clock source of the active link to the clock source of the standby link. The test script further includes closing the standby link. And open the primary link. Of course, if the current clock source of the device under test is not the SyncE 1588 clock of the standby link, or the current clock source of the device under test is the SyncE 1588 clock of the standby link, but the SyncE 1588 clock is not locked, the test is terminated. The test script is stopped running, and the generation module 300 generates a test report of the test failure.
所述生成模块300还设置为在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且所述SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告。The generating module 300 is further configured to generate a test report of successful testing when the SyncE 1588 clock of the current clock source of the device under test is detected as the primary link and the SyncE 1588 clock is in the locked state.
在开启时钟源的主用链路之后,若检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态,生成模块300生成测试成功的测试报告,此时被测试设备的时钟源从备用链路的时钟源平滑切换到了主用链路的时钟源。当然,若被测试设备的当前时钟源不是主用链路的SyncE 1588时钟,或者在被测试设备的当前时钟源为主用链路的SyncE 1588时钟,但SyncE 1588时钟处于非锁定状态,则终止测试即停止运行测试脚本,生成模块300生成测试失败的测试报告。After the primary link of the clock source is enabled, if the current clock source of the device under test is detected as the SyncE 1588 clock of the primary link, and the SyncE 1588 clock is locked, the generating module 300 generates a test report of successful testing. The clock source of the device under test is smoothly switched from the clock source of the standby link to the clock source of the active link. Of course, if the current clock source of the device under test is not the SyncE 1588 clock of the primary link, or the current clock source of the device under test is the SyncE 1588 clock of the primary link, but the SyncE 1588 clock is not locked, then terminate. The test stops running the test script, and the generation module 300 generates a test report of the test failure.
本实施例通过主用链路关闭单元231关闭所述主用链路,并开启交换机与所述SyncE 1588时钟的备用链路;接着在检测到被测试设备的当前时钟源为备用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,第一备用链路关闭单元232关闭所述备用链路,并开启所述主用链路; 然后在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且所述SyncE 1588时钟处于锁定状态时,生成模块300生成测试成功的测试报告;实现了被测试设备的SyncE 1588时钟链路平滑切换的自动化测试,减少了被测试设备的SyncE 1588时钟链路切换测试的工作量,避免了因人工检测的不准确而造成的测试不准确的问题,提高了被测试设备的SyncE 1588时钟链路平滑切换测试的效率及准确率。In this embodiment, the primary link is closed by the primary link down unit 231, and the standby link of the switch and the SyncE 1588 clock is enabled; then, the SyncE of the current clock source of the device under test is detected as the standby link. 1588 clock, and when the SyncE 1588 clock is in the locked state, the first standby link closing unit 232 closes the standby link and turns on the primary link; Then, when the SyncE 1588 clock of the current clock source of the device under test is detected as the active link, and the SyncE 1588 clock is in the locked state, the generating module 300 generates a test report of successful testing; and implements the SyncE 1588 of the tested device. The automated test of the smooth switching of the clock link reduces the workload of the SyncE 1588 clock link switching test of the tested device, avoids the problem of inaccurate testing caused by inaccurate manual detection, and improves the SyncE of the tested device. 1588 Clock Link Smooth Switching Test Efficiency and Accuracy.
基于第一实施例提出本发明自动化测试装置的第五实施例,参照图10,在本实施例中,在所述测试指令为被测试设备SyncE 1588时钟的时钟切换测试指令,且被测试设备的当前时钟源为主用链路的SyncE 1588时钟时,运行模块200包括:A fifth embodiment of the automated test apparatus of the present invention is proposed based on the first embodiment. Referring to FIG. 10, in the embodiment, the test command is a clock switch test command of the clock of the device under test SyncE 1588, and the test device is When the current clock source is the SyncE 1588 clock of the primary link, the running module 200 includes:
GNSS时钟链路开启单元241,设置为开启交换机与全球导航卫星系统GNSS时钟的链路;a GNSS clock link open unit 241, configured to enable a link between the switch and the GNSS clock of the global navigation satellite system;
本实施例中,在测试设备的测试环境与测试用例相符,即在被测试设备的当前时钟源为主用链路的SyncE 1588时钟,并且SyncE 1588时钟处于锁定状态时,开启交换机与GNSS时钟的链路,其中,测试脚本还包括开启交换机与全球导航卫星系统GNSS时钟的链路。In this embodiment, the test environment of the test device is consistent with the test case, that is, when the current clock source of the device under test is the SyncE 1588 clock of the active link, and the SyncE 1588 clock is locked, the switch and the GNSS clock are enabled. The link, wherein the test script also includes a link to open the switch to the GNSS clock of the Global Navigation Satellite System.
设置单元242,设置为在检测到被测试设备的当前时钟源为GNSS时钟,且GNSS时钟处于锁定状态时,将GNSS时钟状态设置为伪正常状态,并开启交换机与所述SyncE 1588时钟的备用链路;The setting unit 242 is configured to: when detecting that the current clock source of the device under test is a GNSS clock, and the GNSS clock is in a locked state, set the GNSS clock state to a pseudo normal state, and enable the backup chain of the switch and the SyncE 1588 clock. road;
在开启交换机与GNSS时钟的链路之后,检测到被测试设备的当前时钟源为GNSS时钟,且GNSS时钟处于锁定状态,则设置单元242将GNSS时钟状态设置为伪正常状态,并开启交换机与所述SyncE 1588时钟的备用链路,其中,伪正常状态是指GNSS时钟为正常状态,但是通过构造GNSS时钟接收机故障等以使处理器检测到的GNSS时钟状态为非正常状态,此时被测试设备的时钟源由主用链路的SyncE 1588时钟平滑切换到了GNSS时钟,其中,测试脚本还包括将GNSS时钟状态设置为伪正常状态,并开启交换机与所述SyncE 1588时钟的备用链路。当然,若被测试 设备的当前时钟源不是GNSS时钟,或被测试设备的当前时钟源为GNSS时钟,但是GNSS时钟处于非锁定状态,则终止测试即停止运行测试脚本,生成模块300生成测试失败的测试报告。After the link between the switch and the GNSS clock is enabled, and the current clock source of the device under test is detected as the GNSS clock, and the GNSS clock is in the locked state, the setting unit 242 sets the GNSS clock state to a pseudo normal state, and opens the switch and the switch. The standby link of the SyncE 1588 clock, wherein the pseudo normal state means that the GNSS clock is in a normal state, but the GNSS clock state detected by the processor is abnormal by constructing a GNSS clock receiver fault or the like, and is tested at this time. The clock source of the device is smoothly switched to the GNSS clock by the SyncE 1588 clock of the primary link. The test script further includes setting the GNSS clock state to a pseudo normal state and enabling the backup link of the switch and the SyncE 1588 clock. Of course, if tested The current clock source of the device is not the GNSS clock, or the current clock source of the device under test is the GNSS clock. However, if the GNSS clock is in the unlock state, the test script is stopped when the test is terminated, and the generation module 300 generates a test report of the test failure.
恢复单元243,设置为在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,将GNSS时钟状态从伪正常状态恢复为正常状态,并关闭所述主用链路;The recovery unit 243 is configured to restore the GNSS clock state from the pseudo normal state to the normal state when the SyncE 1588 clock of the current clock source of the device under test is detected as the active link, and the SyncE 1588 clock is in the locked state, and is turned off. The primary link;
在开启备用链路之后,被测试设备的当前时钟源为主用链路的SyncE 1588时钟,并且SyncE 1588时钟处于锁定状态时,恢复单元243将GNSS时钟状态从伪正常状态恢复为正常状态,并关闭所述主用链路,在GNSS时钟不可用时,被测试设备的时钟源由GNSS时钟平滑切换到了主用链路的SyncE 1588时钟,其中,测试脚本还包括将GNSS时钟状态从伪正常状态恢复为正常状态,并关闭所述主用链路。当然,若被测试设备的当前时钟源不是主用链路的SyncE 1588时钟,或被测试设备的当前时钟源为主用链路的SyncE 1588时钟,但是SyncE 1588时钟处于非锁定状态,则终止测试即停止运行测试脚本,生成模块300生成测试失败的测试报告。After the standby link is turned on, the current clock source of the device under test is the SyncE 1588 clock of the primary link, and when the SyncE 1588 clock is in the locked state, the recovery unit 243 restores the GNSS clock state from the pseudo normal state to the normal state, and The main link is closed. When the GNSS clock is unavailable, the clock source of the device under test is smoothly switched from the GNSS clock to the SyncE 1588 clock of the active link. The test script also includes restoring the GNSS clock state from the pseudo normal state. It is in a normal state and the primary link is closed. Of course, if the current clock source of the device under test is not the SyncE 1588 clock of the primary link, or the current clock source of the device under test is the SyncE 1588 clock of the primary link, but the SyncE 1588 clock is not locked, the test is terminated. That is, the test script is stopped, and the generation module 300 generates a test report of the test failure.
第二备用链路关闭单元244,设置为在检测到被测试设备的当前时钟源为备用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,关闭所述备用链路;The second standby link closing unit 244 is configured to: when detecting that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in the locked state, the standby link is closed;
在GNSS时钟恢复可用时,被测试设备的时钟源仍然优先切换至备用链路的SyncE 1588时钟,即被测试设备的时钟源由主用链路的SyncE 1588时钟平滑切换到了备用链路的SyncE 1588时钟,其中,测试脚本还包括关闭所述备用链路。若被测试设备的当前时钟源不是备用链路的SyncE 1588时钟,或被测试设备的当前时钟源为备用链路的SyncE 1588时钟,但是SyncE 1588时钟处于非锁定状态,则终止测试即停止运行测试脚本,生成模块300生成测试失败的测试报告。When the GNSS clock recovery is available, the clock source of the device under test still switches to the SyncE 1588 clock of the standby link. The clock source of the device under test is smoothly switched from the SyncE 1588 clock of the active link to the SyncE 1588 of the standby link. A clock, wherein the test script further comprises closing the alternate link. If the current clock source of the device under test is not the SyncE 1588 clock of the standby link, or the current clock source of the device under test is the SyncE 1588 clock of the standby link, but the SyncE 1588 clock is not locked, the test is terminated when the test is terminated. The script, the generation module 300 generates a test report that the test failed.
GNSS时钟链路关闭单元245,设置为在检测到被测试设备的当前时钟源为GNSS时钟,且GNSS时钟处于锁定状态时,关闭交换机与GNSS时钟的链路并开启主用链路; The GNSS clock link closing unit 245 is configured to: when detecting that the current clock source of the device under test is a GNSS clock, and the GNSS clock is in a locked state, close the link between the switch and the GNSS clock and enable the active link;
在关闭备用链路之后,检测到被测试设备的当前时钟源为GNSS时钟,且GNSS时钟处于锁定状态时,GNSS时钟链路关闭单元245关闭交换机与GNSS时钟的链路并开启主用链路,被测试设备的时钟源由备用链路的SyncE 1588时钟平滑切换到了GNSS时钟,其中,测试脚本还包括,关闭交换机与GNSS时钟的链路并开启主用链路。当然,若被测试设备的当前时钟源不是GNSS时钟,或被测试设备的当前时钟源为GNSS时钟,但是GNSS时钟处于非锁定状态,则终止测试即停止运行测试脚本,生成模块300生成测试失败的测试报告。After the standby link is closed, detecting that the current clock source of the device under test is the GNSS clock, and the GNSS clock is in the locked state, the GNSS clock link closing unit 245 closes the link between the switch and the GNSS clock and turns on the active link. The clock source of the device under test is smoothly switched from the SyncE 1588 clock of the standby link to the GNSS clock. The test script also includes closing the link between the switch and the GNSS clock and turning on the active link. Of course, if the current clock source of the device under test is not a GNSS clock, or the current clock source of the device under test is a GNSS clock, but the GNSS clock is in an unlocked state, the test is terminated when the test is terminated, and the generating module 300 generates a test failure. testing report.
所述生成模块300还设置为在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告。The generating module 300 is further configured to generate a test report that the test is successful when the SyncE 1588 clock of the current clock source of the device under test is detected as the active link and the SyncE 1588 clock is in the locked state.
在开启主用链路之后,被测试设备的当前时钟源为主用链路的SyncE 1588时钟,并且SyncE 1588时钟处于锁定状态时,生成模块300生成测试成功的测试报告,被测试设备的时钟源由GNSS时钟平滑切换到了主用链路的SyncE 1588时钟。当然,若被测试设备的当前时钟源不是主用链路的SyncE 1588时钟,或被测试设备的当前时钟源为主用链路的SyncE 1588时钟,但是SyncE 1588时钟处于非锁定状态,则终止测试即停止运行测试脚本,生成模块300生成测试失败的测试报告。After the active link is started, the current clock source of the device under test is the SyncE 1588 clock of the primary link, and the SyncE 1588 clock is in the locked state, the generating module 300 generates a test report of the successful test, and the clock source of the tested device. The GNSS clock is smoothly switched to the SyncE 1588 clock of the primary link. Of course, if the current clock source of the device under test is not the SyncE 1588 clock of the primary link, or the current clock source of the device under test is the SyncE 1588 clock of the primary link, but the SyncE 1588 clock is not locked, the test is terminated. That is, the test script is stopped, and the generation module 300 generates a test report of the test failure.
本实施例通过GNSS时钟链路开启单元241开启交换机与全球导航卫星系统GNSS时钟的链路;接着在检测到被测试设备的当前时钟源为GNSS时钟,且GNSS时钟处于锁定状态时,设置单元242将GNSS时钟状态设置为伪正常状态,并开启交换机与所述SyncE 1588时钟的备用链路;然后在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,恢复单元243将GNSS时钟状态从伪正常状态恢复为正常状态,并关闭所述主用链路;再接着在检测到被测试设备的当前时钟源为备用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,第二备用链路关闭单元244关闭所述备用链路;然后在检测到被测试设备的当前时钟源为GNSS时钟,且GNSS时钟处于锁 定状态时,GNSS时钟链路关闭单元245关闭交换机与GNSS时钟的链路并开启主用链路;最后在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,生成模块300生成测试成功的测试报告,实现了被测试设备的SyncE 1588时钟平滑切换的自动化测试,减少了被测试设备时钟切换测试的工作量,避免了因人工检测的不准确而造成的测试不准确的问题,提高了被测试设备的SyncE 1588时钟平滑切换测试的效率及准确率。In this embodiment, the GNSS clock link opening unit 241 is used to enable the link between the switch and the GNSS clock of the global navigation satellite system; and then when the current clock source of the device under test is detected as the GNSS clock and the GNSS clock is in the locked state, the setting unit 242 is configured. Setting the GNSS clock state to a pseudo normal state, and turning on the standby link of the switch and the SyncE 1588 clock; then detecting the SyncE 1588 clock of the current clock source of the device under test as the primary link, and the SyncE 1588 clock is at When the state is locked, the recovery unit 243 restores the GNSS clock state from the pseudo normal state to the normal state, and closes the primary link; and then detects the SyncE 1588 clock of the standby link of the current clock source of the device under test, When the SyncE 1588 clock is in the locked state, the second standby link closing unit 244 turns off the standby link; then, when detecting that the current clock source of the device under test is the GNSS clock, and the GNSS clock is in the lock When the state is fixed, the GNSS clock link closing unit 245 turns off the link of the switch and the GNSS clock and turns on the active link; finally, the SyncE 1588 clock of the current clock source of the device under test is detected as the active link, and SyncE 1588 When the clock is in the locked state, the generating module 300 generates a test report of successful testing, realizing the automatic test of the SyncE 1588 clock smooth switching of the tested device, reducing the workload of the clock switching test of the tested device, and avoiding the manual detection. Accurate and inaccurate testing results improve the efficiency and accuracy of the SyncE 1588 clock smooth switching test of the device under test.
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的程序代码:Embodiments of the present invention also provide a storage medium. Optionally, in the embodiment, the foregoing storage medium may be configured to store program code for performing the following steps:
S1,在接收到用户发送的测试指令时,获取测试指令对应的同步以太网SyncE 1588时钟的测试用例及测试脚本,其中,测试用例包括被测试设备的当前时钟源为SyncE 1588时钟,且SyncE 1588时钟处于锁定状态;S1, when receiving the test command sent by the user, obtain a test case and a test script of the synchronous Ethernet SyncE 1588 clock corresponding to the test command, where the test case includes the current clock source of the device under test is the SyncE 1588 clock, and the SyncE 1588 The clock is locked;
S2,基于获取到的测试用例运行测试脚本;S2, running a test script based on the obtained test case;
S3,在测试脚本运行完成时,生成测试报告。S3, generate a test report when the test script runs.
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:Optionally, the storage medium is further arranged to store program code for performing the following steps:
S1,在测试指令为被测试设备SyncE 1588时钟的正向跃迁测试指令时,控制被测试设备重启;S1, when the test command is a forward transition test command of the SyncE 1588 clock of the device under test, controlling the device under test to restart;
S2,在被测试设备重启过程中,实时侦测SyncE 1588时钟的运行状态;S2, detecting the running state of the SyncE 1588 clock in real time during the restart of the device under test;
S3,生成测试报告的步骤包括:在侦测的SyncE 1588时钟的时钟状态历经预热状态、自由运行状态、快捕状态以及锁定状态后,生成测试成功的测试报告。S3. The step of generating a test report includes: generating a test report of successful test after the detected clock state of the SyncE 1588 clock is in a warm-up state, a free running state, a fast-capture state, and a locked state.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介 质。Optionally, in this embodiment, the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory. Various kinds of programs that can store program code, such as a disc or a disc. quality.
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。For example, the specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the optional embodiments, and details are not described herein again.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only the preferred embodiments of the present invention, and are not intended to limit the scope of the invention, and the equivalent structure or equivalent process transformations made by the description of the present invention and the drawings are directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of the present invention.
工业实用性Industrial applicability
在本发明实施例中,通过在接收到用户发送的测试指令时,获取所述测试指令对应的SyncE 1588时钟的测试用例及测试脚本,接着基于获取到的测试用例运行所述测试脚本,然后在所述测试脚本运行完成时,生成测试报告,实现了被测试设备的SyncE 1588时钟的自动化测试,通过运行不同的测试指令对应的测试脚本实现了测试设备的SyncE 1588时钟各种功能的自动化测试,减少了测试过程中人工检测测试状态及测试结果的流程,大大减少了被测试设备的SyncE 1588时钟测试的工作量,避免了因人工检测的不准确而造成的测试不准确的问题,提高了被测试设备的SyncE 1588时钟测试的效率及准确率,提高了被测试设备的质量。 In the embodiment of the present invention, when receiving the test instruction sent by the user, acquiring a test case and a test script of the SyncE 1588 clock corresponding to the test instruction, and then running the test script based on the obtained test case, and then When the test script is completed, a test report is generated, and the SyncE 1588 clock of the tested device is automatically tested. The test script corresponding to the different test instructions is used to implement automatic testing of various functions of the SyncE 1588 clock of the test device. The process of manually detecting the test state and the test result during the test process is reduced, the workload of the SyncE 1588 clock test of the tested device is greatly reduced, and the problem of inaccurate test caused by the inaccuracy of the manual detection is avoided, and the problem is improved. The efficiency and accuracy of the SyncE 1588 clock test of the test equipment improves the quality of the equipment under test.

Claims (10)

  1. 一种自动化测试方法,所述自动化测试方法包括以下步骤:An automated test method comprising the following steps:
    在接收到用户发送的测试指令时,获取所述测试指令对应的同步以太网SyncE 1588时钟的测试用例及测试脚本,其中,所述测试用例包括被测试设备的当前时钟源为SyncE 1588时钟,且SyncE 1588时钟处于锁定状态;When the test command sent by the user is received, the test case and the test script of the synchronous Ethernet SyncE 1588 clock corresponding to the test command are obtained, where the test case includes the current clock source of the device under test is the SyncE 1588 clock, and The SyncE 1588 clock is locked;
    基于获取到的测试用例运行所述测试脚本;Running the test script based on the obtained test case;
    在所述测试脚本运行完成时,生成测试报告。A test report is generated when the test script runs.
  2. 如权利要求1所述的自动化测试方法,其中,在所述测试指令为被测试设备SyncE 1588时钟的正向跃迁测试指令时,所述基于获取到的测试用例运行所述测试脚本的步骤包括:The automated test method according to claim 1, wherein when the test command is a forward transition test command of a test device SyncE 1588 clock, the step of running the test script based on the obtained test case comprises:
    控制所述被测试设备重启;Controlling the device under test to restart;
    在所述被测试设备重启过程中,实时侦测所述SyncE 1588时钟的运行状态;During the restart of the device under test, detecting the running status of the SyncE 1588 clock in real time;
    生成测试报告的步骤包括:在侦测的SyncE 1588时钟的时钟状态历经预热状态、自由运行状态、快捕状态以及锁定状态后,生成测试成功的测试报告。The step of generating a test report includes: generating a test report of successful test after the detected clock state of the SyncE 1588 clock has passed the warm-up state, the free running state, the fast-capture state, and the locked state.
  3. 如权利要求1所述的自动化测试方法,其中,在所述测试指令为被测试设备SyncE 1588时钟的反向跃迁测试指令时,所述基于获取到的测试用例运行所述测试脚本的步骤包括:The automated test method of claim 1, wherein when the test command is a reverse transition test command of a test device SyncE 1588 clock, the step of running the test script based on the obtained test case comprises:
    对所述被测试设备进行时钟拉偏操作;Performing a clock pull operation on the device under test;
    在检测到被测试设备的SyncE 1588时钟处于快捕状态时,关闭交换机与所述SyncE 1588时钟的链路;Turning off the link between the switch and the SyncE 1588 clock when detecting that the SyncE 1588 clock of the device under test is in a fast capture state;
    在检测到被测试设备的SyncE 1588时钟处于自由运行状态时,开启交换机与所述SyncE 1588时钟的链路;Turning on the link between the switch and the SyncE 1588 clock when detecting that the SyncE 1588 clock of the device under test is in a free running state;
    生成测试报告的步骤包括:在检测到被测试设备的SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告。 The step of generating a test report includes: generating a test report of successful test when it is detected that the SyncE 1588 clock of the device under test is in a locked state.
  4. 如权利要求1所述的自动化测试方法,其中,在所述测试指令为被测试设备SyncE 1588时钟的链路切换测试指令,且被测试设备的当前时钟源为主用链路的SyncE 1588时钟时,所述基于获取到的测试用例运行所述测试脚本的步骤包括:The automated test method according to claim 1, wherein when the test command is a link switching test command of the clock of the device under test SyncE 1588, and the current clock source of the device under test is the SyncE 1588 clock of the main link The step of running the test script based on the obtained test case includes:
    关闭所述主用链路,并开启交换机与所述SyncE 1588时钟的备用链路;Closing the primary link and enabling a backup link between the switch and the SyncE 1588 clock;
    在检测到被测试设备的当前时钟源为备用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,关闭所述备用链路,并开启所述主用链路;After detecting that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in the locked state, the standby link is closed, and the primary link is turned on;
    生成测试报告的步骤包括:在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且所述SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告。The step of generating a test report includes: generating a test report of successful test when the SyncE 1588 clock of the current clock source of the device under test is detected as the active link and the SyncE 1588 clock is in the locked state.
  5. 如权利要求1所述的自动化测试方法,其中,在所述测试指令为被测试设备SyncE 1588时钟的时钟切换测试指令,且被测试设备的当前时钟源为主用链路的SyncE 1588时钟时,所述基于获取到的测试用例运行所述测试脚本的步骤包括:The automated test method according to claim 1, wherein when the test command is a clock switching test command of the clock of the device under test SyncE 1588, and the current clock source of the device under test is the SyncE 1588 clock of the main link, The step of running the test script based on the obtained test case includes:
    开启交换机与全球导航卫星系统GNSS时钟的链路;Open the link between the switch and the GNSS clock of the Global Navigation Satellite System;
    在检测到被测试设备的当前时钟源为GNSS时钟,且GNSS时钟处于锁定状态时,将GNSS时钟状态设置为伪正常状态,并开启交换机与所述SyncE 1588时钟的备用链路;After detecting that the current clock source of the device under test is a GNSS clock, and the GNSS clock is in a locked state, setting the GNSS clock state to a pseudo normal state, and enabling the backup link of the switch and the SyncE 1588 clock;
    在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,将GNSS时钟状态从伪正常状态恢复为正常状态,并关闭所述主用链路;After detecting the SyncE 1588 clock of the current clock source of the device under test as the primary link, and the SyncE 1588 clock is in the locked state, the GNSS clock state is restored from the pseudo normal state to the normal state, and the primary link is closed. ;
    在检测到被测试设备的当前时钟源为备用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,关闭所述备用链路;After detecting that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in the locked state, the standby link is closed;
    在检测到被测试设备的当前时钟源为GNSS时钟,且GNSS时钟处于 锁定状态时,关闭交换机与GNSS时钟的链路并开启主用链路;After detecting that the current clock source of the device under test is the GNSS clock, and the GNSS clock is When the state is locked, the link between the switch and the GNSS clock is closed and the active link is enabled.
    生成测试报告的步骤包括:在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告。The step of generating a test report includes: generating a test report of successful test when the SyncE 1588 clock of the current clock source of the device under test is detected as the primary link and the SyncE 1588 clock is locked.
  6. 一种自动化测试装置,所述自动化测试装置包括:An automated test device, the automated test device comprising:
    获取模块,设置为在接收到用户发送的测试指令时,获取所述测试指令对应的同步以太网SyncE 1588时钟的测试用例及测试脚本,其中,所述测试用例包括被测试设备的当前时钟源为SyncE 1588时钟,且SyncE1588时钟处于锁定状态;The obtaining module is configured to obtain a test case and a test script of the synchronous Ethernet SyncE 1588 clock corresponding to the test command when receiving the test command sent by the user, where the test case includes the current clock source of the device under test is SyncE 1588 clock, and the SyncE1588 clock is locked;
    运行模块,设置为基于获取到的测试用例运行所述测试脚本;Running a module, configured to run the test script based on the obtained test case;
    生成模块,设置为在所述测试脚本运行完成时,生成测试报告。A generation module is configured to generate a test report when the test script runs.
  7. 如权利要求6所述的自动化测试装置,其中,在所述测试指令为被测试设备SyncE 1588时钟的正向跃迁测试指令时,所述运行模块包括:The automated test apparatus of claim 6, wherein when the test command is a forward transition test command of a clock of the device under test SyncE 1588, the run module includes:
    控制单元,设置为控制所述被测试设备重启;a control unit, configured to control the device to be tested to restart;
    侦测单元,设置为在所述被测试设备重启过程中,实时侦测所述SyncE1588时钟的运行状态;The detecting unit is configured to detect the running state of the SyncE1588 clock in real time during the restart of the device under test;
    所述生成模块还设置为在侦测的SyncE 1588时钟的时钟状态历经预热状态、自由运行状态、快捕状态以及锁定状态后,生成测试成功的测试报告。The generating module is further configured to generate a test report of successful testing after the detected clock state of the SyncE 1588 clock passes through the warm-up state, the free running state, the fast-capture state, and the locked state.
  8. 如权利要求6所述的自动化测试装置,其中,在所述测试指令为被测试设备SyncE 1588时钟的反向跃迁测试指令时,所述运行模块包括:The automated test apparatus of claim 6, wherein when the test command is a reverse transition test command of a clock of the device under test SyncE 1588, the run module includes:
    时钟拉偏单元,设置为对所述被测试设备进行时钟拉偏操作;a clock pull unit configured to perform a clock pull operation on the device under test;
    链路关闭单元,设置为在检测到被测试设备的SyncE 1588时钟处于快捕状态时,关闭交换机与所述SyncE 1588时钟的链路;a link down unit, configured to: close the switch and the SyncE 1588 clock link when detecting that the SyncE 1588 clock of the device under test is in a fast capture state;
    链路开启单元,设置为在检测到被测试设备的SyncE 1588时钟处于 自由运行状态时,开启交换机与所述SyncE 1588时钟的链路;The link open unit is set to detect that the SyncE 1588 clock of the device under test is In the free running state, the link between the switch and the SyncE 1588 clock is turned on;
    所述生成模块还设置为在检测到被测试设备的SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告。The generating module is further configured to generate a test report that the test is successful when detecting that the SyncE 1588 clock of the device under test is in a locked state.
  9. 如权利要求6所述的自动化测试装置,其中,在所述测试指令为被测试设备SyncE 1588时钟的链路切换测试指令,且被测试设备的当前时钟源为主用链路的SyncE 1588时钟时,所述运行模块包括:The automated test apparatus according to claim 6, wherein when the test command is a link switching test command of the clock of the device under test SyncE 1588, and the current clock source of the device under test is the SyncE 1588 clock of the main link The running module includes:
    主用链路关闭单元,设置为关闭所述主用链路,并开启交换机与所述SyncE 1588时钟的备用链路;The primary link closing unit is configured to close the primary link and enable a backup link between the switch and the SyncE 1588 clock;
    第一备用链路关闭单元,用于在检测到被测试设备的当前时钟源为备用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,关闭所述备用链路,并开启所述主用链路;a first standby link closing unit, configured to: when detecting that the current clock source of the device under test is the SyncE 1588 clock of the standby link, and the SyncE 1588 clock is in the locked state, shutting down the standby link, and turning on the main Use link
    所述生成模块还设置为在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且所述SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告。The generating module is further configured to generate a test report of successful testing when the SyncE 1588 clock of the current clock source of the device under test is detected as the primary link and the SyncE 1588 clock is in the locked state.
  10. 如权利要求6所述的自动化测试装置,其中,在所述测试指令为被测试设备SyncE 1588时钟的时钟切换测试指令,且被测试设备的当前时钟源为主用链路的SyncE 1588时钟时,所述运行模块包括:The automated test apparatus according to claim 6, wherein when the test command is a clock switching test command of the clock of the device under test SyncE 1588, and the current clock source of the device under test is the SyncE 1588 clock of the main link, The running module includes:
    GNSS时钟链路开启单元,设置为开启交换机与全球导航卫星系统GNSS时钟的链路;a GNSS clock link open unit, configured to enable a link between the switch and the GNSS clock of the global navigation satellite system;
    设置单元,设置为在检测到被测试设备的当前时钟源为GNSS时钟,且GNSS时钟处于锁定状态时,将GNSS时钟状态设置为伪正常状态,并开启交换机与所述SyncE 1588时钟的备用链路;a setting unit configured to: when detecting that the current clock source of the device under test is a GNSS clock, and the GNSS clock is in a locked state, setting the GNSS clock state to a pseudo normal state, and enabling the backup link of the switch and the SyncE 1588 clock ;
    恢复单元,设置为在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,将GNSS时钟状态从伪正常状态恢复为正常状态,并关闭所述主用链路;The recovery unit is configured to restore the GNSS clock state from the pseudo normal state to the normal state when the SyncE 1588 clock of the current clock source of the device under test is detected as the active link, and the SyncE 1588 clock is in the locked state, and close the Said primary link;
    第二备用链路关闭单元,设置为在检测到被测试设备的当前时钟源为 备用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,关闭所述备用链路;a second standby link shutdown unit, configured to detect that the current clock source of the device under test is When the SyncE 1588 clock of the standby link is in the locked state, the standby link is closed;
    GNSS时钟链路关闭单元,设置为在检测到被测试设备的当前时钟源为GNSS时钟,且GNSS时钟处于锁定状态时,关闭交换机与GNSS时钟的链路并开启主用链路;The GNSS clock link closing unit is configured to: when detecting that the current clock source of the device under test is a GNSS clock, and the GNSS clock is in a locked state, close the link between the switch and the GNSS clock and enable the active link;
    所述生成模块还设置为在检测到被测试设备的当前时钟源为主用链路的SyncE 1588时钟,且SyncE 1588时钟处于锁定状态时,生成测试成功的测试报告。 The generating module is further configured to generate a test report that the test is successful when the SyncE 1588 clock of the current clock source of the device under test is detected as the active link and the SyncE 1588 clock is in the locked state.
PCT/CN2016/098831 2015-12-25 2016-09-13 Method and device for automated testing WO2017107582A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510998432.0A CN106921535A (en) 2015-12-25 2015-12-25 Automated testing method and device
CN201510998432.0 2015-12-25

Publications (1)

Publication Number Publication Date
WO2017107582A1 true WO2017107582A1 (en) 2017-06-29

Family

ID=59088929

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/098831 WO2017107582A1 (en) 2015-12-25 2016-09-13 Method and device for automated testing

Country Status (2)

Country Link
CN (1) CN106921535A (en)
WO (1) WO2017107582A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111999707A (en) * 2020-08-19 2020-11-27 无锡威孚高科技集团股份有限公司 Automatic testing method, device and system for millimeter wave radar

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110248374B (en) * 2019-06-28 2022-05-03 京信网络系统股份有限公司 Clock synchronization test system, method, device and storage medium of base station
CN110912764A (en) * 2019-08-01 2020-03-24 中国第一汽车股份有限公司 Test method, system, equipment and storage medium
CN111833351A (en) * 2020-09-11 2020-10-27 湖北公众信息产业有限责任公司 Traffic video monitoring management control system based on image data processing

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1940584A (en) * 2005-09-27 2007-04-04 国际商业机器公司 Information handling system capable of detecting frequency lock and method thereof
WO2010021131A1 (en) * 2008-08-19 2010-02-25 株式会社アドバンテスト Test device and testing method
CN102546303A (en) * 2012-01-18 2012-07-04 瑞斯康达科技发展股份有限公司 System and method for testing clock capability of SDH (synchronous digital hierarchy) device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1940584A (en) * 2005-09-27 2007-04-04 国际商业机器公司 Information handling system capable of detecting frequency lock and method thereof
WO2010021131A1 (en) * 2008-08-19 2010-02-25 株式会社アドバンテスト Test device and testing method
CN102546303A (en) * 2012-01-18 2012-07-04 瑞斯康达科技发展股份有限公司 System and method for testing clock capability of SDH (synchronous digital hierarchy) device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111999707A (en) * 2020-08-19 2020-11-27 无锡威孚高科技集团股份有限公司 Automatic testing method, device and system for millimeter wave radar

Also Published As

Publication number Publication date
CN106921535A (en) 2017-07-04

Similar Documents

Publication Publication Date Title
WO2017107582A1 (en) Method and device for automated testing
CN113064747A (en) Fault positioning method, system and device in server starting process
US9372781B2 (en) Program subset execution and debug
CN107463455B (en) Method and device for detecting memory fault
KR101949115B1 (en) Self-diagnosis and automatic diagnostic data collection of device driver detection errors
CN109032838B (en) Automatic verification method for consistency of backup and recovery data of virtual machine
WO2018006702A1 (en) Abnormality processing method, apparatus and system in automation test
CN107818029B (en) Automatic test method for cloud hard disk data recovery consistency
CN104572422A (en) Memory monitoring achievement method based on startup and shutdown of Linux system
CN104866418A (en) Automatic testing method and system
US8117430B2 (en) Boot test system and method thereof
CN111949551A (en) Application program testing method, device, equipment and storage medium
CN112380062A (en) Method and system for rapidly recovering system for multiple times based on system backup point
KR101947487B1 (en) monitoring control device for automatic data recovery
US20140033179A1 (en) Application testing
US20130138939A1 (en) Method for processing booting errors
US20160266961A1 (en) Trace capture of successfully completed transactions for trace debugging of failed transactions
CN112255563A (en) Uninterruptible power supply testing method, device, system, equipment and storage medium
CN116032735A (en) Method, device, equipment and medium for determining abnormal information of switch
WO2019061776A1 (en) Unmanned aerial vehicle test method and apparatus
CN110134558B (en) Method and device for detecting server
WO2016201997A1 (en) Automatic testing method, device and system
CN109407648B (en) Method and system for removing fault in power-on process and computer readable storage medium
CN101826039B (en) System setting recovery method and computer system
JP2007233667A (en) Method of detecting fault

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16877393

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16877393

Country of ref document: EP

Kind code of ref document: A1