diff options
author | doccvs <doccvs@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-07-18 00:23:28 +0000 |
---|---|---|
committer | doccvs <doccvs@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-07-18 00:23:28 +0000 |
commit | 238c90d2cb0463214f6d73388370d041691ae990 (patch) | |
tree | 940bd3b764633da0f3426a3d2364dcb227782061 | |
parent | b143115a14f2ec214cb40c41e6da28c5eb466eec (diff) | |
download | ATCD-238c90d2cb0463214f6d73388370d041691ae990.tar.gz |
ChangeLogTag: Mon Jul 17 17:21:45 2000 Priyanka Gontla <pgontla@ece.uci.edu>
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 5 | ||||
-rwxr-xr-x | TAO/tests/ior_corbaloc/run_test.pl | 138 |
2 files changed, 143 insertions, 0 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 0a51a19249b..ce4bea654c6 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,8 @@ +Mon Jul 17 17:21:45 2000 Priyanka Gontla <pgontla@ece.uci.edu> + + * tests/ior_corbaloc/run_test.pl: Added the perl script to run the + test. + Mon Jul 17 10:41:08 2000 Priyanka Gontla <pgontla@ece.uci.edu> * tao/IIOP_Profile.cpp: Updated the default port number to '2809'. diff --git a/TAO/tests/ior_corbaloc/run_test.pl b/TAO/tests/ior_corbaloc/run_test.pl new file mode 100755 index 00000000000..819ac3ee1c6 --- /dev/null +++ b/TAO/tests/ior_corbaloc/run_test.pl @@ -0,0 +1,138 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +# This is a Perl Script that runs the corbaloc: style URL tests. +# It starts the servers and client. + +#use lib "../../../bin"; + +unshift @INC, '../../../bin'; +require Process; +require ACEutils; +require Uniqueid; +use Cwd; + +$cwd = getcwd(); +# Amount of delay (in seconds) between starting a server and a client +# to allow proper server initialization. +$sleeptime = 8; + +# Variables for command-line arguments to client and server +# executables. +$ns_multicast_port = 10001 + uniqueid (); # Can not be 10000 on Chorus 4.0 +$ns_orb_port = 12000 + uniqueid (); +$iorfile = "$cwd$DIR_SEPARATOR" . "ns.ior"; + +ACE::checkForTarget($cwd); + +sub name_server +{ + my $args = "@_"." -ORBnameserviceport $ns_multicast_port -o $iorfile"; + my $prog = $EXEPREFIX."..$DIR_SEPARATOR..$DIR_SEPARATOR..$DIR_SEPARATOR". + "TAO".$DIR_SEPARATOR."orbsvcs".$DIR_SEPARATOR. + "Naming_Service".$DIR_SEPARATOR. + "Naming_Service".$EXE_EXT; + + # Make sure the files are gone, so we can wait on them. + unlink $iorfile; + + $NS = Process::Create ($prog, $args); + + if (ACE::waitforfile_timed ($iorfile, $sleeptime) == -1) { + print STDERR "ERROR: cannot find IOR file <$iorfile>\n"; + $NS->Kill (); $NS->TimedWait (1); + exit 1; + } +} + +sub server +{ + my $args = "@_"." -ORBInitRef NameService=file://$iorfile"; + my $prog = $EXEPREFIX."server".$EXE_EXT; + + $SR = Process::Create ($prog, $args); + + $server = $SR->TimedWait (20); +} + +sub client +{ + my $args = "@_"." -ORBInitRef NameService=file://$iorfile"; + my $prog = $EXEPREFIX."client".$EXE_EXT; + + $CL = Process::Create ($prog, $args); + + $client = $CL->TimedWait (60); + if ($client == -1) { + print STDERR "ERROR: client timedout\n"; + $CL->Kill (); $CL->TimedWait (1); + } +} + +# Options for all simple tests recognized by the 'client' program. +@opts = ("corbaloc:rir:/NameService", + "corbaloc:rir:/", + "corbaloc:iiop://$TARGETHOSTNAME:$ns_orb_port/NameService", + "corbaloc:iiop://:$ns_orb_port/NameService", + "corbaloc:///NameService", + "corbaloc://$TARGETHOSTNAME:$ns_orb_port/NameService"); + + +$def_port = 2809; + +@name_server_opts = ("-ORBEndPoint iiop://$TARGETHOSTNAME:$ns_orb_port", + "-ORBEndPoint iiop://$TARGETHOSTNAME:$ns_orb_port", + "-ORBEndPoint iiop://$TARGETHOSTNAME:$ns_orb_port", + "-ORBEndPoint iiop://$TARGETHOSTNAME:$ns_orb_port", + "-ORBEndPoint iiop://$TARGETHOSTNAME:$def_port", + "-ORBEndPoint iiop://$TARGETHOSTNAME:$ns_orb_port"); + + +@comments = ("Using RIR protocol with the Key object specified: \n", + "Using RIR protocol without specifying the key object: \n", + "Using IIOP protocol with the hostname, port specified: \n", + "Using IIOP protocol with the hostname unspecified but port specified: \n", + "Using IIOP protocol with both hostname & port unspecified: \n", + "Using the default protocol (iiop) with the hostname, port specified: \n"); + +$test_number = 0; + +# Run the naming service, server. Run the client for each of the test. +# Client uses ior in a file to bootstrap to the server. + +foreach $o (@opts) +{ + name_server ($name_server_opts [$test_number]); + + print STDERR "\n ".$comments[$test_number]; + + server (); + + client ($o); + + $NS->Terminate (); + $nser = $NS->TimedWait (60); + + if ($nser == -1) + { + print STDERR "ERROR: name server Timedout\n"; + $NS->Kill (); $NS->TimedWait (1); + } + + $SR->Terminate (); + $ser = $NS->TimedWait (60); + + if ($ser == -1) + { + $NS->Kill (); $NS->TimedWait (1); + } + + $test_number++; + +} + +exit 0; |