stop_start.runner 469 B

1234567891011121314151617181920212223242526272829
  1. #!/cmd/rc
  2. runner=$0
  3. test = `{echo $runner|sed 's/.runner//'}
  4. test_output = /tmp/output-`{basename $test}
  5. if ( test -e $test_output) rm $test_output
  6. $test > $test_output &
  7. testpid=$APID
  8. sleep 5
  9. if ( cat $test_output | grep 'PASS' > /dev/null ) {
  10. cat $test_output
  11. echo FAIL
  12. exit FAIL
  13. }
  14. echo start > /proc/$testpid/ctl
  15. wait $testpid
  16. if ( cat $test_output | grep 'PASS' > /dev/null ) {
  17. rm $test_output
  18. echo PASS
  19. exit PASS
  20. }
  21. cat $test_output
  22. echo FAIL
  23. exit FAIL