diff options
Diffstat (limited to 'modules/CIAO/performance-tests/Benchmark/RoundTrip/run_test.pl')
-rwxr-xr-x | modules/CIAO/performance-tests/Benchmark/RoundTrip/run_test.pl | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/modules/CIAO/performance-tests/Benchmark/RoundTrip/run_test.pl b/modules/CIAO/performance-tests/Benchmark/RoundTrip/run_test.pl new file mode 100755 index 00000000000..0364d8b16a4 --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/RoundTrip/run_test.pl @@ -0,0 +1,123 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +# +# @@ Run this script from ../descriptors/ instead. +# + +use lib "$ENV{'ACE_ROOT'}/bin"; +use PerlACE::TestTarget; + +$status = 0; + +$daemon_base = "daemon.ior"; +$svr_base = "server.ior"; +$home_base = "test.ior"; + +$tg = PerlACE::TestTarget::create_target (1) || die "Create target for ns failed\n"; + +$daemon_ior = $tg->LocalFile ($daemon_base); +$svr_ior = $tg->LocalFile ($svr_base); +$home_ior = $tg->LocalFile ($home_base); + +$CIAO_ROOT=$ENV{'CIAO_ROOT'}; + +$tg->DeleteFile ($daemon_base); +$tg->DeleteFile ($svr_base); +$tg->DeleteFile ($home_base); + +# CIAO Daemon command line arguments +$daemon_args = "-c ../RoundTrip/svc.conf -o $daemon_ior -i CIAO_Installation_Data.ini -n $CIAO_ROOT/tools/ComponentServer/ComponentServer"; + +# CIAO Daemon Controller location: +$controller = "$CIAO_ROOT/tools/Daemon/DaemonController"; + +# Daemon controller common command line arguments +$common_args = "-ORBInitRef CIAODaemon=file://$daemon_ior"; + +# Daemon controller start_home command +$start_args = "start_home -s RoundTrip.csd -m $home_ior -c $svr_ior"; + +# Daemon controller end_home command +$end_args = "end_home -c file://$svr_ior"; + +# Daemon controller shutdown command +$shutdown_args = "shutdown"; + +# Client program command line arguments +$cl_args = "-ORBSvcConf ../RoundTrip/svc.conf -i 300000"; + +# CIAO daemon process definition +$DS = $tg->CreateProcess ("$CIAO_ROOT/tools/Daemon/CIAO_Daemon", + "$daemon_args"); + +# Client process definition +$CL = $tg->CreateProcess ("../RoundTrip/client", + $cl_args); + +## Starting up the CIAO daemon +$DS->Spawn (); +if ($tg->WaitForFileTimed($daemon_base, + $tg->ProcessStartWaitInterval ()) == -1) { + print STDERR "ERROR: Could not find daemon ior file <$daemon_ior>\n"; + $DS->Kill (); + exit 1; +} + +## Starting up a ComponentServer running the Roundtrip home. +$DC = $tg->CreateProcess ("$controller", + "$common_args $start_args"); + +$DC->SpawnWaitKill ($tg->ProcessStopWaitInterval ()); +if ($tg->WaitForFileTimed($home_base, + $tg->ProcessStartWaitInterval ()) == -1) { + print STDERR "ERROR: Could not find home ior file <$home_ior>\n"; + $DS->Kill (); + exit 1; +} + +$client = $CL->SpawnWaitKill ($tg->ProcessStopWaitInterval ()); + +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; +} + +## Terminating the ComponentServer running. +$DC = $tg->CreateProcess ("$controller", + "$common_args $end_args"); + +$ctrl = $DC->SpawnWaitKill ($tg->ProcessStopWaitInterval ()); +if ($ctrl != 0) { + print STDERR "ERROR: Fail to end component server\n"; + $DC->Kill (); + exit 1; +} + +## Terminating the ComponentServer running the RateGen home. +$DC = $tg->CreateProcess ("$controller", + "$common_args $shutdown_args"); + +$ctrl = $DC->SpawnWaitKill ($tg->ProcessStopWaitInterval ()); +if ($ctrl != 0) { + print STDERR "ERROR: Fail to shutdown CIAODaemon\n"; + $DS->Kill (); + exit 1; +} + +$ctrl = $DS->WaitKill ($tg->ProcessStopWaitInterval ()); +if ($ctrl != 0) { + print STDERR "ERROR: CIAODaemon didn't shutdown gracefully $ctrl\n"; + $DS->Kill (); + exit 1; +} + +$tg->DeleteFile ($daemon_base); +$tg->DeleteFile ($svr_base); +$tg->DeleteFile ($home_base); + +exit $status; |