Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

216 lines
7.0 KiB

  1. @echo off
  2. rem
  3. rem Name : RunUM.cmd
  4. rem Author: Jen-Lung Chiu
  5. rem Date : August 5th 1999
  6. rem Revisied by: Sabina Sutkovic
  7. rem Name of revision: Runumtest.cmd
  8. rem Date : 7-31-00
  9. rem
  10. rem CMD script file tests UM event tracing.
  11. rem All the variations are very trivial and test for basic functionality.
  12. rem
  13. rem Variation 1 - single UM provider - start, query, and stop tested
  14. rem Variation 2 - three providers - intermingled start and stop tested
  15. rem Variation 3 - tests circular buffer modifications
  16. rem
  17. if exist evntrace.log del evntrace.log
  18. if exist provider.log del provider.log
  19. if exist runumST.log del runumST.log
  20. if exist runumFT.log del runumFT.log
  21. if exist RMST.log del RMST.log
  22. if exist RMFT.log del RMFT.log
  23. :VARIATION1
  24. echo ================================================
  25. echo Variation 1 - single UM provider - trivial tests
  26. echo ================================================
  27. start "Variation 1 - provider 1" tracedp.exe 100000 -guid #d58c126f-b309-11d1-969e-0000f875a5bc 50 -UseEventTraceHeader -GuidPtrMofPtr
  28. set flag=0
  29. sleep 1
  30. tracelog.exe -start du1 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -um -f du1.log>runum.log
  31. for /F "tokens=3" %%I in ('findstr Status: runum.log') do set test=%%I
  32. rem Test1
  33. set /A flag=flag+1
  34. call :SUB1 %flag% %test%
  35. sleep 5
  36. tracelog -q du1 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -um -f du1.log>runum.log
  37. for /F "tokens=3" %%I in ('findstr Status: runum.log') do set test=%%I
  38. rem Test2
  39. set /A flag=flag+1
  40. call :SUB1 %flag% %test%
  41. sleep 5
  42. tracelog -stop du1 -guid #d58c126f-b309-11d1-969e-0000f875a5bc -um -f du1.log>runum.log
  43. for /F "tokens=3" %%I in ('findstr Status: runum.log') do set test=%%I
  44. rem Test3
  45. set /A flag=flag+1
  46. call :SUB1 %flag% %test%
  47. :VARIATION2
  48. echo ==================================================================
  49. echo Variation 2 - three providers - intermingled start and stop tested
  50. echo ==================================================================
  51. start "Variation 2 - provider 2" tracedp.exe 50000 -guid #dcb8c570-2c70-11d2-90ba-00805f8a4d63 50 -UseTraceInstanceHeader -GuidPtrMofPtr
  52. start "Variation 2 - provider 3" tracedp.exe 50000 f5b6d380-2c70-11d2-90ba-00805f8a4d63 50 -UseEventTraceHeader -GuidPtrMofPtr
  53. tracelog.exe -start du2 -guid #dcb8c570-2c70-11d2-90ba-00805f8a4d63 -um -ft 2 -f du2.log>runum.log
  54. for /F "tokens=4" %%I in ('findstr Status: runum.log') do set test=%%I
  55. rem Test4
  56. set /A flag=flag+1
  57. call :SUB1 %flag% %test%
  58. start "Variation 2 - provider 4" tracedp.exe 50000 -guid #054b1ae0-2c71-11d2-90ba-00805f8a4d63 50 -UseEventTraceHeader --GuidPtrMofPtr
  59. tracelog.exe -start du3 -guid #f5b6d380-2c70-11d2-90ba-00805f8a4d63 -um -f du3.log>runum.log
  60. for /F "tokens=3" %%I in ('findstr Status: runum.log') do set test=%%I
  61. rem Test5
  62. set /A flag=flag+1
  63. call :SUB1 %flag% %test%
  64. echo List all logger sessions, should contain du2 and du3
  65. tracelog.exe -l>runum.log
  66. for /F "tokens=3" %%I in ('findstr Status: runum.log') do set test=%%I
  67. rem Test6
  68. set /A flag=flag+1
  69. call :SUB1 %flag% %test%
  70. ho Starting Logger du4 for provider 4
  71. tracelog.exe -start du4 -guid #054b1ae0-2c71-11d2-90ba-00805f8a4d63 -um -cir 1 -f du4.log>runum.log
  72. for /F "tokens=3" %%I in ('findstr Status: runum.log') do set test=%%I
  73. rem Test7
  74. set /A flag=flag+1
  75. call :SUB1 %flag% %test%
  76. echo List all logger sessions, should contain du2, du3, and du4
  77. tracelog.exe -l>runum.log
  78. for /F "tokens=3" %%I in ('findstr Status: runum.log') do set test=%%I
  79. rem Test8
  80. set /A flag=flag+1
  81. call :SUB1 %flag% %test%
  82. tracelog.exe -stop du2 -guid #dcb8c570-2c70-11d2-90ba-00805f8a4d63 -um>runum.log
  83. for /F "tokens=3" %%I in ('findstr Status: runum.log') do set test=%%I
  84. rem Test9
  85. set /A flag=flag+1
  86. call :SUB1 %flag% %test%
  87. sleep 3
  88. echo List all logger sessions, should contain du3 and du4
  89. tracelog.exe -l>runum.log
  90. for /F "tokens=3" %%I in ('findstr Status: runum.log') do set test10=%%I
  91. rem Test10
  92. set /A flag=flag+1
  93. call :SUB1 %flag% %test%
  94. tracelog.exe -stop du4 -guid #054b1ae0-2c71-11d2-90ba-00805f8a4d63 -um>runum.log
  95. for /F "tokens=3" %%I in ('findstr Status: runum.log') do set test=%%I
  96. rem Test11
  97. set /A flag=flag+1
  98. call :SUB1 %flag% %test%
  99. sleep 1
  100. tracelog.exe -stop du3 -guid #f5b6d380-2c70-11d2-90ba-00805f8a4d63 -um>runum.log
  101. for /F "tokens=3" %%I in ('findstr Status: runum.log') do set test=%%I
  102. rem Test12
  103. set /A flag=flag+1
  104. call :SUB1 %flag% %test%
  105. :VARIATION3
  106. echo ====================================================
  107. echo Variation 3 - tests UM circular buffer modifications
  108. echo ====================================================
  109. start "Variation 3 - provider 5" tracedp.exe 100000 -guid #68799948-2c7f-11d2-90bb-00805f8a4d63 10
  110. sleep 1
  111. tracelog.exe -start du5 -guid #68799948-2c7f-11d2-90bb-00805f8a4d63 -um -cir 1 -f du5.log>runum.log
  112. for /F "tokens=3" %%I in ('findstr Status: runum.log') do set test=%%I
  113. rem Test13
  114. set /A flag=flag+1
  115. call :SUB1 %flag% %test%
  116. sleep 5
  117. echo Querying logger du5...
  118. tracelog.exe -q du5 -guid #68799948-2c7f-11d2-90bb-00805f8a4d63 -um -cir 1 -f du5.log>runum.log
  119. for /F "tokens=3" %%I in ('findstr Status: runum.log') do set test=%%I
  120. rem Test14
  121. set /A flag=flag+1
  122. call :SUB1 %flag% %test%
  123. sleep 10
  124. tracelog.exe -stop du5 -guid #68799948-2c7f-11d2-90bb-00805f8a4d63 -um -cir 1 -f du5.log>runum.log
  125. for /F "tokens=3" %%I in ('findstr Status: runum.log') do set test=%%I
  126. rem Test15
  127. set /A flag=flag+1
  128. call :SUB1 %flag% %test%
  129. goto :EOF
  130. @echo ____________________________________________________
  131. @echo If you have any questions about this script contact:
  132. @echo Sabina Sutkovic alias:t-sabins or
  133. @echo Melur Raghuraman alias:mraghu
  134. @echo ____________________________________________________
  135. @echo The list of the Successful tests are dumped in RMST.txt file.
  136. @echo The list of the Failed tests are dumped in RMFT.txt file.
  137. @echo The details of Successful test are in runumST.log
  138. @echo The details of Failed tests are in runumFT.log
  139. echo.
  140. if not exist RMST.txt(
  141. sline=0
  142. @echo ====================================
  143. @echo Sorry all of the tests have Failed.
  144. ) else (
  145. wc RMST.txt>linecount.txt
  146. for /F "tokens=1" %%I in (linecount.txt) do set sline=%%I
  147. )
  148. if not exist RMFT.txt (
  149. set fline=0
  150. @echo ================================================
  151. @echo Congratulation all of the tests are Successful.
  152. ) else (
  153. wc RMFT.txt>linecount.txt
  154. for /F "tokens=1" %%I in (linecount.txt) do set fline=%%I
  155. )
  156. @echo ==========================
  157. @echo %sline% Successful tests.
  158. @echo %fline% Failed tests.
  159. @echo ==========================
  160. :Cleanup
  161. del du*.log
  162. :SUB1
  163. if %2==0L (
  164. echo.
  165. @echo TEST %1 SUCCESS >> RMST.txt
  166. echo. >>runumST.log
  167. echo. >>runumST.log
  168. @echo TEST %1 SUCCESS >> runumST.log
  169. type rundrt.log >> runumST.log
  170. @echo TEST %1 SUCCESS
  171. echo.
  172. ) else (
  173. echo.
  174. @echo TEST %1 FAILED >> RMFT.txt
  175. echo. >>runumFT.log
  176. echo. >>runumFT.log
  177. @echo TEST %1 FAILED >> runumFT.log
  178. type rundrt.log >> runumFT.log
  179. @echo TEST %1 FAILED
  180. echo.
  181. )
  182. :EOF