diff options
Diffstat (limited to 'TAO/orbsvcs/tests/Trading/run_test.pl')
-rwxr-xr-x | TAO/orbsvcs/tests/Trading/run_test.pl | 80 |
1 files changed, 30 insertions, 50 deletions
diff --git a/TAO/orbsvcs/tests/Trading/run_test.pl b/TAO/orbsvcs/tests/Trading/run_test.pl index e557bdb3ddc..2ee0d0dce60 100755 --- a/TAO/orbsvcs/tests/Trading/run_test.pl +++ b/TAO/orbsvcs/tests/Trading/run_test.pl @@ -5,70 +5,50 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -unshift @INC, '../../../../bin'; -require ACEutils; -require Process; -use Cwd; +use lib '../../../../bin'; +use PerlACE::Run_Test; -$cwd = getcwd(); -$ior = "$cwd$DIR_SEPARATOR" . "trading.ior"; -$ready_file = "$cwd$DIR_SEPARATOR" . "export_test_ready"; +$ior = PerlACE::LocalFile ("trading.ior"); +$ready_file = PerlACE::LocalFile ("export_test_ready"); $sleeptime = 20; -$status = 0; unlink $ior; unlink $ready_file; -ACE::checkForTarget($cwd); +$TS = new PerlACE::Process ("../../Trading_Service/Trading_Service", + "-TSdumpior $ior"); +$E = new PerlACE::Process ("export_test", + "-ORBInitRef TradingService=file://$ior -quiet"); +$I = new PerlACE::Process ("import_test", + "-ORBInitRef TradingService=file://$ior -quiet"); -$TS = Process::Create ($EXEPREFIX."..".$DIR_SEPARATOR. - "..".$DIR_SEPARATOR. - "Trading_Service".$DIR_SEPARATOR. - "Trading_Service".$EXE_EXT, - " -TSdumpior $ior "); +$TS->Spawn (); -if (ACE::waitforfile_timed ($ior, $sleeptime) == -1) { - print STDERR "ERROR: waiting for trading service IOR file\n"; - $TS->Kill (); $TS->TimedWait (1); - exit 1; +if (PerlACE::waitforfile_timed ($ior, $sleeptime) == -1) { + print STDERR "ERROR: waiting for trading service IOR file\n"; + $TS->Kill (); + exit 1; } -$E = Process::Create ($EXEPREFIX."export_test".$EXE_EXT, - "-ORBInitRef TradingService=file://$ior" - . " -quiet"); +$E->Spawn (); -if (ACE::waitforfile_timed ($ready_file, 120) == -1) { - print STDERR "ERROR: waiting for the export test to finish\n"; - $E->Kill (); $E->TimedWait (1); - $TS->Kill (); $TS->TimedWait (1); - exit 1; +if (PerlACE::waitforfile_timed ($ready_file, 120) == -1) { + print STDERR "ERROR: waiting for the export test to finish\n"; + $E->Kill (); + $TS->Kill (); + exit 1; } -$I = Process::Create ($EXEPREFIX."import_test".$EXE_EXT, - "-ORBInitRef TradingService=file://$ior" - . " -quiet"); - -if ($I->TimedWait (60) == -1) { - $status = 1; - print STDERR "ERROR: import test timedout\n"; - $I->Kill (); $I->TimedWait (1); -} - -$E->Terminate (); -if ($E->TimedWait (15) == -1) { - $status =1; - print STDERR "ERROR: export test timedout\n"; - $E->Kill (); $E->TimedWait (1); -} - -$TS->Terminate(); -if ($TS->TimedWait (15) == -1) { - print STDERR "ERROR: couldn't terminate the trading service nicely\n"; - $TS->Kill (); $TS->TimedWait (1); - $status = 1; -} +$test = $I->SpawnWaitKill (60); +$E->Kill (); +$TS->Kill (); unlink $ior; unlink $ready_file; -exit $status; +if ($test != 0) { + print STDERR "ERROR: import test returned $test\n"; + exit 1; +} + +exit 0; |