diff options
Diffstat (limited to 'TAO/orbsvcs/tests/Event/Basic/run_test.pl')
-rwxr-xr-x | TAO/orbsvcs/tests/Event/Basic/run_test.pl | 204 |
1 files changed, 134 insertions, 70 deletions
diff --git a/TAO/orbsvcs/tests/Event/Basic/run_test.pl b/TAO/orbsvcs/tests/Event/Basic/run_test.pl index cbe4506e0d2..1aa10dae736 100755 --- a/TAO/orbsvcs/tests/Event/Basic/run_test.pl +++ b/TAO/orbsvcs/tests/Event/Basic/run_test.pl @@ -8,94 +8,158 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # This is a Perl script that runs the client and all the other servers that # are needed -use lib '../../../../../bin'; -use PerlACE::Run_Test; +unshift @INC, '../../../../../bin'; +require ACEutils; +require Uniqueid; +use Cwd; +$cwd = getcwd(); +ACE::checkForTarget($cwd); $status = 0; -$svc_conf = PerlACE::LocalFile ("svc.conf"); -$observer_conf = PerlACE::LocalFile ("observer.conf"); -$svc_complex_conf = PerlACE::LocalFile ("svc.complex.conf"); -$mt_svc_conf = PerlACE::LocalFile ("mt.svc.conf"); -$svc_complex_conf = PerlACE::LocalFile ("svc.complex.conf"); -$control_conf = PerlACE::LocalFile ("control.conf"); - -sub RunTest ($$$) -{ - my $message = shift; - my $program = shift; - my $arguments = shift; - - my $TEST = new PerlACE::Process ($program, $arguments); - - print STDERR "\n\n$message\n"; - - my $test = $TEST->SpawnWaitKill (240); - - if ($test != 0) { - print STDERR "ERROR: Test returned $test\n"; - $status = 1; - } +print STDERR "\n\nReconnect suppliers and consumers,", + " using disconnect/connect calls\n"; +$T = Process::Create ($EXEPREFIX . "Reconnect".$EXE_EXT, + "-ORBsvcconf $cwd$DIR_SEPARATOR" . "svc.conf" . + " -suppliers 100 -consumers 100 -d 100"); +if ($T->TimedWait (60) == -1) { + print STDERR "ERROR: Test timedout\n"; + $status = 1; + $T->Kill (); $T->TimedWait (1); } -RunTest ("Reconnect suppliers and consumers, using disconnect/connect calls", - "Reconnect", - "-ORBsvcconf $svc_conf -suppliers 100 -consumers 100 -d 100"); +print STDERR "\n\nReconnect suppliers and consumers, using connect calls\n"; +$T = Process::Create ($EXEPREFIX . "Reconnect".$EXE_EXT, + "-ORBsvcconf $cwd$DIR_SEPARATOR" . "svc.conf" . + " -suppliers 100 -consumers 100 -d 100 -s -c"); +if ($T->TimedWait (60) == -1) { + print STDERR "ERROR: Test timedout\n"; + $status = 1; + $T->Kill (); $T->TimedWait (1); +} -RunTest ("Reconnect suppliers and consumers, using connect calls", - "Reconnect", - "-ORBsvcconf $svc_conf -suppliers 100 -consumers 100 -d 100 -s -c"); -RunTest ("Shutdown EC with clients still attached", - "Shutdown", - "-ORBsvcconf $svc_conf -suppliers 5 -consumers 5"); +print STDERR "\n\nShutdown EC with clients still attached\n"; +$T = Process::Create ($EXEPREFIX . "Shutdown".$EXE_EXT, + "-ORBsvcconf $cwd$DIR_SEPARATOR" . "svc.conf" . + " -suppliers 5 -consumers 5"); +if ($T->TimedWait (60) == -1) { + print STDERR "ERROR: Test timedout\n"; + $status = 1; + $T->Kill (); $T->TimedWait (1); +} -RunTest ("Gateway test", - "Gateway", - "-ORBsvcconf $observer_conf"); +print STDERR "\n\nGateway test\n"; +$T = Process::Create ($EXEPREFIX . "Gateway".$EXE_EXT, + " -ORBsvcconf $cwd$DIR_SEPARATOR" . "observer.conf"); +if ($T->TimedWait (60) == -1) { + print STDERR "ERROR: Test timedout\n"; + $status = 1; + $T->Kill (); $T->TimedWait (1); +} -RunTest ("Complex event channel test, multiple ECs connected through gateways", - "Observer", - "-ORBsvcconf $observer_conf -consumer_tshift 0 -consumers 5 -supplier_tshift 0 -suppliers 2 -burstsize 10 -burstcount 10 -burstpause 0"); +print STDERR "\n\nComplex event channel test,", + "multiple ECs connected through gateways\n"; +$T = Process::Create ($EXEPREFIX . "Observer".$EXE_EXT, + " -ORBsvcconf $cwd$DIR_SEPARATOR" . "observer.conf" + ." -consumer_tshift 0 -consumers 5" + ." -supplier_tshift 0 -suppliers 2" + ." -burstsize 10 -burstcount 10 -burstpause 0"); +if ($T->TimedWait (60) == -1) { + print STDERR "ERROR: Test timedout\n"; + $status = 1; + $T->Kill (); $T->TimedWait (1); +} -RunTest ("Timeout tests", - "Timeout", - "-ORBsvcconf $svc_conf"); +print STDERR "\n\nTimeout tests\n"; +$T = Process::Create ($EXEPREFIX . "Timeout".$EXE_EXT, + "-ORBsvcconf $cwd$DIR_SEPARATOR" . "svc.conf"); +if ($T->TimedWait (60) == -1) { + print STDERR "ERROR: Test timedout\n"; + $status = 1; + $T->Kill (); $T->TimedWait (1); +} -RunTest ("Wildcard tests", - "Wildcard", - "-ORBsvcconf $svc_conf"); +print STDERR "\n\nWildcard tests\n"; +$T = Process::Create ($EXEPREFIX . "Wildcard".$EXE_EXT, + "-ORBsvcconf $cwd$DIR_SEPARATOR" . "svc.conf"); +if ($T->TimedWait (60) == -1) { + print STDERR "ERROR: Test timedout\n"; + $status = 1; + $T->Kill (); $T->TimedWait (1); +} -RunTest ("Negation tests", - "Negation", - "-ORBsvcconf $svc_conf"); +print STDERR "\n\nNegation tests\n"; +$T = Process::Create ($EXEPREFIX . "Negation".$EXE_EXT, + "-ORBsvcconf $cwd$DIR_SEPARATOR" . "svc.conf"); +if ($T->TimedWait (60) == -1) { + print STDERR "ERROR: Test timedout\n"; + $status = 1; + $T->Kill (); $T->TimedWait (1); +} -RunTest ("Bitmask tests", - "Bitmask", - "-ORBSvcConf $svc_complex_conf"); +print STDERR "\n\nBitmask tests\n"; +$T = Process::Create ($EXEPREFIX . "Bitmask".$EXE_EXT, + " -ORBSvcConf $cwd$DIR_SEPARATOR" . "svc.complex.conf"); +if ($T->TimedWait (60) == -1) { + print STDERR "ERROR: Test timedout\n"; + $status = 1; + $T->Kill (); $T->TimedWait (1); +} -RunTest ("Disconnect callbacks test", - "Disconnect", - "-ORBsvcconf $svc_conf"); +print STDERR "\n\nDisconnect callbacks test\n"; +$T = Process::Create ($EXEPREFIX . "Disconnect".$EXE_EXT, + "-ORBsvcconf $cwd$DIR_SEPARATOR" . "svc.conf"); +if ($T->TimedWait (60) == -1) { + print STDERR "ERROR: Test timedout\n"; + $status = 1; + $T->Kill (); $T->TimedWait (1); +} -RunTest ("MT Disconnects test", - "MT_Disconnect", - "-ORBSvcConf $mt_svc_conf"); +print STDERR "\n\nMT Disconnects test\n"; +$T = Process::Create ($EXEPREFIX . "MT_Disconnect".$EXE_EXT, + " -ORBSvcConf $cwd$DIR_SEPARATOR" . "mt.svc.conf"); +if ($T->TimedWait (240) == -1) { + print STDERR "ERROR: Test timedout\n"; + $status = 1; + $T->Kill (); $T->TimedWait (1); +} -RunTest ("Atomic Reconnection test", - "Atomic_Reconnect", - "-ORBSvcConf $mt_svc_conf"); +print STDERR "\n\nAtomic Reconnection test\n"; +$T = Process::Create ($EXEPREFIX . "Atomic_Reconnect".$EXE_EXT, + " -ORBSvcConf $cwd$DIR_SEPARATOR" . "mt.svc.conf"); +if ($T->TimedWait (120) == -1) { + print STDERR "ERROR: Test timedout\n"; + $status = 1; + $T->Kill (); $T->TimedWait (1); +} -RunTest ("Complex filter", - "Complex", - "-ORBSvcConf $svc_complex_conf"); +print STDERR "\n\nComplex filter\n"; +$T = Process::Create ($EXEPREFIX . "Complex".$EXE_EXT, + " -ORBSvcConf $cwd$DIR_SEPARATOR" . "svc.complex.conf"); +if ($T->TimedWait (60) == -1) { + print STDERR "ERROR: Test timedout\n"; + $status = 1; + $T->Kill (); $T->TimedWait (1); +} -RunTest ("Control test", - "Control", - "-ORBSvcConf $control_conf"); +print STDERR "\n\nControl test\n"; +$T = Process::Create ($EXEPREFIX . "Control".$EXE_EXT, + " -ORBSvcConf $cwd$DIR_SEPARATOR" . "control.conf"); +if ($T->TimedWait (60) == -1) { + print STDERR "ERROR: Test timedout\n"; + $status = 1; + $T->Kill (); $T->TimedWait (1); +} -RunTest ("Random test", - "Random", - "-ORBSvcConf $svc_conf -suppliers 4 -consumers 4 -max_recursion 1"); +print STDERR "\n\nRandom test\n"; +$T = Process::Create ($EXEPREFIX . "Random".$EXE_EXT, + " -ORBSvcConf $cwd$DIR_SEPARATOR" . "svc.conf" + . " -suppliers 4 -consumers 4 -max_recursion 1"); +if ($T->TimedWait (60) == -1) { + print STDERR "ERROR: Test timedout\n"; + $status = 1; + $T->Kill (); $T->TimedWait (1); +} exit $status; |