summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2002-11-01 13:31:47 +0000
committerbala <balanatarajan@users.noreply.github.com>2002-11-01 13:31:47 +0000
commit3aed1aec5640174f2161b3cbc355778935cbbb58 (patch)
tree45f44e20bc652f783f82367ba4355c4f24cded08
parentc1c7f1fea76c7ac93c292d3fbe463ce65ac92fc6 (diff)
downloadATCD-3aed1aec5640174f2161b3cbc355778935cbbb58.tar.gz
ChangeLogTag: Fri Nov 1 07:25:36 2002 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu>
-rw-r--r--TAO/ChangeLog14
-rw-r--r--TAO/tests/MProfile_Connection_Timeout/README24
-rw-r--r--TAO/tests/MProfile_Connection_Timeout/client.cpp22
-rwxr-xr-xTAO/tests/MProfile_Connection_Timeout/run_test.pl55
-rw-r--r--TAO/tests/MProfile_Connection_Timeout/server.cpp16
-rw-r--r--TAO/tests/MProfile_Connection_Timeout/test.idl2
-rw-r--r--TAO/tests/MProfile_Connection_Timeout/test_i.cpp9
-rw-r--r--TAO/tests/MProfile_Connection_Timeout/test_i.h4
8 files changed, 131 insertions, 15 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 218b582705f..ccea30277f1 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,17 @@
+Fri Nov 1 07:25:36 2002 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu>
+
+ * tests/MProfile_Connection_Timeout/README:
+ * tests/MProfile_Connection_Timeout/run_test.pl: Added these files
+ to the test.
+
+ * tests/MProfile_Connection_Timeout/client.cpp:
+ * tests/MProfile_Connection_Timeout/server.cpp:
+ * tests/MProfile_Connection_Timeout/test.idl:
+ * tests/MProfile_Connection_Timeout/test_i.cpp:
+ * tests/MProfile_Connection_Timeout/test_i.h: Improved error
+ checking so that any problems will be signalled as errors in our
+ daily builds.
+
Fri Nov 1 00:44:22 2002 Yamuna Krishnamurthy <yamuna@oomworks.com>
* orbsvcs/orbsvcs/Notify/Event_Map_T.h:
diff --git a/TAO/tests/MProfile_Connection_Timeout/README b/TAO/tests/MProfile_Connection_Timeout/README
new file mode 100644
index 00000000000..85dc6e4d7ed
--- /dev/null
+++ b/TAO/tests/MProfile_Connection_Timeout/README
@@ -0,0 +1,24 @@
+/**
+
+@page MProfile_Connection_Tiemout Test README File
+
+ The simplest possible test for connection timeouts across
+multiple profiles aka BUGID 1284. The aim of this test is to
+see whether TAO client fails over to the next profile if a connection
+timeout policy is set. If connection_timeout policy is set and if the
+client is not anle to establish connection using one of the profiles,
+the client should fail over to the next profile seamlessly. The test
+has been constructed to check for this feature.
+
+ Please refrain from "improving", extending or expanding this
+test.
+
+@todo: We need to write a MT test for this feature.
+
+ To run the test use the run_test.pl script:
+
+$ ./run_test.pl
+
+ the script returns 0 if the test was successful.
+
+*/
diff --git a/TAO/tests/MProfile_Connection_Timeout/client.cpp b/TAO/tests/MProfile_Connection_Timeout/client.cpp
index b8fbea3719a..7b94317b948 100644
--- a/TAO/tests/MProfile_Connection_Timeout/client.cpp
+++ b/TAO/tests/MProfile_Connection_Timeout/client.cpp
@@ -52,7 +52,7 @@ parse_args (int argc, char *argv[])
return 0;
}
-void
+CORBA::ULongLong
run_test (Simple_Server_ptr server
ACE_ENV_ARG_DECL);
@@ -148,7 +148,19 @@ main (int argc, char *argv[])
1);
}
- run_test (server.in () ACE_ENV_ARG_PARAMETER);
+ CORBA::ULongLong freq =
+ run_test (server.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (freq != 919263)
+ ACE_ERROR ((LM_ERROR,
+ ACE_LIB_TEXT ("(%P|%t) ERROR in the test \n")));
+
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_LIB_TEXT ("(%P|%t) Shutting server down \n")));
+
+ server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
}
ACE_CATCHANY
@@ -157,13 +169,13 @@ main (int argc, char *argv[])
return -1;
}
ACE_ENDTRY;
+
return 0;
}
-void
+CORBA::ULongLong
run_test (Simple_Server_ptr server
ACE_ENV_ARG_DECL)
{
- (void) server->remote_call (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK;
+ return server->remote_call (ACE_ENV_SINGLE_ARG_PARAMETER);
}
diff --git a/TAO/tests/MProfile_Connection_Timeout/run_test.pl b/TAO/tests/MProfile_Connection_Timeout/run_test.pl
new file mode 100755
index 00000000000..a34ece80af2
--- /dev/null
+++ b/TAO/tests/MProfile_Connection_Timeout/run_test.pl
@@ -0,0 +1,55 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../bin';
+use PerlACE::Run_Test;
+
+$iorfile1 = PerlACE::LocalFile ("server1.ior");
+$iorfile2 = PerlACE::LocalFile ("server2.ior");
+
+unlink $iorfile1;
+unlink $iorfile2;
+
+$status = 0;
+
+$SV1 = new PerlACE::Process ("server", "-o $iorfile1");
+$SV2 = new PerlACE::Process ("server", "-o $iorfile2 -r");
+$CL = new PerlACE::Process ("client", " -k file://$iorfile1 -m file://$iorfile2");
+
+$SV1->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile1, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile1>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ exit 1;
+}
+
+$SV2->Spawn ();
+if (PerlACE::waitforfile_timed ($iorfile2, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile2>\n";
+ $SV2->Kill (); $SV2->TimedWait (1);
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (300);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$server1 = $SV1->WaitKill (10);
+
+$server2 = $SV2->WaitKill (10);
+if ($server2 != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+unlink $iorfile1;
+unlink $iorfile2;
+
+exit $status;
diff --git a/TAO/tests/MProfile_Connection_Timeout/server.cpp b/TAO/tests/MProfile_Connection_Timeout/server.cpp
index 7e0f3640c6a..d5ef93472a2 100644
--- a/TAO/tests/MProfile_Connection_Timeout/server.cpp
+++ b/TAO/tests/MProfile_Connection_Timeout/server.cpp
@@ -8,11 +8,11 @@ ACE_RCSID(MProfile_Connection_Timeout,
"$Id$")
const char *ior_output_file = 0;
-
+int orb_run = 0;
int
parse_args (int argc, char *argv[])
{
- ACE_Get_Opt get_opts (argc, argv, "o:");
+ ACE_Get_Opt get_opts (argc, argv, "o:r");
int c;
while ((c = get_opts ()) != -1)
@@ -21,6 +21,9 @@ parse_args (int argc, char *argv[])
case 'o':
ior_output_file = get_opts.opt_arg ();
break;
+ case 'r':
+ orb_run = 1;
+ break;
case '?':
default:
ACE_ERROR_RETURN ((LM_ERROR,
@@ -93,9 +96,12 @@ main (int argc, char *argv[])
}
- // No need to run th eevnt loop. We want to exit anyway..
- /*orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;*/
+ // RUn the event loop if needed
+ if (orb_run)
+ {
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
ACE_DEBUG ((LM_DEBUG, "event loop finished\n"));
diff --git a/TAO/tests/MProfile_Connection_Timeout/test.idl b/TAO/tests/MProfile_Connection_Timeout/test.idl
index a87da7f07d6..bcb13ea9378 100644
--- a/TAO/tests/MProfile_Connection_Timeout/test.idl
+++ b/TAO/tests/MProfile_Connection_Timeout/test.idl
@@ -4,6 +4,6 @@
interface Simple_Server
{
- long remote_call ();
+ unsigned long long remote_call ();
oneway void shutdown ();
};
diff --git a/TAO/tests/MProfile_Connection_Timeout/test_i.cpp b/TAO/tests/MProfile_Connection_Timeout/test_i.cpp
index d7800953250..a2fccc999ef 100644
--- a/TAO/tests/MProfile_Connection_Timeout/test_i.cpp
+++ b/TAO/tests/MProfile_Connection_Timeout/test_i.cpp
@@ -6,6 +6,11 @@ ACE_RCSID(MProfile_Connection_Timeout,
test_i,
"$Id$")
+// part of the famous caesium 133 atom transition for a
+// second. Cannot represent the last part since the value gets out of
+// range.
+const CORBA::ULong freq = 919263;
+
Simple_Server_i::Simple_Server_i (CORBA::ORB_ptr orb)
: orb_ (CORBA::ORB::_duplicate (orb)),
val_ (1)
@@ -18,14 +23,14 @@ Simple_Server_i::Simple_Server_i (void)
// no-op
}
-CORBA::Long
+CORBA::ULongLong
Simple_Server_i::remote_call (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
ACE_DEBUG ((LM_DEBUG,
"Print out from process id (%P) hosting the servant \n"));
- return this->val_++;
+ return freq;
}
diff --git a/TAO/tests/MProfile_Connection_Timeout/test_i.h b/TAO/tests/MProfile_Connection_Timeout/test_i.h
index 3f86a458589..b9ce049710b 100644
--- a/TAO/tests/MProfile_Connection_Timeout/test_i.h
+++ b/TAO/tests/MProfile_Connection_Timeout/test_i.h
@@ -9,7 +9,7 @@
// test_i.h
//
// = AUTHOR
-// Carlos O'Ryan <coryan@uci.edu>
+// Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu>
//
// ============================================================================
@@ -34,7 +34,7 @@ public:
// ctor
// = The Simple_Server methods.
- CORBA::Long remote_call (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ CORBA::ULongLong remote_call (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException));
void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)