@echo off rem wanpipemon_tests.bat - batch file for testing rem wanpipemon Loop Back (LB) commands. rem rem The .bat file format is chosen over the .sh format, so it can be rem run by HP directly, without installing Cygwin. rem rem rem The command line is: rem wanpipemon rem clock type: master OR normal rem interface name: wanpipe?_ifX rem Example 1: rem wanpipemon master wanpipe3_if2 rem Example 2: rem wanpipemon normal wanpipe2_if2 set interface=%2% if "%1"=="normal" (set clock_mode=0) else (set clock_mode=1) echo clock_mode: %clock_mode% (%1%) echo interface: %interface% if %clock_mode%==0 goto normal_clock_test rem Example Test Setup: rem Card type: A108. rem Port wanpipe2 in Normal Clock, T1. rem Port wanpipe3 in Master Clock, T1. rem wanpipe2 is connected to wanpipe3 by a "back-to-back" cable. rem Ports are configured in TDM_VOICE_SPAN_MODE, rem channel 24 is the D-channel. rem Notes: rem When in MASTER clock, and configured in LOCAL loopback, rem the T1 line will get 'Connected' even without any cable. rem ----------------------------------------------------- rem Diagnostic Digital Loopback for LOCAL device rem ----------------------------------------------------- rem MASTER clock only rem rem allows to run both Data and BERT tests on LOCAL device. rem rem During this test the line will go into "Disconnected" rem state, it will take upto 30 seconds recover. rem This is why there is 30 seconds delay AFTER the test. call :Active_Diagnostic_Digital_Loopback_function call :voice_interface_tests call :DeActive_Diagnostic_Digital_Loopback_function call :delay_for_10_seconds call :delay_for_10_seconds call :delay_for_10_seconds rem ************************************************************ rem Commands which control LoopBack state of REMOTE device rem ************************************************************ rem MASTER clock only rem Data transmitted TO the REMOTE device willbe looped back rem to LOCAL device. rem rem For these tests line must be in "Connected" state. rem This is why there is an additional delay after the previous rem test. call :Send_Payload_Loopback_Activate_Code call :voice_interface_tests call :Send_Payload_Loopback_DeActivate_Code rem ************************************************* call :delay_for_10_seconds call :Send_Activate_Line_Loopback_Code call :voice_interface_tests call :Send_DeActivate_Line_Loopback_Code call :delay_for_10_seconds rem **************************************************************** rem End-of Commands which control LoopBack state of REMOTE device rem **************************************************************** rem &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& rem LIU LoopBack modes rem &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& call :Active_LIU_Analog_Loopback_LOCAL call :voice_interface_tests call :DeActive_LIU_Analog_Loopback_LOCAL rem &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& call :Active_LIU_Local_Loopback call :voice_interface_tests call :DeActive_LIU_Local_Loopback rem &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& rem During this test line will go into Disconnected state. rem After the test line will recover (if there is cable). call :Active_LIU_Dual_Loopback_Local_and_Remote call :voice_interface_tests call :DeActive_LIU_Dual_Loopback_Local_and_Remote goto :end rem ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ rem NORMAL clock tests rem ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :normal_clock_test echo "running NORMAL clock tests..." rem ================================================================ rem Payload LoopBack modes for LOCAL device (Framer). rem ================================================================ rem NORMAL clock only - because RX clock is looped to TX rem If done with MASTER clock, the line will go into Disconnected state rem rem Data transmitted from REMOTE device will be looped back to it. rem This LB is not intended for running Data or BERT test locally. rem Active Payload Loopback mode (T1/E1) @echo on wanpipemon -i %interface% -c Taplb @echo off call :read_lb_status_function rem Deactive Payload Loopback mode (T1/E1) @echo on wanpipemon -i %interface% -c Tdplb @echo off rem &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& rem LIU LoopBack modes rem &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& rem Active LIU Remote Loopback mode (T1/E1 DM card only) - NORMAL clock rem Data from REMOTE device will be looped back to it. rem This LB is not intended for running Data or BERT test locally. @echo on wanpipemon -i %interface% -c Talrlb @echo off call :read_lb_status_function rem Deactive LIU Remote Loopback mode (T1/E1 DM card only) - NORMAL clock @echo on wanpipemon -i %interface% -c Tdlrlb @echo off goto :end rem &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& :Active_Diagnostic_Digital_Loopback_function @echo on wanpipemon -i %interface% -c Tadlb @echo off if %errorlevel% NEQ 0 echo "Failed to Active_Diagnostic_Digital_Loopback" goto :EOF :DeActive_Diagnostic_Digital_Loopback_function @echo on wanpipemon -i %interface% -c Tddlb @echo off if %errorlevel% NEQ 0 echo "Failed to DeActive_Diagnostic_Digital_Loopback" goto :EOF rem &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& :Send_Payload_Loopback_Activate_Code @echo on wanpipemon -i %interface% -c Tsaplb @echo off if %errorlevel% NEQ 0 echo "Failed to Send_Payload_Loopback_Activate_Code" goto :EOF :Send_Payload_Loopback_DeActivate_Code @echo on wanpipemon -i %interface% -c Tsdplb @echo off if %errorlevel% NEQ 0 echo "Failed to Send_Payload_Loopback_DeActivate_Code" goto :EOF rem &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& :Send_Activate_Line_Loopback_Code @echo on wanpipemon -i %interface% -c Tsalb @echo off if %errorlevel% NEQ 0 echo "Failed to Send_Activate_Line_Loopback_Code" goto :EOF :Send_DeActivate_Line_Loopback_Code @echo on wanpipemon -i %interface% -c Tsdlb @echo off if %errorlevel% NEQ 0 echo "Failed to Send_DeActivate_Line_Loopback_Code" goto :EOF rem &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& :Active_LIU_Analog_Loopback_LOCAL @echo on wanpipemon -i %interface% -c Talalb @echo off if %errorlevel% NEQ 0 echo "Failed to Active_LIU_Analog_Loopback_LOCAL" goto :EOF :DeActive_LIU_Analog_Loopback_LOCAL @echo on wanpipemon -i %interface% -c Tdlalb @echo off if %errorlevel% NEQ 0 echo "Failed to DeActive_LIU_Analog_Loopback_LOCAL" goto :EOF rem &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& :Active_LIU_Local_Loopback @echo on wanpipemon -i %interface% -c Talllb @echo off if %errorlevel% NEQ 0 echo "Failed to Active_LIU_Local_Loopback" goto :EOF :DeActive_LIU_Local_Loopback @echo on wanpipemon -i %interface% -c Tdlllb @echo off if %errorlevel% NEQ 0 echo "Failed to DeActive_LIU_Local_Loopback" goto :EOF rem &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& :Active_LIU_Dual_Loopback_Local_and_Remote @echo on wanpipemon -i %interface% -c Taldlb @echo off if %errorlevel% NEQ 0 echo "Failed to Active_LIU_Dual_Loopback_Local_and_Remote" goto :EOF :DeActive_LIU_Dual_Loopback_Local_and_Remote @echo on wanpipemon -i %interface% -c Tdldlb @echo off if %errorlevel% NEQ 0 echo "Failed to DeActive_LIU_Dual_Loopback_Local_and_Remote" goto :EOF rem &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& rem Read Loopback status (T1/E1 cards) - LoopBack Status of LOCAL device, rem not a status of command which changed REMOTE or LOCAL LoopBack mode. :read_lb_status_function wanpipemon -i %interface% -c Tlb if %errorlevel% NEQ 0 echo "Failed to read LB status" goto :EOF :start_BERT_function wanpipemon -i %interface% -c Tbert --cmd start --ptype pseudor1 --eib none --loop none --chan all if %errorlevel% NEQ 0 echo "Failed to start BERT test" goto :EOF :stop_BERT_function wanpipemon -i %interface% -c Tbert --cmd stop --ptype pseudor1 --eib none --loop none --chan all if %errorlevel% NEQ 0 echo "Failed to stop BERT test" goto :EOF rem Send test data on HDLC channel, wait for it to come back rem and compare with what was transmitted. rem The line must be in "Connected" state for this test. :test_HDLC_data_loopback wanpipemon -i %interface% -c Tlt if %errorlevel% NEQ 0 echo "Failed HDLC data test" goto :EOF :delay_for_10_seconds echo "Waiting 10 seconds..." PING 1.1.1.1 -n 10 -w 1000 >NUL goto :EOF :check_status_of_BERT_test wanpipemon -i %interface% -c Tbert --cmd status if %errorlevel% NEQ 0 echo "Failed to read BERT status" goto :EOF :hdlc_interface_tests call :voice_interface_tests call :test_HDLC_data_loopback if %errorlevel% NEQ 0 echo "Failed HDLC interface tests" goto :EOF :voice_interface_tests call :read_lb_status_function call :start_BERT_function call :delay_for_10_seconds call :check_status_of_BERT_test call :stop_BERT_function if %errorlevel% NEQ 0 echo "Failed Voice interface tests" goto :EOF :end