diff options
Diffstat (limited to 'TAO/orbsvcs/tests/CosEvent/Timeout/run_test.pl')
-rwxr-xr-x | TAO/orbsvcs/tests/CosEvent/Timeout/run_test.pl | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/TAO/orbsvcs/tests/CosEvent/Timeout/run_test.pl b/TAO/orbsvcs/tests/CosEvent/Timeout/run_test.pl new file mode 100755 index 00000000000..489b16188e3 --- /dev/null +++ b/TAO/orbsvcs/tests/CosEvent/Timeout/run_test.pl @@ -0,0 +1,66 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; +# $Id$ + +use Env (ACE_ROOT); +use lib "$ACE_ROOT/bin"; +use PerlACE::Run_Test; + +$nsiorfile = PerlACE::LocalFile ("ns.ior"); +$esiorfile = PerlACE::LocalFile ("es.ior"); +$arg_ns_ref = "-ORBInitRef NameService=file://$nsiorfile"; + +$status = 0; + +unlink $nsiorfile; +unlink $esiorfile; + +# start Naming Service + +$NameService = "$ENV{ACE_ROOT}/TAO/orbsvcs/Naming_Service/Naming_Service"; +$NS = new PerlACE::Process($NameService, "-o $nsiorfile"); +$NS->Spawn(); +if (PerlACE::waitforfile_timed ($nsiorfile, 5) == -1) { + print STDERR "ERROR: cannot find file <$nsiorfile>\n"; + $NS->Kill(); + exit 1; +} + +# start Event Service +$EventService = "$ENV{ACE_ROOT}/TAO/orbsvcs/CosEvent_Service/CosEvent_Service"; +$ES = new PerlACE::Process($EventService, "-ORBSvcConf cosevent.conf " + ."-b -o $esiorfile $arg_ns_ref"); +$ES->Spawn(); +if (PerlACE::waitforfile_timed ($esiorfile, 5) == -1) { + print STDERR "ERROR: cannot find file <$esiorfile>\n"; + $ES->Kill(); + unlink $nsiorfile; + exit 1; +} + + +$S = new PerlACE::Process("TimeoutTest", "-supplier -consumer -hang " + . $arg_ns_ref); +$ret = $S->SpawnWaitKill(30); +if ($ret != 0) { + print STDERR "ERROR: application returned $ret\n"; + $status = 1; +} + +$ret = $ES->Kill(); +if ($ret != 0) { + print STDERR "ERROR: event channel returned $ret\n"; + $status = 1; +} + +$ret = $NS->Kill(); +if ($ret != 0) { + print STDERR "ERROR: name service returned $ret\n"; + $status = 1; +} + +unlink $nsiorfile; +unlink $esiorfile; + +exit $status; |