123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- #!/bin/sh
-
- interval=15
- cs_out=cimserver.out
- cs_err=cimserver.err
- to_collect="$cs_out $cs_err listener.out"
- default_out=out
-
- installdir=$(dirname $0)
-
- ##
-
- cim_start() {
- cimserver "daemon=false" "forceProviderProcesses=false" \
- >$cs_out \
- 2>$cs_err \
- &
- }
-
- cim_stop() {
- killall cimserver
- }
-
- ## The Git Monitor
-
- tgm_init() {
- echo Initializing TGM
- yum -y -q install git &>/dev/null
- pushd $out
- git init
- echo The Git Monitor > README
- git add README
- git commit -qm "Initial commit"
- popd
- }
-
- tgm_add() {
- pushd $out
- git add .
- git commit -qm "Regular commit"
- popd
- }
-
- ##
-
- test_prepare() {
- true
- mkdir -p $out
- cim_start
- $installdir/subscribe.py
- tgm_init
- }
-
- test_setup() {
- true
- }
-
- test_run() {
- $installdir/trigger.sh -N -o $out -u joe
- }
-
- test_collect() {
- cp $to_collect $out
- tgm_add
- }
-
- test_teardown() {
- true
- }
-
- test_cleanup() {
- true
- cim_stop
- }
-
- ##
-
- stamp() {
- date +%Y%m%d-%H%M%S
- }
-
- handler_stop() {
- go_on=false
- }
- trap handler_stop SIGINT
-
-
- out=$default_out
- test_prepare
- go_on=true
- while $go_on;
- do
- echo new round
- echo out=$out
- test_setup
- test_run
- test_collect
- test_teardown
- echo waiting ${interval}s for next round
- sleep $interval
- done
- test_cleanup
|