diff options
52 files changed, 213 insertions, 629 deletions
diff --git a/ChangeLog b/ChangeLog index eeaf471c040..2d14af35241 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Apr 11 11:32:03 2000 Chad Elliott <elliott_c@ociweb.com> + * bin/ACEutils.pm + + Refactored duplicate test code into ACEutils.pm + Mon Apr 10 19:45:32 2000 Vishal Kachroo <vishal@cs.wustl.edu> * ace/SOCK_Dgram_Mcast.cpp (subscribe): Added a #ifdef to diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index eeaf471c040..2d14af35241 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,8 @@ +Tue Apr 11 11:32:03 2000 Chad Elliott <elliott_c@ociweb.com> + * bin/ACEutils.pm + + Refactored duplicate test code into ACEutils.pm + Mon Apr 10 19:45:32 2000 Vishal Kachroo <vishal@cs.wustl.edu> * ace/SOCK_Dgram_Mcast.cpp (subscribe): Added a #ifdef to diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index eeaf471c040..2d14af35241 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,8 @@ +Tue Apr 11 11:32:03 2000 Chad Elliott <elliott_c@ociweb.com> + * bin/ACEutils.pm + + Refactored duplicate test code into ACEutils.pm + Mon Apr 10 19:45:32 2000 Vishal Kachroo <vishal@cs.wustl.edu> * ace/SOCK_Dgram_Mcast.cpp (subscribe): Added a #ifdef to diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index b46d277c578..76aff772a19 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,55 @@ +Tue Apr 11 11:32:03 2000 Chad Elliott <elliott_c@ociweb.com> + * orbsvcs/tests/AVStreams/benchmark/run_test.pl + orbsvcs/tests/CosEC_Multiple/run_test.pl + orbsvcs/tests/CosEC_Multiple/run_test2.pl + orbsvcs/tests/CosEvent/Basic/run_test.pl + orbsvcs/tests/EC_Basic/run_test.pl + orbsvcs/tests/EC_Custom_Marshal/run_test.pl + orbsvcs/tests/EC_Mcast/run_test.pl + orbsvcs/tests/EC_Multiple/run_test.pl + orbsvcs/tests/EC_Throughput/run_test.pl + orbsvcs/tests/Event/Basic/run_test.pl + orbsvcs/tests/Event/Performance/run_test.pl + orbsvcs/tests/Event_Latency/run_test.pl + orbsvcs/tests/ImplRepo/run_test.pl + orbsvcs/tests/Property/run_test.pl + orbsvcs/tests/Simple_Naming/run_test.pl + orbsvcs/tests/Time/run_test.pl + orbsvcs/tests/Trading/run_test.pl + tests/AMI/run_test.pl + tests/CDR/run_test.pl + tests/Connection_Purging/run_test.pl + tests/DSI_Gateway/run_test.pl + tests/DynAny_Test/run_test.pl + tests/Endpoint_Per_Priority/run_test.pl + tests/Explicit_Event_Loop/run_test.pl + tests/Faults/run_test.pl + tests/IORManipulation/run_test.pl + tests/InterOp-Naming/run_test.pl + tests/Interceptors/run_test.pl + tests/Leader_Followers/run_test.pl + tests/MT_Client/run_test.pl + tests/MT_Server/run_test.pl + tests/Multiple_Inheritance/run_test.pl + tests/Native_Exceptions/run_test.pl + tests/NestedUpcall/MT_Client_Test/run_test.pl + tests/NestedUpcall/Simple/run_test.pl + tests/NestedUpcall/Triangle_Test/run_test.pl + tests/Nested_Event_Loop/run_test.pl + tests/ORB_init/run_test.pl + tests/OctetSeq/run_test.pl + tests/POA/Deactivation/run_test.pl + tests/POA/Destruction/run_test.pl + tests/POA/Identity/run_test.pl + tests/Param_Test/run_test.pl + tests/Smart_Proxies/run_test.pl + tests/Smart_Proxies/On_Demand/run_test.pl + tests/Timed_Buffered_Oneways/run_test.pl + tests/Timeout/run_test.pl + + Refactor duplicate code into ACEutils.pm + Thanks Carlos. + Tue Apr 11 09:02:33 2000 Ossama Othman <ossama@uci.edu> * tao/corbafwd.h (TAO_ACCEPTOR_REGISTRY_OPEN_LOCATION_CODE, diff --git a/TAO/orbsvcs/tests/AVStreams/benchmark/run_test.pl b/TAO/orbsvcs/tests/AVStreams/benchmark/run_test.pl index 907011f22be..aa256319e5f 100755 --- a/TAO/orbsvcs/tests/AVStreams/benchmark/run_test.pl +++ b/TAO/orbsvcs/tests/AVStreams/benchmark/run_test.pl @@ -17,18 +17,7 @@ $status = 0; $cwd = getcwd(); local $nsior = "$cwd$DIR_SEPARATOR" . "ns.ior"; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); $name_server_prog = $EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR."Naming_Service".$DIR_SEPARATOR."Naming_Service".$EXE_EXT; $server_prog = $EXEPREFIX.".".$DIR_SEPARATOR."server".$EXE_EXT; diff --git a/TAO/orbsvcs/tests/CosEC_Multiple/run_test.pl b/TAO/orbsvcs/tests/CosEC_Multiple/run_test.pl index e02c14efbf2..902479ba917 100755 --- a/TAO/orbsvcs/tests/CosEC_Multiple/run_test.pl +++ b/TAO/orbsvcs/tests/CosEC_Multiple/run_test.pl @@ -15,6 +15,8 @@ $ev_count = 2; $status = 0; $port = ACE::uniqueid () + 10001; # This can't be 10000 on Chorus 4.0 +ACE::checkForTarget(getcwd()); + # setup CosEC params such that.. # cos event service name = "cosec1" # for ConsumerQOS: EventID = 21, SourceID = 6 @@ -161,18 +163,6 @@ for ($i = 0; $i <= $#ARGV; $i++) $i++; last SWITCH; } - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $cwd = getcwd(); - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - last SWITCH; - } } } diff --git a/TAO/orbsvcs/tests/CosEC_Multiple/run_test2.pl b/TAO/orbsvcs/tests/CosEC_Multiple/run_test2.pl index 2b1114cbaa0..250966b7931 100755 --- a/TAO/orbsvcs/tests/CosEC_Multiple/run_test2.pl +++ b/TAO/orbsvcs/tests/CosEC_Multiple/run_test2.pl @@ -16,6 +16,8 @@ $ev_count = 8; $status = 0; $port = ACE::uniqueid () + 10001; # This can't be 10000 on Chorus 4.0 +ACE::checkForTarget(getcwd()); + sub cosec_multiple_test2 { # first start the Naming service.. @@ -112,18 +114,6 @@ for ($i = 0; $i <= $#ARGV; $i++) $i++; last SWITCH; } - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $cwd = getcwd(); - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - last SWITCH; - } } } diff --git a/TAO/orbsvcs/tests/CosEvent/Basic/run_test.pl b/TAO/orbsvcs/tests/CosEvent/Basic/run_test.pl index 552c87b61da..cb71dc6d7e0 100755 --- a/TAO/orbsvcs/tests/CosEvent/Basic/run_test.pl +++ b/TAO/orbsvcs/tests/CosEvent/Basic/run_test.pl @@ -9,29 +9,18 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # are needed unshift @INC, '../../../../../bin'; +require ACEutils; require Process; require Uniqueid; use Cwd; $cwd = getcwd(); -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); -$prefix = $EXEPREFIX . "." . $DIR_SEPARATOR; $status = 0; print STDERR "\n\nShutdown EC with clients still attached\n"; -$T = Process::Create ($prefix . "Shutdown".$EXE_EXT); +$T = Process::Create ($EXEPREFIX . "Shutdown".$EXE_EXT); if ($T->TimedWait (60) == -1) { print STDERR "ERROR: Test timedout\n"; $status = 1; @@ -39,7 +28,7 @@ if ($T->TimedWait (60) == -1) { } print STDERR "\n\nDisconnect callbacks test\n"; -$T = Process::Create ($prefix . "Disconnect".$EXE_EXT); +$T = Process::Create ($EXEPREFIX . "Disconnect".$EXE_EXT); if ($T->TimedWait (60) == -1) { print STDERR "ERROR: Test timedout\n"; $status = 1; @@ -47,7 +36,7 @@ if ($T->TimedWait (60) == -1) { } print STDERR "\n\nMT Disconnects test\n"; -$T = Process::Create ($prefix . "MT_Disconnect".$EXE_EXT); +$T = Process::Create ($EXEPREFIX . "MT_Disconnect".$EXE_EXT); if ($T->TimedWait (240) == -1) { print STDERR "ERROR: Test timedout\n"; $status = 1; @@ -55,7 +44,7 @@ if ($T->TimedWait (240) == -1) { } print STDERR "\n\nPush Events\n"; -$T = Process::Create ($prefix . "Push_Event".$EXE_EXT); +$T = Process::Create ($EXEPREFIX . "Push_Event".$EXE_EXT); if ($T->TimedWait (60) == -1) { print STDERR "ERROR: Test timedout\n"; $status = 1; @@ -63,7 +52,7 @@ if ($T->TimedWait (60) == -1) { } print STDERR "\n\nPull-Push Events\n"; -$T = Process::Create ($prefix . "Pull_Push_Event".$EXE_EXT, +$T = Process::Create ($EXEPREFIX . "Pull_Push_Event".$EXE_EXT, " -ORBSvcConf $cwd$DIR_SEPARATOR" . "svc.pull.conf"); if ($T->TimedWait (60) == -1) { print STDERR "ERROR: Test timedout\n"; diff --git a/TAO/orbsvcs/tests/EC_Basic/run_test.pl b/TAO/orbsvcs/tests/EC_Basic/run_test.pl index 1acfdb7ec25..57fe34b5352 100755 --- a/TAO/orbsvcs/tests/EC_Basic/run_test.pl +++ b/TAO/orbsvcs/tests/EC_Basic/run_test.pl @@ -10,21 +10,9 @@ require ACEutils; require Process; use Cwd; -$cwd = getcwd(); $status = 0; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget(getcwd()); $TEST = Process::Create ($EXEPREFIX."EC_Basic".$EXE_EXT, ""); diff --git a/TAO/orbsvcs/tests/EC_Custom_Marshal/run_test.pl b/TAO/orbsvcs/tests/EC_Custom_Marshal/run_test.pl index b2e1e2c76c7..5f78d78fb71 100755 --- a/TAO/orbsvcs/tests/EC_Custom_Marshal/run_test.pl +++ b/TAO/orbsvcs/tests/EC_Custom_Marshal/run_test.pl @@ -12,18 +12,7 @@ use Cwd; $port = ACE::uniqueid () + 10001; # This can't be 10000 on Chorus 4.0 $cwd = getcwd(); -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); $NS_ior = "$cwd$DIR_SEPARATOR" . "NameService.ior"; $sleeptime = 5; diff --git a/TAO/orbsvcs/tests/EC_Mcast/run_test.pl b/TAO/orbsvcs/tests/EC_Mcast/run_test.pl index e3a2cc618e8..a2fda58f080 100755 --- a/TAO/orbsvcs/tests/EC_Mcast/run_test.pl +++ b/TAO/orbsvcs/tests/EC_Mcast/run_test.pl @@ -6,22 +6,11 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # -*- perl -*- unshift @INC, '../../../../bin'; -require Process; +require ACEutils; use Cwd; $cwd = getcwd(); -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); # Run two copies of the same test... $T1 = Process::Create ($EXEPREFIX."EC_Mcast".$EXE_EXT, diff --git a/TAO/orbsvcs/tests/EC_Multiple/run_test.pl b/TAO/orbsvcs/tests/EC_Multiple/run_test.pl index 5cf03e33799..1aef14e8855 100755 --- a/TAO/orbsvcs/tests/EC_Multiple/run_test.pl +++ b/TAO/orbsvcs/tests/EC_Multiple/run_test.pl @@ -14,18 +14,7 @@ $cwd = getcwd(); $NS_ior = "$cwd$DIR_SEPARATOR" . "NameService.ior"; $status = 0; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); $NS = Process::Create ($EXEPREFIX."..".$DIR_SEPARATOR. "..".$DIR_SEPARATOR. diff --git a/TAO/orbsvcs/tests/EC_Throughput/run_test.pl b/TAO/orbsvcs/tests/EC_Throughput/run_test.pl index f890aff5a59..f95c59d72d4 100755 --- a/TAO/orbsvcs/tests/EC_Throughput/run_test.pl +++ b/TAO/orbsvcs/tests/EC_Throughput/run_test.pl @@ -11,18 +11,8 @@ require ACEutils; use Cwd; $cwd = getcwd(); -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); + print STDERR "================ Collocated tests, single threaded\n"; $T = Process::Create ($EXEPREFIX."ECT_Throughput".$EXE_EXT, diff --git a/TAO/orbsvcs/tests/Event/Basic/run_test.pl b/TAO/orbsvcs/tests/Event/Basic/run_test.pl index ea92c470eee..406348d38e9 100755 --- a/TAO/orbsvcs/tests/Event/Basic/run_test.pl +++ b/TAO/orbsvcs/tests/Event/Basic/run_test.pl @@ -9,29 +9,17 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # are needed unshift @INC, '../../../../../bin'; -require Process; +require ACEutils; require Uniqueid; use Cwd; $cwd = getcwd(); -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} -$prefix = $EXEPREFIX . "." . $DIR_SEPARATOR; +ACE::checkForTarget($cwd); $status = 0; print STDERR "\n\nReconnect suppliers and consumers,", " using disconnect/connect calls\n"; -$T = Process::Create ($prefix . "Reconnect".$EXE_EXT, +$T = Process::Create ($EXEPREFIX . "Reconnect".$EXE_EXT, " -suppliers 100 -consumers 100 -d 100"); if ($T->TimedWait (60) == -1) { print STDERR "ERROR: Test timedout\n"; @@ -40,7 +28,7 @@ if ($T->TimedWait (60) == -1) { } print STDERR "\n\nReconnect suppliers and consumers, using connect calls\n"; -$T = Process::Create ($prefix . "Reconnect".$EXE_EXT, +$T = Process::Create ($EXEPREFIX . "Reconnect".$EXE_EXT, " -suppliers 100 -consumers 100 -d 100 -s -c"); if ($T->TimedWait (60) == -1) { print STDERR "ERROR: Test timedout\n"; @@ -50,7 +38,7 @@ if ($T->TimedWait (60) == -1) { print STDERR "\n\nShutdown EC with clients still attached\n"; -$T = Process::Create ($prefix . "Shutdown".$EXE_EXT, +$T = Process::Create ($EXEPREFIX . "Shutdown".$EXE_EXT, " -verbose -suppliers 5 -consumers 5"); if ($T->TimedWait (60) == -1) { print STDERR "ERROR: Test timedout\n"; @@ -59,7 +47,7 @@ if ($T->TimedWait (60) == -1) { } print STDERR "\n\nGateway test\n"; -$T = Process::Create ($prefix . "Gateway".$EXE_EXT, +$T = Process::Create ($EXEPREFIX . "Gateway".$EXE_EXT, " -ORBsvcconf $cwd$DIR_SEPARATOR" . "observer.conf"); if ($T->TimedWait (60) == -1) { print STDERR "ERROR: Test timedout\n"; @@ -69,7 +57,7 @@ if ($T->TimedWait (60) == -1) { print STDERR "\n\nComplex event channel test,", "multiple ECs connected through gateways\n"; -$T = Process::Create ($prefix . "Observer".$EXE_EXT, +$T = Process::Create ($EXEPREFIX . "Observer".$EXE_EXT, " -ORBsvcconf $cwd$DIR_SEPARATOR" . "observer.conf" ." -consumer_tshift 0 -consumers 5" ." -supplier_tshift 0 -suppliers 2" @@ -81,7 +69,7 @@ if ($T->TimedWait (60) == -1) { } print STDERR "\n\nTimeout tests\n"; -$T = Process::Create ($prefix . "Timeout".$EXE_EXT); +$T = Process::Create ($EXEPREFIX . "Timeout".$EXE_EXT); if ($T->TimedWait (60) == -1) { print STDERR "ERROR: Test timedout\n"; $status = 1; @@ -89,7 +77,7 @@ if ($T->TimedWait (60) == -1) { } print STDERR "\n\nWildcard tests\n"; -$T = Process::Create ($prefix . "Wildcard".$EXE_EXT); +$T = Process::Create ($EXEPREFIX . "Wildcard".$EXE_EXT); if ($T->TimedWait (60) == -1) { print STDERR "ERROR: Test timedout\n"; $status = 1; @@ -97,7 +85,7 @@ if ($T->TimedWait (60) == -1) { } print STDERR "\n\nNegation tests\n"; -$T = Process::Create ($prefix . "Negation".$EXE_EXT); +$T = Process::Create ($EXEPREFIX . "Negation".$EXE_EXT); if ($T->TimedWait (60) == -1) { print STDERR "ERROR: Test timedout\n"; $status = 1; @@ -105,7 +93,7 @@ if ($T->TimedWait (60) == -1) { } print STDERR "\n\nBitmask tests\n"; -$T = Process::Create ($prefix . "Bitmask".$EXE_EXT, +$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"; @@ -114,7 +102,7 @@ if ($T->TimedWait (60) == -1) { } print STDERR "\n\nDisconnect callbacks test\n"; -$T = Process::Create ($prefix . "Disconnect".$EXE_EXT); +$T = Process::Create ($EXEPREFIX . "Disconnect".$EXE_EXT); if ($T->TimedWait (60) == -1) { print STDERR "ERROR: Test timedout\n"; $status = 1; @@ -122,7 +110,7 @@ if ($T->TimedWait (60) == -1) { } print STDERR "\n\nMT Disconnects test\n"; -$T = Process::Create ($prefix . "MT_Disconnect".$EXE_EXT, +$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"; @@ -131,7 +119,7 @@ if ($T->TimedWait (240) == -1) { } print STDERR "\n\nAtomic Reconnection test\n"; -$T = Process::Create ($prefix . "Atomic_Reconnect".$EXE_EXT, +$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"; @@ -140,7 +128,7 @@ if ($T->TimedWait (120) == -1) { } print STDERR "\n\nComplex filter\n"; -$T = Process::Create ($prefix . "Complex".$EXE_EXT, +$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"; @@ -149,7 +137,7 @@ if ($T->TimedWait (60) == -1) { } print STDERR "\n\nControl test\n"; -$T = Process::Create ($prefix . "Control".$EXE_EXT, +$T = Process::Create ($EXEPREFIX . "Control".$EXE_EXT, " -ORBSvcConf $cwd$DIR_SEPARATOR" . "control.conf"); if ($T->TimedWait (60) == -1) { print STDERR "ERROR: Test timedout\n"; diff --git a/TAO/orbsvcs/tests/Event/Performance/run_test.pl b/TAO/orbsvcs/tests/Event/Performance/run_test.pl index 79c689bc399..94acf56453f 100755 --- a/TAO/orbsvcs/tests/Event/Performance/run_test.pl +++ b/TAO/orbsvcs/tests/Event/Performance/run_test.pl @@ -9,29 +9,17 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # are needed unshift @INC, '../../../../../bin'; -require Process; +require ACEutils; require Uniqueid; use Cwd; $cwd = getcwd(); -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); -$prefix = $EXEPREFIX . "." . $DIR_SEPARATOR; $status = 0; print STDERR "\n\nThroughput/Latency single threaded configuration\n"; -$T = Process::Create ($prefix . "Throughput".$EXE_EXT, +$T = Process::Create ($EXEPREFIX . "Throughput".$EXE_EXT, " -ORBsvcconf $cwd$DIR_SEPARATOR" . "ec.st.conf " . "-burstsize 2000 -burstcount 1"); if ($T->TimedWait (60) == -1) { @@ -42,7 +30,7 @@ if ($T->TimedWait (60) == -1) { print STDERR "\n\nThroughput/Latency MT-safe configuration\n"; -$T = Process::Create ($prefix . "Throughput".$EXE_EXT, +$T = Process::Create ($EXEPREFIX . "Throughput".$EXE_EXT, " -burstsize 2000" ." -burstcount 1"); if ($T->TimedWait (60) == -1) { @@ -53,7 +41,7 @@ if ($T->TimedWait (60) == -1) { print STDERR "\n\nThroughput/Latency MT-safe configuration, 4 consumers\n"; -$T = Process::Create ($prefix . "Throughput".$EXE_EXT, +$T = Process::Create ($EXEPREFIX . "Throughput".$EXE_EXT, " -burstsize 2000" ." -burstcount 1 -consumers 4"); if ($T->TimedWait (60) == -1) { @@ -65,7 +53,7 @@ if ($T->TimedWait (60) == -1) { print STDERR "\n\nThroughput/Latency MT-safe configuration,", " 4 consumers 4 suppliers\n"; -$T = Process::Create ($prefix . "Throughput".$EXE_EXT, +$T = Process::Create ($EXEPREFIX . "Throughput".$EXE_EXT, " -burstsize 2000" ." -burstcount 1 -consumers 4 -suppliers 4"); if ($T->TimedWait (60) == -1) { @@ -77,7 +65,7 @@ if ($T->TimedWait (60) == -1) { print STDERR "\n\nThroughput/Latency MT-safe configuration,", " 4 consumers 4 suppliers\n"; -$T = Process::Create ($prefix . "Throughput".$EXE_EXT, +$T = Process::Create ($EXEPREFIX . "Throughput".$EXE_EXT, " -burstsize 2000" ." -burstcount 1 -consumers 4 -suppliers 4" ." -consumers_tshift 0 -suppliers_tshift 0"); @@ -89,7 +77,7 @@ if ($T->TimedWait (60) == -1) { print STDERR "\n\nConnection and disconnection time,", " 100 consumers 100 suppliers\n"; -$T = Process::Create ($prefix . "Connect".$EXE_EXT, +$T = Process::Create ($EXEPREFIX . "Connect".$EXE_EXT, " -consumers 100 -suppliers 100" ." -connection_order interleaved"); if ($T->TimedWait (60) == -1) { @@ -101,7 +89,7 @@ if ($T->TimedWait (60) == -1) { print STDERR "\n\nConnection and disconnection time,", " 500 consumers 500 suppliers\n"; -$T = Process::Create ($prefix . "Connect".$EXE_EXT, +$T = Process::Create ($EXEPREFIX . "Connect".$EXE_EXT, " -consumers 500 -suppliers 500" ." -connection_order interleaved"); if ($T->TimedWait (60) == -1) { diff --git a/TAO/orbsvcs/tests/Event_Latency/run_test.pl b/TAO/orbsvcs/tests/Event_Latency/run_test.pl index ea841623d34..e7d20789200 100755 --- a/TAO/orbsvcs/tests/Event_Latency/run_test.pl +++ b/TAO/orbsvcs/tests/Event_Latency/run_test.pl @@ -15,18 +15,7 @@ $NS_ior = "$cwd$DIR_SEPARATOR" . "NameService.ior"; $sleeptime = 3; $status = 0; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); $NS = Process::Create ($EXEPREFIX."..".$DIR_SEPARATOR ."..".$DIR_SEPARATOR diff --git a/TAO/orbsvcs/tests/ImplRepo/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/run_test.pl index aa1c01d2f37..d389bee8cf2 100755 --- a/TAO/orbsvcs/tests/ImplRepo/run_test.pl +++ b/TAO/orbsvcs/tests/ImplRepo/run_test.pl @@ -17,6 +17,8 @@ $implrepo_ior = "$cwd$DIR_SEPARATOR" . "implrepo.ior"; $refstyle = " -ORBobjrefstyle URL"; +ACE::checkForTarget($cwd); + $implrepo_server = $EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR."ImplRepo_Service". $DIR_SEPARATOR."ImplRepo_Service".$EXE_EXT; @@ -194,17 +196,6 @@ for ($i = 0; $i <= $#ARGV; $i++) both_ir_test (); exit; } - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - last SWITCH; - } print "run_test: Unknown Option: ".$ARGV[$i]."\n"; } } diff --git a/TAO/orbsvcs/tests/Property/run_test.pl b/TAO/orbsvcs/tests/Property/run_test.pl index b20ed201d96..56e731ac912 100755 --- a/TAO/orbsvcs/tests/Property/run_test.pl +++ b/TAO/orbsvcs/tests/Property/run_test.pl @@ -16,18 +16,7 @@ $cwd = getcwd(); $sleeptime = 6; $status = 0; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); # variables for parameters diff --git a/TAO/orbsvcs/tests/Simple_Naming/run_test.pl b/TAO/orbsvcs/tests/Simple_Naming/run_test.pl index 2d48d3a293e..a9ea5e590a9 100755 --- a/TAO/orbsvcs/tests/Simple_Naming/run_test.pl +++ b/TAO/orbsvcs/tests/Simple_Naming/run_test.pl @@ -28,18 +28,7 @@ $persistent_ior_file = "$cwd$DIR_SEPARATOR" . "pns.ior"; $persistent_log_file = "$cwd$DIR_SEPARATOR" . "test_log"; $data_file = "$cwd$DIR_SEPARATOR" . "test_run.data"; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); sub name_server { @@ -83,8 +72,8 @@ sub client "-c file://$persistent_ior_file -ORBInitRef NameService=file://$iorfile"); @server_opts = ("", "", "", "", "", "", - "-ORBEndpoint iiop://localhost:$ns_orb_port -f $persistent_log_file", - "-ORBEndpoint iiop://localhost:$ns_orb_port -f $persistent_log_file"); + "-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port -f $persistent_log_file", + "-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port -f $persistent_log_file"); @comments = ("Simple Test: \n", "Simple Test (using multicast to locate the server): \n", diff --git a/TAO/orbsvcs/tests/Time/run_test.pl b/TAO/orbsvcs/tests/Time/run_test.pl index 1925e74a876..c722b9167f4 100755 --- a/TAO/orbsvcs/tests/Time/run_test.pl +++ b/TAO/orbsvcs/tests/Time/run_test.pl @@ -21,6 +21,8 @@ $status = 0; unlink $server_ior; unlink $clerk_ior; +ACE::checkForTarget($cwd); + $server_program = $EXEPREFIX."..$DIR_SEPARATOR..$DIR_SEPARATOR"."Time_Service".$DIR_SEPARATOR."Time_Service_Server".$EXE_EXT; $clerk_program = $EXEPREFIX."..$DIR_SEPARATOR..$DIR_SEPARATOR"."Time_Service".$DIR_SEPARATOR."Time_Service_Clerk".$EXE_EXT; $client_program = $EXEPREFIX."client".$EXE_EXT; @@ -130,17 +132,6 @@ for ($i = 0; $i <= $#ARGV; $i++) time_service_test_using_files (); last SWITCH; } - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - last SWITCH; - } print "run_test: Unknown Option: ".$ARGV[$i]."\n"; } } diff --git a/TAO/orbsvcs/tests/Trading/run_test.pl b/TAO/orbsvcs/tests/Trading/run_test.pl index f8b27908e05..64db13f49a1 100755 --- a/TAO/orbsvcs/tests/Trading/run_test.pl +++ b/TAO/orbsvcs/tests/Trading/run_test.pl @@ -19,18 +19,7 @@ $status = 0; unlink $ior; unlink $ready_file; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); $TS = Process::Create ($EXEPREFIX."..".$DIR_SEPARATOR. "..".$DIR_SEPARATOR. diff --git a/TAO/tests/AMI/run_test.pl b/TAO/tests/AMI/run_test.pl index 3fc3f449141..4b069ef43bb 100755 --- a/TAO/tests/AMI/run_test.pl +++ b/TAO/tests/AMI/run_test.pl @@ -16,29 +16,17 @@ $debug_level='5'; $threads='2'; $iterations='1'; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } - elsif ($ARGV[$i] eq '-mux') { +ACE::checkForTarget($cwd); +foreach $i (@ARGV) { + if ($i eq '-mux') { $client_conf = "muxed.conf"; - } - elsif ($ARGV[$i] eq '-debug') { + } elsif ($i eq '-debug') { $debug_level = '1'; - } - elsif ($ARGV[$i] eq '-exclusive') { + } elsif ($i eq '-exclusive') { $client_conf = 'exclusive.conf'; } } - $iorfile = "$cwd$DIR_SEPARATOR" . "server.ior"; $SV = Process::Create ($EXEPREFIX."server$EXE_EXT ", " -ORBdebuglevel $debug_level" diff --git a/TAO/tests/CDR/run_test.pl b/TAO/tests/CDR/run_test.pl index 45a624f538f..12472be6ec6 100755 --- a/TAO/tests/CDR/run_test.pl +++ b/TAO/tests/CDR/run_test.pl @@ -17,22 +17,10 @@ $brace="\#\#\#\#\#"; "allocator" => ""); $test = ""; $args = ""; -$cwd = getcwd(); $| = 1; print STDERR "\n"; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget(getcwd()); sub run_test { diff --git a/TAO/tests/Connection_Purging/run_test.pl b/TAO/tests/Connection_Purging/run_test.pl index 35ba3b40120..3b0c83e8a15 100755 --- a/TAO/tests/Connection_Purging/run_test.pl +++ b/TAO/tests/Connection_Purging/run_test.pl @@ -10,22 +10,9 @@ require Process; require ACEutils; use Cwd; -$cwd = getcwd(); -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget(getcwd()); -$T = Process::Create ($EXEPREFIX."Connection_Purging".$EXE_EXT, - "-ORBCollocation no -d"); +$T = Process::Create ($EXEPREFIX."Connection_Purging".$EXE_EXT." -ORBCollocation no -d"); $client = $T->TimedWait (60); if ($client == -1) { diff --git a/TAO/tests/DSI_Gateway/run_test.pl b/TAO/tests/DSI_Gateway/run_test.pl index d2000ddfadd..960b5e7a6d6 100755 --- a/TAO/tests/DSI_Gateway/run_test.pl +++ b/TAO/tests/DSI_Gateway/run_test.pl @@ -10,18 +10,7 @@ require ACEutils; use Cwd; $cwd = getcwd(); -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); $svfile = "$cwd$DIR_SEPARATOR" . "server.ior"; unlink $svfile; diff --git a/TAO/tests/DynAny_Test/run_test.pl b/TAO/tests/DynAny_Test/run_test.pl index 1751095d3f0..0b19dde15c1 100755 --- a/TAO/tests/DynAny_Test/run_test.pl +++ b/TAO/tests/DynAny_Test/run_test.pl @@ -10,10 +10,8 @@ require ACEutils; require Process; use Cwd; -$cwd = getcwd(); $type = ""; - sub run_test { my $type = shift(@_); @@ -30,6 +28,7 @@ sub run_test } # Parse the arguments +ACE::checkForTarget(getcwd()); for ($i = 0; $i <= $#ARGV; $i++) { @@ -43,16 +42,6 @@ for ($i = 0; $i <= $#ARGV; $i++) print "-t type -- runs only one type of dynany test\n"; exit; } - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } if ($ARGV[$i] eq "-t") { $type = $ARGV[$i + 1]; diff --git a/TAO/tests/Endpoint_Per_Priority/run_test.pl b/TAO/tests/Endpoint_Per_Priority/run_test.pl index 8d39e46f3df..c344a6c59d3 100755 --- a/TAO/tests/Endpoint_Per_Priority/run_test.pl +++ b/TAO/tests/Endpoint_Per_Priority/run_test.pl @@ -13,22 +13,9 @@ $cwd = getcwd(); $client_conf="$cwd$DIR_SEPARATOR" . "client.conf"; $server_conf="$cwd$DIR_SEPARATOR" . "server.conf"; $threads='2'; -$hostname = "localhost"; $iorfile = "$cwd$DIR_SEPARATOR" . "test.ior"; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - $hostname = $ARGV[$i]; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); print STDERR "================ Multi-threaded test\n"; @@ -37,11 +24,11 @@ unlink $iorfile; $SV = Process::Create ($EXEPREFIX."server$EXE_EXT ", " -ORBDebugLevel 5". " -ORBSvcConf $server_conf" - . " -ORBEndPoint iiop://$hostname:0/priority=0 " - . " -ORBEndPoint iiop://$hostname:0/priority=1 " - . " -ORBEndPoint iiop://$hostname:0/priority=2 " - . " -ORBEndPoint iiop://$hostname:0/priority=3 " - . " -ORBEndPoint iiop://$hostname:0/priority=4 " + . " -ORBEndPoint iiop://$TARGETHOSTNAME:0/priority=0 " + . " -ORBEndPoint iiop://$TARGETHOSTNAME:0/priority=1 " + . " -ORBEndPoint iiop://$TARGETHOSTNAME:0/priority=2 " + . " -ORBEndPoint iiop://$TARGETHOSTNAME:0/priority=3 " + . " -ORBEndPoint iiop://$TARGETHOSTNAME:0/priority=4 " . " -o $iorfile -n $threads"); if (ACE::waitforfile_timed ($iorfile, 10) == -1) { diff --git a/TAO/tests/Explicit_Event_Loop/run_test.pl b/TAO/tests/Explicit_Event_Loop/run_test.pl index 3061c93707b..bf4ae72ade1 100755 --- a/TAO/tests/Explicit_Event_Loop/run_test.pl +++ b/TAO/tests/Explicit_Event_Loop/run_test.pl @@ -12,18 +12,7 @@ require Process; use Cwd; $cwd = getcwd(); -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); $status = 0; $iorfile = "$cwd$DIR_SEPARATOR" . "chapter_test.ior"; diff --git a/TAO/tests/Faults/run_test.pl b/TAO/tests/Faults/run_test.pl index 3ad704f706f..b5af007f907 100755 --- a/TAO/tests/Faults/run_test.pl +++ b/TAO/tests/Faults/run_test.pl @@ -15,18 +15,7 @@ $middlefile = "$cwd$DIR_SEPARATOR" . "middle.ior"; $dum_core = "$cwd$DIR_SEPARATOR" . "core"; $status = 0; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); print STDERR "===== Base test, no crashes\n"; unlink $iorfile; diff --git a/TAO/tests/IORManipulation/run_test.pl b/TAO/tests/IORManipulation/run_test.pl index fe8bb4f8dfb..5134dea8b1d 100755 --- a/TAO/tests/IORManipulation/run_test.pl +++ b/TAO/tests/IORManipulation/run_test.pl @@ -10,20 +10,7 @@ require Process; require ACEutils; use Cwd; -$cwd = getcwd(); -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} - +ACE::checkForTarget(getcwd()); $T = Process::Create ($EXEPREFIX."IORTest".$EXE_EXT); diff --git a/TAO/tests/InterOp-Naming/run_test.pl b/TAO/tests/InterOp-Naming/run_test.pl index d0d76263225..2174fe04c22 100755 --- a/TAO/tests/InterOp-Naming/run_test.pl +++ b/TAO/tests/InterOp-Naming/run_test.pl @@ -12,28 +12,15 @@ use Cwd; $cwd = getcwd(); $file = "$cwd$DIR_SEPARATOR" . "test.ior"; -$port = ACE::uniqueid () + 10001; # This must be > 10000 for Chorus 4.0 -$hostname = "localhost"; - -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - $hostname = $ARGV[$i]; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +$port = ACE::uniqueid () + 10001; # This can't be 10000 for Chorus 4.0 + +ACE::checkForTarget($cwd); print STDERR "\n\n==== InitRef test\n"; unlink $file; $SV = Process::Create ($EXEPREFIX."INS_test_server".$EXE_EXT, - "-ORBEndpoint iiop://$hostname:$port " + "-ORBEndpoint iiop://$TARGETHOSTNAME:$port " . " -i object_name -o $file"); if (ACE::waitforfile_timed ($file, 5) == -1) { @@ -45,7 +32,7 @@ if (ACE::waitforfile_timed ($file, 5) == -1) { $CL = Process::Create ($EXEPREFIX."INS_test_client".$EXE_EXT, " random_service " ."-ORBInitRef random_service=" - ."iioploc://$hostname:$port/object_name"); + ."iioploc://$TARGETHOSTNAME:$port/object_name"); $client = $CL->TimedWait (60); if ($client == -1) { @@ -61,7 +48,7 @@ print STDERR "\n\n==== InvalidName test\n"; $CL = Process::Create ($EXEPREFIX."INS_test_client".$EXE_EXT, " not_a_service " ."-ORBInitRef random_service=" - ."iioploc://$hostname:$port/object_name"); + ."iioploc://$TARGETHOSTNAME:$port/object_name"); $client = $CL->TimedWait (60); if ($client == -1) { @@ -77,7 +64,7 @@ print STDERR "\n\n==== DefaultInitRef test\n"; $CL = Process::Create ($EXEPREFIX."INS_test_client".$EXE_EXT, " object_name " . "-ORBDefaultInitRef" - ." iioploc://$hostname:$port"); + ." iioploc://$TARGETHOSTNAME:$port"); $client = $CL->TimedWait (60); if ($client == -1) { @@ -97,9 +84,9 @@ $CL = Process::Create ($EXEPREFIX."INS_test_client".$EXE_EXT, " random_service " . "-ORBInitRef random_service=" ."iioploc://" - ."$hostname:$port1," - ."$hostname:$port2," - ."$hostname:$port" + ."$TARGETHOSTNAME:$port1," + ."$TARGETHOSTNAME:$port2," + ."$TARGETHOSTNAME:$port" ."/object_name"); $client = $CL->TimedWait (60); @@ -122,9 +109,9 @@ $CL = Process::Create ($EXEPREFIX."INS_test_client".$EXE_EXT, . " -l " . "-ORBInitRef random_service=" . "iioploc://" - . "$hostname:$port1," - . "$hostname:$port2," - . "$hostname:$port" + . "$TARGETHOSTNAME:$port1," + . "$TARGETHOSTNAME:$port2," + . "$TARGETHOSTNAME:$port" . "/object_name"); $client = $CL->TimedWait (60); @@ -142,9 +129,9 @@ $CL = Process::Create ($EXEPREFIX."INS_test_client".$EXE_EXT, " object_name " . "-ORBDefaultInitRef " ."iioploc://" - ."$hostname:$port1," - ."$hostname:$port2," - ."$hostname:$port"); + ."$TARGETHOSTNAME:$port1," + ."$TARGETHOSTNAME:$port2," + ."$TARGETHOSTNAME:$port"); $client = $CL->TimedWait (60); if ($client == -1) { @@ -161,7 +148,7 @@ $CL = Process::Create ($EXEPREFIX."INS_test_client".$EXE_EXT, " object_name " . "-ORBDefaultInitRef " ."iioploc://" - ."$hostname:$port/"); + ."$TARGETHOSTNAME:$port/"); $client = $CL->TimedWait (60); if ($client == -1) { diff --git a/TAO/tests/Interceptors/run_test.pl b/TAO/tests/Interceptors/run_test.pl index 3f83428fad3..5cf0a8ce597 100755 --- a/TAO/tests/Interceptors/run_test.pl +++ b/TAO/tests/Interceptors/run_test.pl @@ -11,18 +11,7 @@ require ACEutils; use Cwd; $cwd = getcwd(); -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); print STDERR "\n\n==== Running interceptor test\n"; diff --git a/TAO/tests/Leader_Followers/run_test.pl b/TAO/tests/Leader_Followers/run_test.pl index 95095cc49a7..5a730d0b2c2 100755 --- a/TAO/tests/Leader_Followers/run_test.pl +++ b/TAO/tests/Leader_Followers/run_test.pl @@ -12,18 +12,7 @@ use Cwd; $cwd = getcwd(); $iorfile = "$cwd$DIR_SEPARATOR" . "ior"; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); sub run_client { diff --git a/TAO/tests/MT_Client/run_test.pl b/TAO/tests/MT_Client/run_test.pl index 705c04c0c58..13bfa077f81 100755 --- a/TAO/tests/MT_Client/run_test.pl +++ b/TAO/tests/MT_Client/run_test.pl @@ -16,22 +16,13 @@ $debug_level='0'; $threads='10'; $status = 0; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } - elsif ($ARGV[$i] eq '-tss') { +ACE::checkForTarget($cwd); +foreach $i (@ARGV) { + if ($i eq '-tss') { $client_conf = "$cwd$DIR_SEPARATOR" . "client.tss.conf"; - } elsif ($ARGV[$i] eq '-debug') { + } elsif ($i eq '-debug') { $debug_level = '1'; - } elsif ($ARGV[$i] eq '-creation') { + } elsif ($i eq '-creation') { $client_process = 'orb_creation'; $threads='2'; } diff --git a/TAO/tests/MT_Server/run_test.pl b/TAO/tests/MT_Server/run_test.pl index c00ef771592..01481194105 100755 --- a/TAO/tests/MT_Server/run_test.pl +++ b/TAO/tests/MT_Server/run_test.pl @@ -13,18 +13,7 @@ $cwd = getcwd(); $threads='8'; $iorfile = "$cwd$DIR_SEPARATOR" . "test.ior"; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); $SV = Process::Create ($EXEPREFIX."server$EXE_EXT ", " -ORBsvcconf " . "$cwd$DIR_SEPARATOR" . "server.conf" diff --git a/TAO/tests/Multiple_Inheritance/run_test.pl b/TAO/tests/Multiple_Inheritance/run_test.pl index 04e84e018e2..cb48069a5c1 100755 --- a/TAO/tests/Multiple_Inheritance/run_test.pl +++ b/TAO/tests/Multiple_Inheritance/run_test.pl @@ -12,18 +12,7 @@ use Cwd; $cwd = getcwd(); $iorfile = "$cwd$DIR_SEPARATOR" . "server.ior"; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); $SV = Process::Create ($EXEPREFIX."server$EXE_EXT", " -f $iorfile"); diff --git a/TAO/tests/Native_Exceptions/run_test.pl b/TAO/tests/Native_Exceptions/run_test.pl index dcccc80f7a2..1feae5d78b9 100755 --- a/TAO/tests/Native_Exceptions/run_test.pl +++ b/TAO/tests/Native_Exceptions/run_test.pl @@ -14,18 +14,7 @@ $iorfile = "$cwd$DIR_SEPARATOR" ."test.ior"; unlink $iorfile; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); $SV = Process::Create ($EXEPREFIX."server$EXE_EXT ", " -o $iorfile"); diff --git a/TAO/tests/NestedUpcall/MT_Client_Test/run_test.pl b/TAO/tests/NestedUpcall/MT_Client_Test/run_test.pl index deb55a9f511..951f7db9774 100755 --- a/TAO/tests/NestedUpcall/MT_Client_Test/run_test.pl +++ b/TAO/tests/NestedUpcall/MT_Client_Test/run_test.pl @@ -14,18 +14,7 @@ $cwd = getcwd(); $ior1file = "$cwd$DIR_SEPARATOR" . "server1.ior"; $ior2file = "$cwd$DIR_SEPARATOR" . "server2.ior"; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); # Make sure the files are gone unlink $ior1file; diff --git a/TAO/tests/NestedUpcall/Simple/run_test.pl b/TAO/tests/NestedUpcall/Simple/run_test.pl index 4e59b0248e9..2ea90c54820 100755 --- a/TAO/tests/NestedUpcall/Simple/run_test.pl +++ b/TAO/tests/NestedUpcall/Simple/run_test.pl @@ -14,18 +14,7 @@ $iorfile = "$cwd$DIR_SEPARATOR" . "test.ior"; unlink $iorfile; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); print STDERR "\nrunning ST version of the client and the server\n\n"; diff --git a/TAO/tests/NestedUpcall/Triangle_Test/run_test.pl b/TAO/tests/NestedUpcall/Triangle_Test/run_test.pl index 4e25e20ebc3..7905fb9e200 100755 --- a/TAO/tests/NestedUpcall/Triangle_Test/run_test.pl +++ b/TAO/tests/NestedUpcall/Triangle_Test/run_test.pl @@ -14,18 +14,7 @@ $cwd = getcwd(); $ior1file = "$cwd$DIR_SEPARATOR" . "servera.ior"; $ior2file = "$cwd$DIR_SEPARATOR" . "serverb.ior"; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); # Make sure these aren't hanging around unlink $ior1file; diff --git a/TAO/tests/Nested_Event_Loop/run_test.pl b/TAO/tests/Nested_Event_Loop/run_test.pl index ba226acd8b6..9d1a922cb34 100755 --- a/TAO/tests/Nested_Event_Loop/run_test.pl +++ b/TAO/tests/Nested_Event_Loop/run_test.pl @@ -12,18 +12,7 @@ use Cwd; $cwd = getcwd(); $iorfile = "$cwd$DIR_SEPARATOR" . "ior"; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); unlink $iorfile; diff --git a/TAO/tests/ORB_init/run_test.pl b/TAO/tests/ORB_init/run_test.pl index 11ddb3fb203..b16a8040d18 100755 --- a/TAO/tests/ORB_init/run_test.pl +++ b/TAO/tests/ORB_init/run_test.pl @@ -9,19 +9,7 @@ unshift @INC, '../../../bin'; require ACEutils; use Cwd; -$cwd = getcwd(); -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget(getcwd()); $orb_init = Process::Create ($EXEPREFIX."ORB_init$EXE_EXT "); diff --git a/TAO/tests/OctetSeq/run_test.pl b/TAO/tests/OctetSeq/run_test.pl index a37a6d3336e..b79ea5331fe 100755 --- a/TAO/tests/OctetSeq/run_test.pl +++ b/TAO/tests/OctetSeq/run_test.pl @@ -11,18 +11,7 @@ require ACEutils; use Cwd; $cwd = getcwd(); -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); print STDERR "\n\n==== Octet sequence passing test\n"; diff --git a/TAO/tests/POA/Deactivation/run_test.pl b/TAO/tests/POA/Deactivation/run_test.pl index 6a02665cb74..a1856b59476 100755 --- a/TAO/tests/POA/Deactivation/run_test.pl +++ b/TAO/tests/POA/Deactivation/run_test.pl @@ -10,19 +10,7 @@ require Process; require ACEutils; use Cwd; -$cwd = getcwd(); -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget(getcwd()); $T = Process::Create ($EXEPREFIX."Deactivation".$EXE_EXT); diff --git a/TAO/tests/POA/Destruction/run_test.pl b/TAO/tests/POA/Destruction/run_test.pl index bb2b1c3531f..9a6c66ef400 100755 --- a/TAO/tests/POA/Destruction/run_test.pl +++ b/TAO/tests/POA/Destruction/run_test.pl @@ -10,19 +10,7 @@ require Process; require ACEutils; use Cwd; -$cwd = getcwd(); -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget(getcwd()); $T = Process::Create ($EXEPREFIX."Destruction".$EXE_EXT); diff --git a/TAO/tests/POA/Identity/run_test.pl b/TAO/tests/POA/Identity/run_test.pl index cf540e26f51..74067700fe1 100755 --- a/TAO/tests/POA/Identity/run_test.pl +++ b/TAO/tests/POA/Identity/run_test.pl @@ -10,19 +10,7 @@ require Process; require ACEutils; use Cwd; -$cwd = getcwd(); -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget(getcwd()); $T = Process::Create ($EXEPREFIX."Identity".$EXE_EXT); diff --git a/TAO/tests/Param_Test/run_test.pl b/TAO/tests/Param_Test/run_test.pl index 0fe3503c85f..1b6d31605ce 100755 --- a/TAO/tests/Param_Test/run_test.pl +++ b/TAO/tests/Param_Test/run_test.pl @@ -73,6 +73,9 @@ sub run_test "fixed_array", "var_array", "typecode", "exception", "big_union", "recursive_union", "complex_any"); + +ACE::checkForTarget($cwd); + for ($i = 0; $i <= $#ARGV; $i++) { SWITCH: @@ -91,17 +94,6 @@ for ($i = 0; $i <= $#ARGV; $i++) print "-chorus <target> -- Run tests on chorus target\n"; exit 0; } - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - last SWITCH; - } if ($ARGV[$i] eq "-n") { $num = $ARGV[$i + 1]; diff --git a/TAO/tests/Smart_Proxies/On_Demand/run_test.pl b/TAO/tests/Smart_Proxies/On_Demand/run_test.pl index fbc743d42be..107851f02c1 100755 --- a/TAO/tests/Smart_Proxies/On_Demand/run_test.pl +++ b/TAO/tests/Smart_Proxies/On_Demand/run_test.pl @@ -7,15 +7,19 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' unshift @INC, '../../../../bin'; require ACEutils; +use Cwd; -$iorfile = "test.ior"; +$cwd = getcwd(); +$iorfile = "$cwd$DIR_SEPARATOR" . "test.ior"; + +ACE::checkForTarget($cwd); unlink $iorfile; print STDERR "\nrunning Smart Proxy test consisting of the client and the server\n\n"; $SV = Process::Create ($EXEPREFIX."server".$EXE_EXT, - " -o $iorfile"); + " -o $iorfile"); if (ACE::waitforfile_timed ($iorfile, 5) == -1) { print STDERR "ERROR: cannot find file <$iorfile>\n"; @@ -23,7 +27,7 @@ if (ACE::waitforfile_timed ($iorfile, 5) == -1) { exit 1; } -$CL = Process::Create ($EXEPREFIX."client$EXE_EXT "); +$CL = Process::Create ($EXEPREFIX."client$EXE_EXT ", "-i file://$iorfile"); $client = $CL->TimedWait (60); if ($client == -1) { diff --git a/TAO/tests/Smart_Proxies/run_test.pl b/TAO/tests/Smart_Proxies/run_test.pl index 754498ea487..b6e9fff38d0 100755 --- a/TAO/tests/Smart_Proxies/run_test.pl +++ b/TAO/tests/Smart_Proxies/run_test.pl @@ -12,18 +12,7 @@ use Cwd; $cwd = getcwd(); $iorfile = "$cwd$DIR_SEPARATOR" . "test.ior"; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); unlink $iorfile; diff --git a/TAO/tests/Timed_Buffered_Oneways/run_test.pl b/TAO/tests/Timed_Buffered_Oneways/run_test.pl index b33ced012d6..3180b1a5c72 100755 --- a/TAO/tests/Timed_Buffered_Oneways/run_test.pl +++ b/TAO/tests/Timed_Buffered_Oneways/run_test.pl @@ -14,18 +14,7 @@ $iorfile = "$cwd$DIR_SEPARATOR" . "ior"; unlink $iorfile; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); $SV = Process::Create ($EXEPREFIX."server$EXE_EXT", "-o $iorfile"); diff --git a/TAO/tests/Timeout/run_test.pl b/TAO/tests/Timeout/run_test.pl index f1d48dca55f..02a96bb7954 100755 --- a/TAO/tests/Timeout/run_test.pl +++ b/TAO/tests/Timeout/run_test.pl @@ -15,18 +15,7 @@ $status = 0; $iorfile = "$cwd$DIR_SEPARATOR" . "server.ior"; unlink $iorfile; -for($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq '-chorus') { - $i++; - if (defined $ARGV[$i]) { - $EXEPREFIX = "rsh $ARGV[$i] arun $cwd$DIR_SEPARATOR"; - } - else { - print STDERR "The -chorus option requires the hostname of the target\n"; - exit(1); - } - } -} +ACE::checkForTarget($cwd); $SV = Process::Create ($EXEPREFIX."server$EXE_EXT ", " -o $iorfile"); diff --git a/bin/ACEutils.pm b/bin/ACEutils.pm index dd6474e7a0f..b16b4b09f94 100644 --- a/bin/ACEutils.pm +++ b/bin/ACEutils.pm @@ -2,9 +2,33 @@ require Process; $EXEPREFIX = ".".$DIR_SEPARATOR; +$TARGETHOSTNAME = "localhost"; package ACE; +sub checkForTarget +{ + my($cwd) = shift; + + for($i = 0; $i <= $#ARGV; $i++) { + if ($ARGV[$i] eq '-chorus') { + if (defined $ARGV[$i + 1]) { + $::TARGETHOSTNAME = $ARGV[$i + 1]; + $::EXEPREFIX = "rsh $::TARGETHOSTNAME arun $cwd$::DIR_SEPARATOR"; + } + else { + print STDERR "The -chorus option requires " . + "the hostname of the target\n"; + exit(1); + } + splice(@ARGV, $i, 2); + # Don't break from the loop just in case there + # is an accidental duplication of the -chorus option + } + } +} + + # Returns a unique id, uid for unix, last digit of IP for NT sub uniqueid { |