summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Interoperable_Naming/run_test.pl
diff options
context:
space:
mode:
authordoccvs <doccvs@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-06-20 00:25:45 +0000
committerdoccvs <doccvs@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-06-20 00:25:45 +0000
commite48c689f13584b0943bfedcfab657d89b3d7a6fb (patch)
tree4b1fde285fd4f4ae646a6995921f2c2cb52bf677 /TAO/orbsvcs/tests/Interoperable_Naming/run_test.pl
parentecb685bdb2eb7ac82f3e85e33786d8b85efa968f (diff)
downloadATCD-e48c689f13584b0943bfedcfab657d89b3d7a6fb.tar.gz
ChangeLogTag: Mon Jun 19 17:14:25 2000 Priyanka Gontla <pgontla@ece.uci.edu>
Diffstat (limited to 'TAO/orbsvcs/tests/Interoperable_Naming/run_test.pl')
-rwxr-xr-xTAO/orbsvcs/tests/Interoperable_Naming/run_test.pl78
1 files changed, 78 insertions, 0 deletions
diff --git a/TAO/orbsvcs/tests/Interoperable_Naming/run_test.pl b/TAO/orbsvcs/tests/Interoperable_Naming/run_test.pl
new file mode 100755
index 00000000000..64c6ac10bee
--- /dev/null
+++ b/TAO/orbsvcs/tests/Interoperable_Naming/run_test.pl
@@ -0,0 +1,78 @@
+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 NamingContextExt test. It starts
+# the Naming service, server and the client as necessary
+
+unshift @INC, '../../../../../ACE_wrappers/bin';
+require Process;
+require ACEutils;
+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
+$iorfile = "$cwd$DIR_SEPARATOR" . "ns.ior";
+
+ACE::checkForTarget($cwd);
+
+sub name_server
+ {
+ my $args = "@_"." -o $iorfile";
+ my $prog = $EXEPREFIX."..$DIR_SEPARATOR..$DIR_SEPARATOR..$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 client
+ {
+ my $args = "@_"." ";
+ 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 the tests recognized by the 'client' program
+$opts = "-s -ORBInitRef NameService=file://$iorfile";
+
+# Run the server and client for the test.
+#
+name_server ();
+client ($opts);
+
+$NS->Terminate (); $server = $NS->TimedWait (5);
+if ($server == -1)
+ {
+ print STDERR "ERROR: server timedout\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ }
+
+exit 0;