diff options
Diffstat (limited to 'TAO/examples/Callback_Quoter/run_test.pl')
-rwxr-xr-x | TAO/examples/Callback_Quoter/run_test.pl | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/TAO/examples/Callback_Quoter/run_test.pl b/TAO/examples/Callback_Quoter/run_test.pl new file mode 100755 index 00000000000..eb62f6acf31 --- /dev/null +++ b/TAO/examples/Callback_Quoter/run_test.pl @@ -0,0 +1,71 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::Run_Test; + +$status = 0; +$ns_ior = PerlACE::LocalFile ("NameService.ior"); +$sleeptime = 5; + +unlink $ns_ior; + +$NS = new PerlACE::Process ("../../orbsvcs/Naming_Service/Naming_Service", "-o $ns_ior"); +$N = new PerlACE::Process ("notifier", "-ORBInitRef NameService=file://$ns_ior"); +$C = new PerlACE::Process ("consumer", "-ORBInitRef NameService=file://$ns_ior -t 12 -a TAO"); +$S = new PerlACE::Process ("supplier", "-ORBInitRef NameService=file://$ns_ior -iexample.stocks"); + +print STDERR "================ Remote test\n"; + +$NS->Spawn (); + +if (PerlACE::waitforfile_timed ($ns_ior, 5) == -1) { + print STDERR "ERROR: cannot find file <$ns_ior>\n"; + $NS->Kill (); + exit 1; +} + + +$N->Spawn (); + +sleep $sleeptime; + +$C->Spawn (); + +sleep $sleeptime; + +$supplier = $S->SpawnWaitKill (60); + +if ($supplier != 0) { + print STDERR "ERROR: supplier returned $supplier\n"; + $status = 1; +} + +$server = $C->TerminateWaitKill (5); + +if ($server != 0) { + print STDERR "ERROR: consumer returned $server\n"; + $status = 1; +} + +$server = $N->TerminateWaitKill (5); + +if ($server != 0) { + print STDERR "ERROR: notifier returned $server\n"; + $status = 1; +} + +$server = $NS->TerminateWaitKill (5); + +if ($server != 0) { + print STDERR "ERROR: naming service returned $server\n"; + $status = 1; +} + +unlink $ns_ior; + +exit $status; |