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.

539 lines
18 KiB

  1. rem Name : Drt.cmd
  2. rem Author: Sabina Sutkovic
  3. rem Date : 9-1-00
  4. rem This script runs perfval,pdhstress,ctrtest,pdhtest
  5. rem pdhtest,runet,pdhsql or drt test.
  6. if exist perfval.txt del perfval.txt
  7. if exist pdhtest.txt del pdhtest.txt
  8. @echo off
  9. @setlocal
  10. if (%1)==(skip) goto TEST
  11. if (%1)==(perfval) goto PATH
  12. if (%1)==(pdhstress) goto PATH
  13. if (%1)==(ctrtest) goto PATH
  14. if (%1)==(pdhtest) goto PATH
  15. if (%1)==(runet) goto PATH
  16. if (%1)==(pdhsql) goto PATH
  17. if (%1)==(drt) goto PATH
  18. if (%1)==(alltests) goto PATH
  19. if (%1)==() (
  20. goto PATH
  21. ) else (
  22. goto COPY_FILES
  23. )
  24. :PATH
  25. echo __________________________________________________
  26. echo You have not specified the path where you want all
  27. echo the files nessaccary for the tests to be copied.
  28. echo For exmp: runtests C:\dir\dir
  29. echo __________________________________________________
  30. goto :EOF
  31. :COPY_FILES
  32. set testbin=%1
  33. if not exist %testbin% md %testbin%
  34. cd \d %testbin%
  35. copy /y \\wolfcub\wmi\bin %testbin%
  36. copy /y \\popcorn\public\johnfu\et-old %testbin%
  37. echo ____________________________________________________________
  38. echo To run the script runtests.cmd without downloading files
  39. echo type skip as the 1st parameter next time. The files for the
  40. echo tests must be at the location from which you run the script.
  41. echo ____________________________________________________________
  42. :TEST
  43. if (%2)==(perfval) goto PERFVAL
  44. if (%2)==(pdhstress) goto PDHSTRESS
  45. if (%2)==(ctrtest) goto CTRTEST
  46. if (%2)==(pdhtest) goto PDHTEST
  47. if (%2)==(runet) goto RUNET
  48. if (%2)==(pdhsql) goto PDHSQL
  49. if (%2)==(drt) goto DRT
  50. if (%2)==() goto DEFAULT
  51. if (%2)==(alltests) goto DEFAULT
  52. if not (%2)==(perfval) goto ERROR
  53. if not (%2)==(pdhstress) goto ERROR
  54. if not (%2)==(ctrtest) goto ERROR
  55. if not (%2)==(pdhtest) goto ERROR
  56. if not (%2)==(runet) goto ERROR
  57. if not (%2)==(pdhsql) goto ERROR
  58. if not (%2)==(drt) goto ERROR
  59. if not (%2)==() goto ERROR
  60. if not (%2)==(alltests) goto ERROR
  61. :ERROR
  62. echo ____________________________________________________________
  63. echo Error in typing. To run specific test you have to type one
  64. echo of the test names such as: perfval,pdhstress,ctrtest,pdhtest
  65. echo runet,pdhsql or drt as your second parameter.
  66. echo To run all the tests the second parameter must be left blank
  67. echo or type alltests.
  68. echo ____________________________________________________________
  69. goto :EOF
  70. :PERFVAL
  71. echo =================================================================
  72. echo PERFVAL is a validation test which tests the system configuration
  73. echo for consistency and then performs a simple test on each of the
  74. echo installed performance counters to make sure they operate,
  75. echo at least at a simple level. It doesn't perform stress testing on
  76. echo the performance counters or the performance registry.
  77. echo =================================================================
  78. perfval.exe > perfval.txt
  79. for /F "delims=,tokens=1-2" %%I in ('findstr RESULT: perfval.txt') do set result=%%I
  80. for /F "delims=,tokens=4" %%I in ('findstr /C:"PASS RATE:" perfval.txt') do set rate=%%I
  81. for /F "tokens=3" %%I in ('findstr /C:"END TIME: " perfval.txt') do set date=%%I
  82. for /F "tokens=4-6" %%I in ('findstr /C:"END TIME: " perfval.txt') do set time=%%I
  83. echo ********************************************
  84. echo * PERFVAL TEST RESULTS
  85. echo *%rate%
  86. echo *%result%
  87. echo * END TIME: %date% %time%
  88. echo ********************************************
  89. echo.
  90. goto :EOF
  91. :PDHSTRESS
  92. echo.
  93. echo ==========================================================
  94. echo Pdhstress is a test designed to excercises the pdh APIs by
  95. echo checking boundring conditions, invalid arguments and etc.
  96. echo ==========================================================
  97. pdhstress.exe
  98. echo *****************************
  99. echo * PDHSTRESS TEST SUCCESSFUL *
  100. echo *****************************
  101. echo.
  102. goto :EOF
  103. :CTRTEST
  104. echo.
  105. echo ===========================================================
  106. echo CTRTEST is a test program designed to allow the Extensible
  107. echo Performance Counter developer to test their performance DLL
  108. echo in an isolated scenario.
  109. echo ===========================================================
  110. echo.
  111. ctrtest.exe
  112. echo ***************************
  113. echo * CTRTEST TEST SUCCESSFUL *
  114. echo ***************************
  115. echo.
  116. goto :EOF
  117. :PDHTEST
  118. echo.
  119. echo ====================================================================
  120. echo Pdhtest is more like a regression test. PDHTEST calls the API's with
  121. echo different parameters to test for valid/invalid parameters, boundary
  122. echo condition's and exceptions. PDHTEST performs functional tests on the
  123. echo API's to ensure that they are working correctly.
  124. echo ====================================================================
  125. echo.
  126. pdhtest.exe>pdhtest.txt
  127. for /F "delims=,tokens=3-8" %%I in ('findstr "PASS RATE:" pdhtest.txt') do set rt=%%I
  128. for /F "delims=,tokens=3" %%L in ('findstr /C:"RESULT: " pdhtest.txt') do set resultpdh=%%L
  129. for /F "tokens=2-3" %%J in ('findstr /C:"TIME:" pdhtest.txt') do set tdata=%%J
  130. for /F "tokens=3" %%I in ('findstr /C:"TIME: " pdhtest.txt') do set t=%%I
  131. echo ********************************************
  132. echo * PDHTEST TEST RESULTS
  133. echo *%rt%
  134. echo *%resultpdh%
  135. echo * TIME: %tdata% %t%
  136. echo ********************************************
  137. echo.
  138. goto :EOF
  139. :RUNET
  140. echo.
  141. echo ======================================
  142. echo Runet is a test designed to trace APIs
  143. echo ======================================
  144. echo.
  145. runet.cmd>runet.txt
  146. for /F "tokens=4" %%I in ('findstr Pass runet.txt') do set pass=%%I
  147. for /F "tokens=4" %%I in ('findstr Fail runet.txt') do set fail=%%I
  148. for /F "tokens=4" %%I in ('findstr Abort runet.txt') do set abort=%%I
  149. echo %pass% %fail% %abort%
  150. echo ***************************
  151. echo * RUNET TEST RESULTS
  152. echo * Pass = %pass%
  153. echo * Fail = %fail%
  154. echo * Abort = %abort%
  155. echo ***************************
  156. goto :EOF
  157. :PDHSQL
  158. echo.
  159. echo ====================================================================
  160. echo Pdhsql is a test program designed to do sanity check and stress
  161. echo the APIs that log perfmon counters to SQL. APIs covered are:
  162. echo PdhCreateSQLTables, PdhVerifySQLDB,PdhEnumlogsetNames,
  163. echo PdhEnumObjectItems,PdhEnumObjects,PdhSetLogsetRunID,PdhGetLogSetGUID.
  164. echo =====================================================================
  165. pdhsql.exe -S:pdh-black8b -U:sa -P: -vc:2
  166. echo **************************
  167. echo * PDHSQL TEST SUCCESSFUL *
  168. echo **************************
  169. echo.
  170. goto :EOF
  171. :DRT
  172. echo.
  173. echo =======================================================
  174. echo DRT test is test containing three scripts.
  175. echo RUNTRACECALL.CMD script f. tests event tracing.
  176. echo RUNDUMPCALL.CMD script f. tests event tracing consumer.
  177. echo RUNUMTEST.CMD script f. tests UM event tracing.
  178. echo =======================================================
  179. call drt
  180. echo ****************************
  181. echo * RESULTS OF THE DRT TESTS *
  182. echo ****************************
  183. echo ================
  184. echo RUNTRACECALL.CMD
  185. echo ================
  186. if not exist st.txt (
  187. sline=0
  188. @echo ====================================
  189. @echo Sorry all of the tests have Failed.
  190. ) else (
  191. wc st.txt>linecount.txt
  192. for /F "tokens=1" %%I in (linecount.txt) do set sline=%%I
  193. )
  194. if not exist ft.txt (
  195. set fline=0
  196. echo ================================================
  197. echo Congratulation all of the tests are Successful.
  198. ) else (
  199. wc ft.txt>linecount.txt
  200. for /F "tokens=1" %%I in (linecount.txt) do set fline=%%I
  201. )
  202. echo ===========================
  203. echo %sline% Successful tests.
  204. echo %fline% Failed tests.
  205. echo ===========================
  206. echo.
  207. echo ===============
  208. echo RUNDUMPCALL.CMD
  209. echo ===============
  210. if not exist STD.txt (
  211. sline=0
  212. echo ====================================
  213. echo Sorry all of the tests have Failed.
  214. ) else (
  215. wc STD.txt>lcount.txt
  216. for /F "tokens=1" %%I in (lcount.txt) do set sline=%%I
  217. )
  218. if not exist FTD.txt (
  219. set fline=0
  220. echo ================================================
  221. echo Congratulation all of the tests are Successful.
  222. ) else (
  223. wc FTD.txt>lcount.txt
  224. for /F "tokens=1" %%I in (linecount.txt) do set fline=%%I
  225. )
  226. echo ===========================
  227. echo %sline% Successful tests.
  228. echo %fline% Failed tests.
  229. echo ===========================
  230. echo.
  231. echo ===============
  232. echo RUNDUMPTEST.CMD
  233. echo ===============
  234. if not exist RMST.txt(
  235. sline=0
  236. @echo ====================================
  237. @echo Sorry all of the tests have Failed.
  238. ) else (
  239. wc RMST.txt>linecount.txt
  240. for /F "tokens=1" %%I in (linecount.txt) do set sline=%%I
  241. )
  242. if not exist RMFT.txt (
  243. set fline=0
  244. @echo ================================================
  245. @echo Congratulation all of the tests are Successful.
  246. ) else (
  247. wc RMFT.txt>linecount.txt
  248. for /F "tokens=1" %%I in (linecount.txt) do set fline=%%I
  249. )
  250. @echo ===========================
  251. @echo %sline% Successful tests.
  252. @echo %fline% Failed tests.
  253. @echo ===========================
  254. goto :EOF
  255. :DEFAULT
  256. echo ______________________________________________
  257. echo By default all the tests will run.
  258. echo However,if you wish to specifie certain test
  259. echo next time. Your second parameter has to be the
  260. echo name of the test.
  261. echo ______________________________________________
  262. :PERFVAL
  263. echo PERFVAL is a validation test which tests the system configuration
  264. echo for consistency and then performs a simple test on each of the
  265. echo installed performance counters to make sure they operate,
  266. echo at least at a simple level. It doesn't perform stress testing on
  267. echo the performance counters or the performance registry.
  268. echo =================================================================
  269. perfval.exe > perfval.txt
  270. for /F "delims=,tokens=1-2" %%I in ('findstr RESULT: perfval.txt') do set result=%%I
  271. for /F "delims=,tokens=4" %%I in ('findstr /C:"PASS RATE:" perfval.txt') do set rate=%%I
  272. for /F "delims=,tokens=2-6" %%I in ('findstr /C:"END TIME: " perfval.txt') do set time=%%I
  273. echo ********************************************
  274. echo * PERFVAL TEST RESULTS
  275. echo *%rate%
  276. echo *%result%
  277. echo * END TIME: %time%
  278. echo ********************************************
  279. echo.
  280. :PDHSTRESS
  281. echo.
  282. echo =============================================================
  283. echo PDHSTRESS is a test designed to stresses the set of PDH API's
  284. echo by repeatedly calling the API's with valid parameters only.
  285. echo =============================================================
  286. pdhstress.exe
  287. echo *****************************
  288. echo * PDHSTRESS TEST SUCCESSFUL *
  289. echo *****************************
  290. echo.
  291. :CTRTEST
  292. echo.
  293. echo ===========================================================
  294. echo CTRTEST is a test program designed to allow the Extensible
  295. echo Performance Counter developer to test their performance DLL
  296. echo in an isolated scenario.
  297. echo ===========================================================
  298. echo.
  299. ctrtest.exe
  300. echo ***************************
  301. echo * CTRTEST TEST SUCCESSFUL *
  302. echo ***************************
  303. echo.
  304. echo.
  305. echo ====================================================================
  306. echo Pdhtest is more like a regression test. PDHTEST calls the API's with
  307. echo different parameters to test for valid/invalid parameters, boundary
  308. echo condition's and exceptions. PDHTEST performs functional tests on the
  309. echo API's to ensure that they are working correctly.
  310. echo ====================================================================
  311. echo.
  312. pdhtest.exe>pdhtest.txt
  313. for /F "delims=,tokens=3-8" %%I in ('findstr "PASS RATE:" pdhtest.txt') do set rt=%%I
  314. for /F "delims=,tokens=3" %%L in ('findstr /C:"RESULT: " pdhtest.txt') do set resultpdh=%%L
  315. for /F "tokens=2-3" %%J in ('findstr /C:"TIME:" pdhtest.txt') do set tdata=%%J
  316. for /F "tokens=3" %%I in ('findstr /C:"TIME: " pdhtest.txt') do set t=%%I
  317. echo ********************************************
  318. echo * PDHTEST TEST RESULTS
  319. echo *%rt%
  320. echo *%resultpdh%
  321. echo * TIME: %tdata% %t%
  322. echo ********************************************
  323. echo.
  324. :RUNET
  325. echo.
  326. echo ======================================
  327. echo Runet is a test designed to trace APIs
  328. echo ======================================
  329. echo.
  330. runet.cmd>runet.txt
  331. for /F "tokens=4" %%I in ('findstr Pass runet.txt') do set pass=%%I
  332. for /F "tokens=4" %%I in ('findstr Fail runet.txt') do set fail=%%I
  333. for /F "tokens=4" %%I in ('findstr Abort runet.txt') do set abort=%%I
  334. echo %pass% %fail% %abort%
  335. echo ***************************
  336. echo * RUNET TEST RESULTS
  337. echo * Pass = %pass%
  338. echo * Fail = %fail%
  339. echo * Abort = %abort%
  340. echo ***************************
  341. :PDHSQL
  342. echo.
  343. echo =========================================================================
  344. echo Pdhsql is a test program designed to do sanity check and stress
  345. echo the APIs that log perfmon counters to SQL. APIs covered are:
  346. echo PdhCreateSQLTables, PdhVerifySQLDB,PdhEnumlogsetNames,PdhEnumObjectItems,
  347. echo PdhEnumObjects, PdhSetLogsetRunID,PdhGetLogSetGUID.
  348. echo =========================================================================
  349. pdhsql.exe -S:pdh-black8b -U:sa -P: -vc:2
  350. echo **************************
  351. echo * PDHSQL TEST SUCCESSFUL *
  352. echo **************************
  353. echo.
  354. :DRT
  355. echo.
  356. echo =========================================================
  357. echo DRT test is test containing three scripts.
  358. echo RUNTRACECALL.CMD script file tests event tracing.
  359. echo RUNDUMPCALL.CMD script file tests event tracing consumer.
  360. echo RUNUMTEST.CMD script file tests UM event tracing.
  361. echo =========================================================
  362. call drt
  363. :RUNET
  364. echo.
  365. echo ======================================
  366. echo Runet is a test designed to trace APIs
  367. echo ======================================
  368. echo.
  369. runet.cmd>runet.txt
  370. echo.
  371. echo ___________________________________________
  372. echo The result of RUNET test is above this line
  373. echo ___________________________________________
  374. echo .
  375. echo ________________________________________
  376. echo ****************************************
  377. echo The results of the rest of the test are:
  378. echo ****************************************
  379. echo ________________________________________
  380. echo.
  381. echo *****************
  382. echo * THE DRT TESTS *
  383. echo *****************
  384. echo ================
  385. echo RUNTRACECALL.CMD
  386. echo ================
  387. if not exist st.txt (
  388. sline=0
  389. @echo ====================================
  390. @echo Sorry all of the tests have Failed.
  391. ) else (
  392. wc st.txt>linecount.txt
  393. for /F "tokens=1" %%I in (linecount.txt) do set sline=%%I
  394. )
  395. if not exist ft.txt (
  396. set fline=0
  397. echo ================================================
  398. echo Congratulation all of the tests are Successful.
  399. ) else (
  400. wc ft.txt>linecount.txt
  401. for /F "tokens=1" %%I in (linecount.txt) do set fline=%%I
  402. )
  403. echo ===========================
  404. echo %sline% Successful tests.
  405. echo %fline% Failed tests.
  406. echo ===========================
  407. echo.
  408. echo ===============
  409. echo RUNDUMPCALL.CMD
  410. echo ===============
  411. if not exist STD.txt (
  412. sline=0
  413. echo ====================================
  414. echo Sorry all of the tests have Failed.
  415. ) else (
  416. wc STD.txt>lcount.txt
  417. for /F "tokens=1" %%I in (lcount.txt) do set sline=%%I
  418. )
  419. if not exist FTD.txt (
  420. set fline=0
  421. echo ================================================
  422. echo Congratulation all of the tests are Successful.
  423. ) else (
  424. wc FTD.txt>lcount.txt
  425. for /F "tokens=1" %%I in (linecount.txt) do set fline=%%I
  426. )
  427. echo ===========================
  428. echo %sline% Successful tests.
  429. echo %fline% Failed tests.
  430. echo ===========================
  431. echo.
  432. echo ===============
  433. echo RUNDUMPTEST.CMD
  434. echo ===============
  435. if not exist RMST.txt(
  436. sline=0
  437. @echo ====================================
  438. @echo Sorry all of the tests have Failed.
  439. ) else (
  440. wc RMST.txt>linecount.txt
  441. for /F "tokens=1" %%I in (linecount.txt) do set sline=%%I
  442. )
  443. if not exist RMFT.txt (
  444. set fline=0
  445. @echo ================================================
  446. @echo Congratulation all of the tests are Successful.
  447. ) else (
  448. wc RMFT.txt>linecount.txt
  449. for /F "tokens=1" %%I in (linecount.txt) do set fline=%%I
  450. )
  451. @echo ===========================
  452. @echo %sline% Successful tests.
  453. @echo %fline% Failed tests.
  454. @echo ===========================
  455. echo ********************************************
  456. echo * PERFVAL TEST RESULTS
  457. echo *%rate%
  458. echo *%result%
  459. echo * END TIME: %time%
  460. echo ********************************************
  461. echo.
  462. for /F "delims=,tokens=3-8" %%I in ('findstr "TIME: " pdhtest.txt') do set t=%%I
  463. for /F "delims=,tokens=3-8" %%I in ('findstr "PASS RATE:" pdhtest.txt') do set rt=%%I
  464. for /F "delims=,tokens=1-2" %%I in ('findstr RESULT: pdhtest.txt') do set resultpdh=%%I
  465. echo *******************************************
  466. echo * PDHTEST TEST RESULTS
  467. echo *%rt%
  468. echo *%resultpdh%
  469. echo *%t%
  470. echo ********************************************
  471. echo.
  472. echo _____________________________________________________
  473. echo If the tests didn't crash then your pdhstress,ctrtest
  474. echo pdhsql were SUCCESSFUL
  475. echo _____________________________________________________
  476. echo.
  477. echo ____________________________________________________
  478. echo If you have any questions about this script contact:
  479. echo Sabina Sutkovic alias:t-sabins or
  480. echo Jee Fung Pang alias: jeepang
  481. echo ____________________________________________________
  482. goto :EOF
  483. :EOF