diff options
Diffstat (limited to 'TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl')
-rwxr-xr-x | TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl | 304 |
1 files changed, 213 insertions, 91 deletions
diff --git a/TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl b/TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl index 738d2c8fa96..f3d52ad8721 100755 --- a/TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl +++ b/TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl @@ -11,137 +11,259 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # Do not use environment variables here since not all platforms use ACE_ROOT use lib "../../../../../bin"; -use PerlACE::Run_Test; -use English; - -$status = 0; -$iorfile = PerlACE::LocalFile ("cubit.ior"); -$iiop_lite_conf = PerlACE::LocalFile ("iiop_lite.conf"); -$uiop_lite_conf = PerlACE::LocalFile ("uiop_lite.conf"); -$server_shmiop_conf = PerlACE::LocalFile ("server_shmiop.conf"); +use English; +require Process; +require ACEutils; +$iorfile = "cubit.ior"; +$exepref = '.' . $DIR_SEPARATOR; $svnsflags = " -f $iorfile"; $clnsflags = " -f $iorfile"; $clflags = ""; $svflags = ""; -$quietflag = " -q "; -$giopliteflag = 0; - -############################################################################### +$quietflag = "-q"; +$liteflag = ""; +$svliteflag = ""; +$clliteflag = ""; # Parse the arguments -for ($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") { - print "run_test [-h] [-n num] [-debug] [-orblite] [-verbose]\n"; - print "\n"; - print "-h -- prints this information\n"; - print "-n num -- client uses <num> iterations\n"; - print "-debug -- sets the debug flag for both client and " - . "server\n"; - print "-orblite -- Use the lite version of the orb"; - exit; +for ($i = 0; $i <= $#ARGV; $i++) +{ + SWITCH: + { + if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") + { + print "run_test [-h] [-n num] [-sleeptime t]", + " [-debug] [-release] [-orblite] [-verbose]\n"; + print "\n"; + print "-h -- prints this information\n"; + print "-n num -- client uses <num> iterations\n"; + print "-sleeptime t -- run_test should sleep for <t> seconds between running\n"; + print " the server and client (default is 5 seconds)\n"; + print "-debug -- sets the debug flag for both client and server\n"; + print "-release -- runs the Release version of the test (for NT use)\n"; + print "-orblite -- Use the lite version of the orb"; + exit; + } + if ($ARGV[$i] eq "-debug") + { + $clflags .= " -d"; + $svflags .= " -d"; + last SWITCH; } - elsif ($ARGV[$i] eq "-debug") { - $clflags .= " -d "; - $svflags .= " -d "; + if ($ARGV[$i] eq "-release") + { + $exepref = "Release".$DIR_SEPARATOR; + last SWITCH; } - elsif ($ARGV[$i] eq "-n") { - $clflags .= " -n $ARGV[$i + 1] "; - $i++; + if ($ARGV[$i] eq "-n") + { + $clflags .= " -n $ARGV[$i + 1]"; + $i++; + last SWITCH; } - elsif ($ARGV[$i] eq " -orblite ") { - $giopliteflag = 1; + if ($ARGV[$i] eq "-sleeptime") + { + $ACE::sleeptime = $ARGV[$i + 1]; + $i++; + last SWITCH; } - elsif ($ARGV[$i] eq " -verbose ") { - $quietflag = ""; + if ($ARGV[$i] eq "-orblite") + { + $liteflag = "uselite"; + last SWITCH; } - else { - print STDERR "ERROR: Unknown Option: ".$ARGV[$i]."\n"; + if ($ARGV[$i] eq "-verbose") + { + $quietflag = ""; + last SWITCH; } + print "run_test: Unknown Option: ".$ARGV[$i]."\n"; + } } -$SV = new PerlACE::Process ("server"); -$CL = new PerlACE::Process ("client"); +(-f $exepref."server".$EXE_EXT && + -f $exepref."client".$EXE_EXT) || + die "$0: server and/or client need to be built!\n"; -############################################################################### -# run_test_helper +unlink $iorfile; -sub run_test_helper () -{ - $SV->Spawn (); +sleep 2; - if (PerlACE::waitforfile_timed ($iorfile, 10) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); - exit 1; - } +print stderr "\nRunning IDL_Cubit with the default ORB protocol.\n\n"; - my $client = $CL->SpawnWaitKill (120); - my $server = $SV->WaitKill (30); - - unlink $iorfile; +if ($liteflag eq "uselite") +{ + $svliteflag = "-ORBSvcConf iiop_lite.conf"; + $clliteflag = "-ORBSvcConf iiop_lite.conf"; + print stderr "\nRunning IDL_Cubit with the a lite ORB protocol.\n\n"; +} - if ($server != 0) { - print STDERR "ERROR: server error status $server\n"; - $status = 1; - } +$SV = Process::Create ($exepref."server".$EXE_EXT, + $svflags. + $svliteflag. + $svnsflags); - if ($client != 0) { - print STDERR "ERROR: client error status $client\n"; - $status = 1; - } +if (ACE::waitforfile_timed ($iorfile, 10) == -1) { + print STDERR "ERROR: cannot find file <$iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; } -############################################################################### +$CL = Process::Create ($exepref . "client".$EXE_EXT, + " $quietflag $clflags $clnsflags $clliteflag -x"); -if (! (-x $SV->Executable () && -x $CL->Executable)) { - print STDERR "ERROR: server and/or client missing or not executable!\n"; - exit 1; +$client = $CL->TimedWait (120); +if ($client == -1) { + print STDERR "ERROR: client timedout\n"; + $CL->Kill (); $CL->TimedWait (1); +} + +$server = $SV->TimedWait (10); +if ($server == -1) { + print STDERR "ERROR: server timedout\n"; + $SV->Kill (); $SV->TimedWait (1); } unlink $iorfile; -print STDERR "============================================================\n"; -print STDERR "Running IDL_Cubit with the default ORB protocol.\n\n"; +if ($server != 0) { + print STDERR "ERROR: server error status $server\n"; +} -$SV->Arguments ($svflags . $svnsflags); -$CL->Arguments ($clflags . $clnsflags . $quietflag . " -x "); +if ($client != 0) { + print STDERR "ERROR: client error status $client\n"; +} -if ($giopliteflag) { - print STDERR "\nRunning IDL_Cubit with the a lite ORB protocol.\n\n"; - $SV->Arguments ($SV->Arguments () . " -ORBSvcConf $iiop_lite_conf "); - $CL->Arguments ($CL->Arugments () . " -ORBSvcConf $iiop_lite_conf "); +if ($server != 0 || $client != 0) { + exit 1; } -run_test_helper (); +if ($OSNAME ne "MSWin32") +{ + # Only run the UIOP test on Unix platforms. -if ($OSNAME ne "MSWin32") { - print STDERR "============================================================\n"; - print STDERR "Running IDL_Cubit with the UIOP protocol.\n\n"; + Process::Wait(); - $SV->Arguments ($svflags . $svnsflags . " -ORBEndpoint uiop:// "); - $CL->Arguments ($clflags . $clnsflags . $quietflag . " -x "); + # No need to unlink the iorfile again. + # unlink $iorfile; - if ($giopliteflag) { - print STDERR "\nRunning IDL_Cubit with the a UIOP lite ORB protocol.\n\n"; - $SV->Arguments ($SV->Arguments () . " -ORBSvcConf $uiop_lite_conf "); - $CL->Arguments ($CL->Arugments () . " -ORBSvcConf $uiop_lite_conf "); - } + sleep 2; + + print stderr "\nRunning IDL_Cubit with the UIOP protocol.\n\n"; + if ($liteflag eq "uselite") + { + $svliteflag = "-ORBSvcConf uiop_lite.conf"; + $clliteflag = "-ORBSvcConf uiop_lite.conf"; + print stderr "\nRunning IDL_Cubit with the a UIOP lite ORB protocol.\n\n"; + } + + # Save the original server flags. + $save_svflags = $svflags; + + $svflags .= " -ORBEndpoint uiop://"; + + $SV = Process::Create ($exepref."server".$EXE_EXT, + $svflags. + $svliteflag. + $svnsflags); + + if (ACE::waitforfile_timed ($iorfile, 10) == -1) { + print STDERR "ERROR: cannot find file <$iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; + } + + $CL = Process::Create ($exepref . "client".$EXE_EXT, + " $quietflag $clflags $clnsflags $clliteflag -x"); - run_test_helper (); + $client = $CL->TimedWait (120); + if ($client == -1) { + print STDERR "ERROR: client timedout\n"; + $CL->Kill (); $CL->TimedWait (1); + } + + $server = $SV->TimedWait (30); + if ($server == -1) { + print STDERR "ERROR: server timedout\n"; + $SV->Kill (); $SV->TimedWait (1); + } + + # Restore the original server flags + $svflags = $save_svflags; + + unlink $iorfile; + + if ($server != 0) { + print STDERR "ERROR: server error status $server\n"; + } + + if ($client != 0) { + print STDERR "ERROR: client error status $client\n"; + } + + if ($server != 0 || $client != 0) { + exit 1; + } } -print STDERR "============================================================\n"; -print STDERR "Running IDL_Cubit with the SHMIOP protocol.\n\n"; +# Run the SHMIOP test. -$SV->Arguments ($svflags . $svnsflags - . " -ORBEndpoint shmiop:// -ORBSvcconf $server_shmiop_conf "); -$CL->Arguments ($clflags . $clnsflags . $quietflag . " -x "); +Process::Wait(); -run_test_helper (); +# No need to unlink the iorfile again. +# unlink $iorfile; + +sleep 2; + +print stderr "\nRunning IDL_Cubit with the SHMIOP protocol.\n\n"; + +# Save the original server flags. +$save_svflags = $svflags; + +$svflags .= " -ORBEndpoint shmiop:// -ORBSvcconf server_shmiop.conf "; + +$SV = Process::Create ($exepref."server".$EXE_EXT, + $svflags. + $svnsflags); + +if (ACE::waitforfile_timed ($iorfile, 10) == -1) { + print STDERR "ERROR: cannot find file <$iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} -# Clean up SHMIOP files -unlink glob ("server_shmiop_*"); +$CL = Process::Create ($exepref . "client".$EXE_EXT, + " $quietflag $clflags $clnsflags -x"); + +$client = $CL->TimedWait (120); +if ($client == -1) { + print STDERR "ERROR: client timedout\n"; + $CL->Kill (); $CL->TimedWait (1); +} + +$server = $SV->TimedWait (30); +if ($server == -1) { + print STDERR "ERROR: server timedout\n"; + $SV->Kill (); $SV->TimedWait (1); +} + +# Restore the original server flags +$svflags = $save_svflags; + +unlink $iorfile; + +if ($server != 0) { + print STDERR "ERROR: server error status $server\n"; +} + +if ($client != 0) { + print STDERR "ERROR: client error status $client\n"; +} + +if ($server != 0 || $client != 0) { + exit 1; +} -exit $status; +exit 0; |