Sunteți pe pagina 1din 3

:: Script for downlink testing :: This script to "handshaking" with DUT and VSA controlling software to control :: test

processing in downlink :: echo off echo to make sure this script is working properly please note that the command w indow (cmd.exe) echo has to be opened with the v-option (CMD /V:ON) echo otherwise it will not work as desired pause :: this command to enable delayed variable expansion SetLocal EnableDelayedExpansion set calling_path=%cd% :: TODO: rootpath has to changed set rootpath=Y:\users\Victor\Testing set terra_path=C:\"Program Files"\teraterm set LISTE=%calling_path%\liste_all.txt set TEST_LOG=LogFile.log set vsa_path=C:\"Documents and Settings"\midew040\Desktop\mOTAS\toplevel\Agilent set results_path="C:\workspace\VSA_DL_BB_Results" set config_path="C:\Documents and Settings\Administrator\Desktop\mOTAS\toplevel\ Agilent\Configs" set IP_port=10.0.11.246 echo IP_address=%IP_address% :: binary files status equals 1 if test case has 3 .out files, otherwise equals 0. set binaryFilesStatus=0 :: status after make scbp, 1: successful otherwise 0 set successful=0 :: set version of test cases set /p vers="set version [e.g. 322 for 3_2_2 or 240 for 2_4_0]: " if %vers% == 240 ( set versi=build_2_4_0 ) if %vers% == 322 ( set versi=build_3_2_2 ) set /p bb_or_rf="enter mode (BB or RF):" if %bb_or_rf% == BB ( set tar="Baseband testing" goto :DLUL ) if %bb_or_rf% == RF ( set tar="RF testing" goto :DLUL ) if %bb_or_rf% == bb ( set tar="Baseband testing" goto :DLUL ) if %bb_or_rf% == rf ( set tar="RF testing" goto :DLUL ) goto :ERR1

:DLUL echo %pth% for /f "tokens=1,2 delims=," %%f in (%LISTE%) do ( echo successful=!successful! set DL_test=0 if %%f == DL10 ( set DL_test=1 set pth=DL\test set config_name=DL_BB_10MHz.setx ) if %%f == DL20 ( set DL_test=1 set pth=DL\test set config_name=DL_BB_20MHz.setx ) if !DL_test! == 1 ( echo **** echo **** echo **** echo **** echo **** echo **** echo TESTCASE %%g will be prformed now echo at first relevant files will be copied to targetfolder echo sure that the make scbp1 window closed echo push button to do this .... if exist .\*.out ( del .\*.out ) ping -n 3 127.0.0.1 >NUL if exist %rootpath%\%versi%\%tar%\!pth!\%%g\*.out ( copy %rootpath%\%versi%\%tar%\!pth!\%%g\*.out . set binaryFilesStatus=1 ) else ( echo testcase files %%g not found on shared drive! echo please check if they were compiled correctly set binaryFilesStatus=0 ) echo binaryFilesStatus = !binaryFilesStatus! if !binaryFilesStatus! == 1 ( echo reset SCBP board ; press any key to continue after it has been done pause start %terra_path%\ttermpro.exe /C=5 /BAUD=115200 /M=TerraTerm_config.ttl ping -n 5 127.0.0.1 >NUL start "make scbp1" cmd.exe /c "make scbp1 >out.txt" ping -n 70 127.0.0.1 >NUL set ERRORLEVEL=0 FIND "Enabling AIF2 timer" %calling_path%/out.txt if !ERRORLEVEL! == 1 ( set successful=0 echo ERROR when make scbp ) else ( set successful=1 echo the make scbp has been finished )

echo successful=!successful! echo VSA start logging...... :VSA if !successful! == 1 ( echo start logging ... echo vsa path = %vsa_path% %vsa_path%\vsa_DL_automation\bin\Debug\vsa_DL_au tomation.exe %IP_port% %results_path%\results_%%g.txt %config_path%\!config_n ame! | FIND "PRINTED THE RESULTS" if !ERRORLEVEL! == 1 ( echo VSA software is failed echo restarting VSA goto :VSA ) else ( echo testcase has been finished echo stop logging ) ) echo close Terra term and make scbp1 window taskkill /F /IM ttermpro.exe >NUL ping -n 3 127.0.0.1 >NUL taskkill /F /IM java.exe ) else ( echo testcase has NOT been finished, echo performing the next one set successful=0 set binaryFilesStatus=0 ) ) ) pause goto :eof :ERR1 echo wrong argument : either 'BB' or 'RF' echo Enter to exit ... pause goto :eof

S-ar putea să vă placă și