PageRenderTime 55ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/usr/src/tools/tet/src/ksh/api/tcm.ksh

https://bitbucket.org/illumos/illumos-stc
Korn Shell | 733 lines | 480 code | 42 blank | 211 comment | 28 complexity | df22fbe116757cae15b024824e9b3ed6 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception
  1. #
  2. # SCCS: @(#)tcm.ksh 1.8 (03/03/31)
  3. #
  4. # UniSoft Ltd., London, England
  5. #
  6. # (C) Copyright 1996 X/Open Company Limited
  7. #
  8. # All rights reserved. No part of this source code may be reproduced,
  9. # stored in a retrieval system, or transmitted, in any form or by any
  10. # means, electronic, mechanical, photocopying, recording or otherwise,
  11. # except as stated in the end-user licence agreement, without the prior
  12. # permission of the copyright owners.
  13. # A copy of the end-user licence agreement is contained in the file
  14. # Licence which accompanies this distribution.
  15. #
  16. # X/Open and the 'X' symbol are trademarks of X/Open Company Limited in
  17. # the UK and other countries.
  18. #
  19. # ************************************************************************
  20. # Copyright 1990 Open Software Foundation (OSF)
  21. # Copyright 1990 Unix International (UI)
  22. # Copyright 1990 X/Open Company Limited (X/Open)
  23. # Copyright 1991 Hewlett-Packard Co. (HP)
  24. #
  25. # Permission to use, copy, modify, and distribute this software and its
  26. # documentation for any purpose and without fee is hereby granted, provided
  27. # that the above copyright notice appear in all copies and that both that
  28. # copyright notice and this permission notice appear in supporting
  29. # documentation, and that the name of HP, OSF, UI or X/Open not be used in
  30. # advertising or publicity pertaining to distribution of the software
  31. # without specific, written prior permission. HP, OSF, UI and X/Open make
  32. # no representations about the suitability of this software for any purpose.
  33. # It is provided "as is" without express or implied warranty.
  34. #
  35. # HP, OSF, UI and X/Open DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  36. # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  37. # EVENT SHALL HP, OSF, UI or X/Open BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  38. # CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  39. # USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  40. # OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  41. # PERFORMANCE OF THIS SOFTWARE.
  42. #
  43. # ***********************************************************************
  44. #
  45. # SCCS: @(#)tcm.ksh 1.8 03/03/31 TETware release 3.7
  46. # NAME: Shell Test Case Manager
  47. # PRODUCT: TET (Test Environment Toolkit)
  48. # AUTHOR: Andrew Dingwall, UniSoft Ltd.
  49. # DATE CREATED: 1 November 1990
  50. #
  51. # DESCRIPTION:
  52. # This file contains the support routines for the sequencing and control
  53. # of invocable components and test purposes.
  54. # It should be sourced (by means of the shell . command) into a shell
  55. # script containing definitions of the invocable components and test
  56. # purposes that may be executed, after those definitions have been made.
  57. # Test purposes may be written as shell functions or executable
  58. # shell scripts.
  59. #
  60. # This file sources tetapi.sh which contains the shell API functions.
  61. # Test purposes written as separate shell scripts must also source
  62. # tetapi.sh in order to use those functions.
  63. #
  64. # The user-supplied shell variable iclist should contain a list of all
  65. # the invocable components in the testset;
  66. # these are named ic1, ic2 ... etc.
  67. # For each invocable component thus specified, the user should define
  68. # a variable whose name is the same as that of the component.
  69. # Each such variable should contain the names of the test purposes
  70. # associated with each invocable component; for example:
  71. # iclist="ic1 ic2"
  72. # ic1="test1-1 test1-2 test1-3"
  73. # ic2="test2-1 test2-2"
  74. #
  75. # The NUMBERS of the invocable components to be executed are specified
  76. # on the command line.
  77. # In addition, the user may define the variables tet_startup and
  78. # tet_cleanup; if defined, the related functions (or shell scripts)
  79. # are executed at the start and end of processing, respectively.
  80. #
  81. # The TCM makes the NAME of the currently executing test purpose
  82. # available in the environment variable tet_thistest.
  83. #
  84. # The TCM reads configuration variables from the file specified by the
  85. # TET_CONFIG environment variable; these are placed in the environment
  86. # and marked as readonly.
  87. #
  88. # MODIFICATIONS:
  89. #
  90. # Geoff Clare, 11 Oct 1991
  91. # Replace signal lists with markers to be edited by make INSTALL.
  92. # Remove local TET_VERSION to avoid conflict with env. variable.
  93. #
  94. # Kevin Currey Friday, November 15, 1991
  95. # For HP-PA OSF/1 and Domain/OS and HP-UX
  96. # converted to ksh bindings
  97. # Thursday, December 12, 1991
  98. # enhanced tet_setsigs functionality
  99. # Wednesday, July 20, 1992
  100. # added exec to make sure tests do not grap TCM's stdin
  101. # Thursday, October 8, 1992
  102. # fixed {1-3,5-7} scenario bug
  103. #
  104. # Geoff Clare, 29 Jan 1992
  105. # Implement TET_TRAP_FUNCTION in place of tet_setsigs(), and
  106. # TET_DEFAULT_SIGS in place of tet_defaultsigs().
  107. #
  108. # Andrew Josey, UNIX System Labs. Inc. October 1993
  109. # ETET 1.10.2 Update. Add TET_NSIG_NUM to allow NSIG to
  110. # be set in the makefile. Other ETET enhancements are
  111. # in TP numbering and in journal path handling.
  112. #
  113. # Andrew Josey, UNIX System Labs. Inc. November 1993.
  114. # ETET1.10.2'. Bug fix to tet_xres handling.
  115. #
  116. # Andrew Josey, UNIX System Labs. Inc. January 1994.
  117. # ETET1.10.2 Patch level 4. Further bug fixes for
  118. # xpg3sh binding compatibility (jss@apollo.hp.com).
  119. #
  120. # Andrew Josey, Novell UNIX System Labs, February 1994
  121. # Bug fix as per xpg3sh/api. It was possible for grep -s
  122. # to produce unwanted output in some situations.
  123. # Also add support for TET_EXTENDED=T/F
  124. #
  125. # Andrew Josey, Novell UNIX System Labs, March 1994
  126. # Increment TET_VERSION to 1.10.3
  127. #
  128. # Geoff Clare, UniSoft Ltd., 3 Sept 1996
  129. # Improved (all-builtin) TP number calculations.
  130. # Only give non-existent IC message for requested IC numbers (not
  131. # for ICs executed via an "all" in the IC list).
  132. #
  133. # Andrew Dingwall, UniSoft Ltd., October 1996
  134. # Port to NT
  135. #
  136. # Andrew Dingwall, UniSoft Ltd., June 1998
  137. # Use an absolute path name for the TET_PRIVATE_TMP directory so as
  138. # to avoid problems if a TP changes directory to somewhere else.
  139. #
  140. # Andrew Dingwall, UniSoft Ltd., July 1998
  141. # Updated to support versions of ksh which interpret numbers
  142. # starting with 0 and 0x as octal and hex numbers.
  143. # Note that specifying an IC number with a leading 0 won't work
  144. # in this type of shell.
  145. #
  146. # Andrew Dingwall, UniSoft Ltd., December 1998
  147. # Work around a "feature" of ksh93 whereby use of a file
  148. # descriptor in a child shell (i.e., in a sequence of commands
  149. # enclosed in parentheses) changes the file descriptor's disposition
  150. # in the parent shell as well.
  151. # This was causing problems with "exec 3< file; read -u3 ..."
  152. # in the TCM when the test case also used fd 3.
  153. #
  154. # ***********************************************************************
  155. if let TET_XXXXX=1
  156. then unset TET_XXXXX
  157. else echo "ERROR: this is not a Korn Shell"
  158. exit 2
  159. fi
  160. #
  161. # TCM signal definitions
  162. #
  163. # The XXX_SIGNAL_LIST markers are replaced with proper lists by make INSTALL
  164. #
  165. # standard signals - may not be specified in TET_SIG_IGN and TET_SIG_LEAVE
  166. TET_STD_SIGNALS="STD_SIGNAL_LIST"
  167. # signals that are always unhandled
  168. TET_SPEC_SIGNALS="SPEC_SIGNAL_LIST"
  169. ## TET_EXTENDED
  170. if [ "$TET_EXTENDED" != "" ] ; then
  171. TET_EXTENDED=`echo $TET_EXTENDED|tr "[a-z]" "[A-Z]"|cut -c1`
  172. fi
  173. #
  174. # TCM global variables
  175. #
  176. tet_thistest=""; export tet_thistest
  177. #
  178. # "private" TCM variables
  179. #
  180. TET_CWD=`pwd`
  181. TET_OSNAME=`uname -s`; readonly TET_OSNAME; export TET_OSNAME
  182. #start ETET additions
  183. TET_HOSTNAME=`uname -n`
  184. # work out where we should put private data files -
  185. # if TET_TMP_DIR specifies a full path name, we create the private
  186. # temporary directory below there;
  187. # otherwise, we must create it in the current directory
  188. # (we perform this check because TET_TMP_DIR isn't a communication variable
  189. # and thus isn't guaranteed to be a full path name)
  190. case $TET_OSNAME in
  191. Windows_*)
  192. case "$TET_TMP_DIR" in
  193. [A-Za-z]:/*|[A-Za-z]:\\*)
  194. TET_PTMP_PATH=$TET_TMP_DIR
  195. ;;
  196. *)
  197. TET_PTMP_PATH=$TET_CWD
  198. ;;
  199. esac
  200. ;;
  201. *)
  202. case "$TET_TMP_DIR" in
  203. /*)
  204. TET_PTMP_PATH=$TET_TMP_DIR
  205. ;;
  206. *)
  207. TET_PTMP_PATH=$TET_CWD
  208. ;;
  209. esac
  210. ;;
  211. esac
  212. TET_PRIVATE_TMP=$TET_PTMP_PATH/${TET_HOSTNAME}$$; readonly TET_PRIVATE_TMP
  213. export TET_PRIVATE_TMP
  214. rm -rf $TET_PRIVATE_TMP
  215. mkdir $TET_PRIVATE_TMP
  216. if [ $? != 0 ]; then
  217. echo Cannot Make temporary directory
  218. exit 1
  219. fi
  220. TET_DELETES=$TET_PRIVATE_TMP/tet_deletes; readonly TET_DELETES; export TET_DELETES
  221. TET_RESFILE=$TET_CWD/tet_xres; readonly TET_RESFILE; export TET_RESFILE
  222. TET_STDERR=$TET_PRIVATE_TMP/tet_stderr; readonly TET_STDERR; export TET_STDERR
  223. TET_TESTS=$TET_PRIVATE_TMP/tet_tests; readonly TET_TESTS
  224. TET_TMPRES=$TET_PRIVATE_TMP/tet_tmpres; readonly TET_TMPRES; export TET_TMPRES
  225. #end ETET additions
  226. TET_BLOCK=0; export TET_BLOCK
  227. TET_CONTEXT=0; export TET_CONTEXT
  228. TET_EXITVAL=0
  229. TET_SEQUENCE=0; export TET_SEQUENCE
  230. TET_TPCOUNT=0; export TET_TPCOUNT
  231. TET_TPNUMBER=0; export TET_TPNUMBER
  232. TET_TMP1=$TET_PRIVATE_TMP/tet1.$$
  233. TET_TMP2=$TET_PRIVATE_TMP/tet2.$$
  234. # ***********************************************************************
  235. #
  236. # "private" TCM date and tr functions
  237. #
  238. # initialize $SECONDS
  239. TET_date1=`date`
  240. TET_temp=${TET_date1%??:??:??*}
  241. TET_date1=${TET_date1#$TET_temp}
  242. TET_temp=${TET_date1#??:??:??}
  243. TET_date1=${TET_date1%$TET_temp}
  244. TET_h1=${TET_date1%:??:??}
  245. TET_s1=${TET_date1#??:??:}
  246. TET_m1=${TET_date1#$TET_h1:}
  247. TET_m1=${TET_m1%:$TET_s1}
  248. let SECONDS=TET_s1+60*TET_m1+3600*TET_h1
  249. typeset -RZ2 TET_h1 TET_m1 TET_s1
  250. # update $TET_DATE using $SECONDS
  251. tet_getdate(){
  252. let TET_s1=SECONDS%60
  253. let TET_m1=SECONDS/60%60
  254. let TET_h1=SECONDS/3600%24
  255. TET_DATE=${TET_h1}:${TET_m1}:$TET_s1
  256. }
  257. #
  258. # this function emulates the command tr for simple substitutions
  259. # Usage: ksh_tr $1 $2 $3
  260. # where ksh_tr substitutes $2 for $1 in $3
  261. #
  262. tet_ksh_tr(){
  263. unset TET_out
  264. TET_in=$3
  265. TET_token=${TET_in%%$1*}
  266. while test ${#TET_token} -ne ${#TET_in}
  267. do
  268. TET_in=${TET_in##${TET_token}$1}
  269. TET_out=${TET_out}${TET_token}$2
  270. TET_token=${TET_in%%$1*}
  271. done
  272. TET_out=${TET_out}$TET_in
  273. print -R "$TET_out"
  274. }
  275. #
  276. # "private" TCM function definitions
  277. # these interfaces may go away one day
  278. #
  279. # tet_ismember - return 0 if $1 is in the set $2 ...
  280. # otherwise return 1
  281. tet_ismember(){
  282. TET_X=${1:?}
  283. shift
  284. for TET_Y in $*
  285. do
  286. if test $(( 0 + $TET_X )) -eq $TET_Y
  287. then
  288. TET_MEMBER=$TET_Y
  289. return 0
  290. fi
  291. done
  292. return 1
  293. }
  294. # tet_abandon - signal handler used during startup and cleanup
  295. tet_abandon(){
  296. TET_CAUGHTSIG=$1
  297. if test 15 -eq ${TET_CAUGHTSIG:?}
  298. then
  299. tet_sigterm $TET_CAUGHTSIG
  300. else
  301. tet_error "Abandoning testset: caught unexpected signal $TET_CAUGHTSIG"
  302. fi
  303. TET_EXITVAL=$TET_CAUGHTSIG exit
  304. }
  305. # tet_sigterm - signal handler for SIGTERM
  306. tet_sigterm(){
  307. TET_CAUGHTSIG=$1
  308. tet_error "Abandoning test case: received signal ${TET_CAUGHTSIG:?}"
  309. tet_docleanup
  310. TET_EXITVAL=$TET_CAUGHTSIG exit
  311. }
  312. # tet_sigskip - signal handler used during test execution
  313. tet_sigskip(){
  314. TET_CAUGHTSIG=$1
  315. tet_infoline "unexpected signal ${TET_CAUGHTSIG:?} received"
  316. tet_result UNRESOLVED
  317. if test 15 -eq ${TET_CAUGHTSIG:?}
  318. then
  319. tet_sigterm $TET_CAUGHTSIG
  320. else
  321. continue
  322. fi
  323. }
  324. # tet_tpend - report on a test purpose
  325. tet_tpend(){
  326. TET_TPARG1=${1:?}
  327. TET_RESULT=
  328. while read TET_NEXTRES
  329. do
  330. if test -z "$TET_RESULT"
  331. then
  332. TET_RESULT="$TET_NEXTRES"
  333. continue
  334. fi
  335. case "$TET_NEXTRES" in
  336. PASS)
  337. ;;
  338. FAIL)
  339. TET_RESULT="$TET_NEXTRES"
  340. ;;
  341. UNRESOLVED|UNINITIATED)
  342. if test FAIL != "$TET_RESULT"
  343. then
  344. TET_RESULT="$TET_NEXTRES"
  345. fi
  346. ;;
  347. NORESULT)
  348. if test FAIL != "$TET_RESULT" -a \
  349. UNRESOLVED != "$TET_RESULT" -a \
  350. UNINITIATED != "$TET_RESULT"
  351. then
  352. TET_RESULT="$TET_NEXTRES"
  353. fi
  354. ;;
  355. UNSUPPORTED|NOTINUSE|UNTESTED)
  356. if test PASS = "$TET_RESULT"
  357. then
  358. TET_RESULT="$TET_NEXTRES"
  359. fi
  360. ;;
  361. *)
  362. if test PASS = "$TET_RESULT" -o \
  363. UNSUPPORTED = "$TET_RESULT" -o \
  364. NOTINUSE = "$TET_RESULT" -o \
  365. UNTESTED = "$TET_RESULT"
  366. then
  367. TET_RESULT="$TET_NEXTRES"
  368. fi
  369. ;;
  370. esac
  371. done < $TET_TMPRES
  372. TET_RESULT=$TET_RESULT
  373. > $TET_TMPRES
  374. TET_ABORT=NO
  375. if test -z "$TET_RESULT"
  376. then
  377. TET_RESULT=NORESULT
  378. TET_RESNUM=7
  379. elif tet_getcode "$TET_RESULT" # sets TET_RESNUM, TET_ABORT
  380. then
  381. : ok
  382. else
  383. TET_RESULT="NO RESULT NAME"
  384. TET_RESNUM=-1
  385. fi
  386. tet_getdate
  387. tet_output 220 "$TET_TPARG1 $TET_RESNUM $TET_DATE" "$TET_RESULT"
  388. if test YES = "$TET_ABORT"
  389. then
  390. TET_TRAP_FUNCTION=tet_abandon
  391. tet_output 510 "" \
  392. "ABORT on result code $TET_RESNUM \"$TET_RESULT\""
  393. if test -n "$tet_cleanup"
  394. then
  395. tet_docleanup
  396. fi
  397. TET_EXITVAL=1 exit
  398. fi
  399. }
  400. # tet_docleanup - execute the tet_cleanup function
  401. tet_docleanup(){
  402. tet_thistest=
  403. TET_TPCOUNT=0
  404. TET_BLOCK=0
  405. tet_setblock
  406. eval $tet_cleanup
  407. }
  408. # ***********************************************************************
  409. # read in API functions
  410. . ${TET_ROOT:?}/lib/ksh/tetapi.ksh
  411. # ***********************************************************************
  412. #
  413. # TCM main flow
  414. #
  415. # capture command line args before they disappear
  416. TET_TCM_ARGC=$#
  417. TET_TCM_ARGS="$*"
  418. TET_PNAME="$0"; readonly TET_PNAME; export TET_PNAME
  419. # arrange to clean up on exit
  420. unset TET_TMPFILES
  421. trap 'exit 1' 1 2 3 15
  422. trap 'rm -f $TET_TMPFILES; rm -rf $TET_PRIVATE_TMP; exit $TET_EXITVAL' 0
  423. # open execution results file
  424. umask 0; rm -f $TET_RESFILE $TET_DELETES $TET_STDERR $TET_TESTS $TET_TMP1 $TET_TMPRES; > $TET_RESFILE
  425. if [ -s $TET_RESFILE ]
  426. then TET_EXITVAL=1; exit 1
  427. fi
  428. # open other local files
  429. for TET_A in $TET_DELETES $TET_STDERR $TET_TESTS \
  430. $TET_TMP1 $TET_TMPRES
  431. do
  432. TET_TMPFILES=${TET_TMPFILES}' '$TET_A
  433. > $TET_A
  434. done
  435. # read in configuration variables and make them readonly
  436. # strip comments and other non-variable assignments
  437. # protect embedded spaces and single quotes in the value part
  438. if test -n "$TET_CONFIG"
  439. then
  440. if test ! -r "$TET_CONFIG"
  441. then
  442. tet_error "can't read config file" $TET_CONFIG
  443. else
  444. while read TET_line
  445. do
  446. TET_nline=${TET_line%%\#*}
  447. if test ${#TET_nline} -ne 0
  448. then readonly "$TET_nline"
  449. fi
  450. done < $TET_CONFIG
  451. fi
  452. fi
  453. # set current context to process ID
  454. tet_setcontext
  455. # set up default results code file if so required
  456. if test ! -r ${TET_CODE:=tet_code}
  457. then
  458. if test tet_code != "$TET_CODE"
  459. then
  460. tet_error "could not open results code file" \"$TET_CODE\"
  461. fi
  462. TET_TMPFILES=${TET_TMPFILES}' '$TET_TMP2
  463. echo "
  464. 0 PASS Continue
  465. 1 FAIL Continue
  466. 2 UNRESOLVED Continue
  467. 3 NOTINUSE Continue
  468. 4 UNSUPPORTED Continue
  469. 5 UNTESTED Continue
  470. 6 UNINITIATED Continue
  471. 7 NORESULT Continue" > $TET_TMP2
  472. TET_CODE=$TET_TMP2
  473. fi
  474. # determine the full path name of the results code file
  475. case $TET_OSNAME in
  476. Windows_*)
  477. case $TET_CODE in
  478. [A-Za-z]:/*)
  479. ;;
  480. *)
  481. TET_CODE=`pwd`/$TET_CODE
  482. ;;
  483. esac
  484. ;;
  485. *)
  486. case $TET_CODE in
  487. /*)
  488. ;;
  489. *)
  490. TET_CODE=`pwd`/$TET_CODE
  491. ;;
  492. esac
  493. ;;
  494. esac
  495. readonly TET_CODE; export TET_CODE
  496. # process command-line args
  497. if test 1 -gt $TET_TCM_ARGC
  498. then
  499. TET_TCM_ARGS=all
  500. fi
  501. TET_ICLAST=-1
  502. TET_ICLIST=$(tet_ksh_tr ic "" "$iclist")
  503. : ${TET_ICLIST:=0}
  504. TET_ICLIST=$(print $TET_ICLIST)
  505. TET_ICFIRST_DEF=${TET_ICLIST%%\ *}
  506. for TET_A in $(tet_ksh_tr , " " "$TET_TCM_ARGS")
  507. do
  508. case $TET_A in
  509. all*)
  510. if test 0 -ge $TET_ICLAST
  511. then
  512. TET_ICFIRST=$TET_ICFIRST_DEF
  513. for TET_B in $TET_ICLIST
  514. do
  515. if test $TET_B -le $TET_ICFIRST
  516. then
  517. TET_ICFIRST=$TET_B
  518. fi
  519. done
  520. else
  521. let TET_ICFIRST=TET_ICLAST+1
  522. fi
  523. TET_ICLAST=$TET_ICFIRST
  524. for TET_B in $TET_ICLIST
  525. do
  526. if test $TET_B -gt $TET_ICLAST
  527. then
  528. TET_ICLAST=$TET_B
  529. fi
  530. done
  531. if test $TET_ICLAST -gt ${TET_B:=0}
  532. then
  533. TET_ICLAST=$TET_B
  534. fi
  535. ;;
  536. *)
  537. TET_ICFIRST=${TET_A%%-*}
  538. TET_ICLAST=${TET_A##*-}
  539. if [ X$TET_ICFIRST = X$TET_ICLAST ]
  540. then TET_ICLAST=
  541. fi
  542. ;;
  543. esac
  544. TET_ICNO=${TET_ICFIRST:-$TET_ICFIRST_DEF}
  545. while test $TET_ICNO -le ${TET_ICLAST:=$TET_ICNO}
  546. do
  547. if tet_ismember $TET_ICNO $TET_ICLIST
  548. then
  549. test -n "`eval echo \\${ic$TET_MEMBER}`" && \
  550. echo ic$TET_MEMBER
  551. else
  552. # only report if the IC was requested
  553. case $TET_A in
  554. all*) ;;
  555. *) tet_error "IC $TET_ICNO is not defined" \
  556. "for this test case"
  557. esac
  558. fi
  559. let TET_ICNO=TET_ICNO+1
  560. done >> $TET_TESTS
  561. done
  562. TET_ICCOUNT=0
  563. while read -r TET_line
  564. do
  565. let TET_ICCOUNT=TET_ICCOUNT+1
  566. done < $TET_TESTS
  567. # print startup message to execution results file
  568. tet_output 15 "3.7 $TET_ICCOUNT" "TCM Start"
  569. # do initial signal list processing
  570. if test $(( ${#TET_SIG_LEAVE} + ${#TET_SIG_IGN} )) -eq 0
  571. then print TET_SIG_LEAVE2=\"\\n\"\\nTET_SIG_IGN2=\"\\n\" > $TET_TMP1
  572. else for TET_A in TET_SIG_LEAVE TET_SIG_IGN
  573. do
  574. echo ${TET_A}2=\"
  575. eval TET_temp="\$$TET_A"
  576. tet_ksh_tr , "
  577. " "$TET_temp" | while read TET_B TET_JUNK
  578. do
  579. if test -z "$TET_B"
  580. then
  581. continue
  582. elif tet_ismember $TET_B $TET_STD_SIGNALS $TET_SPEC_SIGNALS
  583. then
  584. tet_error "warning: illegal entry $TET_B" \
  585. "in $TET_A ignored"
  586. else
  587. echo $TET_B
  588. fi
  589. done
  590. echo \"
  591. done > $TET_TMP1
  592. fi
  593. . $TET_TMP1
  594. TET_SIG_LEAVE2="$TET_SIG_LEAVE2 $TET_SPEC_SIGNALS"
  595. TET_A=1
  596. if [ -z "$TET_NSIG" ] ; then
  597. TET_NSIG=TET_NSIG_NUM; export TET_NSIG
  598. fi
  599. TET_TRAP_FUNCTION=tet_abandon
  600. TET_DEFAULT_SIGS=
  601. while test $TET_A -lt $TET_NSIG
  602. do
  603. if tet_ismember $TET_A $TET_SIG_LEAVE2
  604. then
  605. :
  606. elif tet_ismember $TET_A $TET_SIG_IGN2
  607. then
  608. trap "" $TET_A
  609. else
  610. trap "trap \"\" $TET_A; \$TET_TRAP_FUNCTION $TET_A" $TET_A
  611. TET_DEFAULT_SIGS="$TET_DEFAULT_SIGS $TET_A"
  612. fi
  613. let TET_A=TET_A+1
  614. done
  615. # calculate starting TP number for each IC
  616. TET_A=
  617. for TET_B in $TET_ICLIST
  618. do
  619. # TET_A holds concatenation of TP lists for all previous ICs
  620. set -- $TET_A
  621. eval TET_TP_ADDNUM_$TET_B=$#
  622. eval TET_A=\"\$TET_A \$ic$TET_B\"
  623. done
  624. # do startup processing
  625. eval $tet_startup
  626. # do main loop processing
  627. for TET_ICNAME in `cat $TET_TESTS`
  628. do
  629. eval TET_TPLIST=\"\$$TET_ICNAME\"
  630. TET_ICNUMBER=${TET_ICNAME##?[!0123456789]}
  631. let TET_TPCOUNT=0
  632. for TET_temp in $TET_TPLIST
  633. do
  634. let TET_TPCOUNT=TET_TPCOUNT+1
  635. done
  636. tet_getdate
  637. tet_output 400 "$TET_ICNUMBER $TET_TPCOUNT $TET_DATE" "IC Start"
  638. TET_TPCOUNT=0
  639. for tet_thistest in $TET_TPLIST
  640. do
  641. let TET_TPCOUNT=TET_TPCOUNT+1
  642. eval let TET_TPNUMBER=TET_TP_ADDNUM_${TET_ICNUMBER}+TET_TPCOUNT
  643. # this forces BLOCK and SEQUENCE to 1
  644. TET_CONTEXT=0
  645. tet_setcontext
  646. tet_getdate
  647. tet_output 200 "$TET_TPNUMBER $TET_DATE" "TP Start"
  648. # > $TET_TMPRES
  649. TET_REASON="`tet_reason $tet_thistest`"
  650. if test $? -eq 0
  651. then
  652. tet_infoline "$TET_REASON"
  653. tet_result UNINITIATED
  654. else
  655. TET_TRAP_FUNCTION=tet_sigskip
  656. (
  657. trap $TET_DEFAULT_SIGS
  658. unset TET_DEFAULT_SIGS
  659. "$tet_thistest"
  660. )
  661. fi
  662. tet_tpend $TET_TPNUMBER
  663. done
  664. TET_TPNUMBER=0
  665. tet_getdate
  666. tet_output 410 "$TET_ICNUMBER $TET_TPCOUNT $TET_DATE" "IC End"
  667. done
  668. # do cleanup processing
  669. TET_TRAP_FUNCTION=tet_abandon
  670. if test -n "$tet_cleanup"
  671. then
  672. tet_docleanup
  673. fi
  674. # successful exit
  675. TET_EXITVAL=0 exit