diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2014-10-24 07:27:25 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2014-10-24 07:27:25 +0000 |
commit | 7b0f4ea86291cbe8ba331d8d4a27f218e02fa75c (patch) | |
tree | 0b52a6e820e0b8c8741f6e23285b99de5ad0ba2b | |
parent | b441391262639bee4242e0c042907bb875659b98 (diff) | |
download | ATCD-7b0f4ea86291cbe8ba331d8d4a27f218e02fa75c.tar.gz |
Fri Oct 24 07:25:44 UTC 2014 Johnny Willemsen <jwillemsen@remedy.nl>
* bin/tao_other_tests.lst:
Added new unit tests
* orbsvcs/ImplRepo_Service/Server_Info.h:
* orbsvcs/examples/Notify/Filter/Filter.cpp:
* orbsvcs/examples/Notify/Subscribe/Subscribe.cpp:
* orbsvcs/tests/Notify/Basic/Sequence.cpp:
Layout changes
* orbsvcs/ImplRepo_Service/tao_imr_i.cpp:
Unicode logging fixes
* orbsvcs/tests/ImplRepo/NameService/test.cpp:
Added orb shutdown to reduce amount of valgrind reported
leaks
* orbsvcs/tests/ImplRepo/NotifyService/ImplRepo_NotifyService.mpc:
* orbsvcs/tests/ImplRepo/NotifyService/README:
* orbsvcs/tests/ImplRepo/NotifyService/run_test.pl:
* orbsvcs/tests/ImplRepo/NotifyService/test.cpp:
New test to reproduce bugzilla 4187, the notification
service can't be started by the ImR right now, have to fix
this
* orbsvcs/tests/ImplRepo/RestartServer/Messenger.idl:
* orbsvcs/tests/ImplRepo/RestartServer/MessengerClient.cpp:
* orbsvcs/tests/ImplRepo/RestartServer/run_test.pl:
Extended this test so that it can also run with manual
start, which reproduces bugzilla 4186
* tao/ImR_Client/ImR_Client.cpp:
Updated logging statements to be uniform and also that
we can easily determine that they are from the ImR_Client
-rw-r--r-- | TAO/ChangeLog | 36 | ||||
-rw-r--r-- | TAO/bin/tao_other_tests.lst | 2 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/Server_Info.h | 3 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/tao_imr_i.cpp | 6 | ||||
-rw-r--r-- | TAO/orbsvcs/examples/Notify/Filter/Filter.cpp | 4 | ||||
-rw-r--r-- | TAO/orbsvcs/examples/Notify/Subscribe/Subscribe.cpp | 7 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/ImplRepo/NameService/test.cpp | 2 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/ImplRepo/NotifyService/ImplRepo_NotifyService.mpc | 6 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/ImplRepo/NotifyService/README | 5 | ||||
-rwxr-xr-x | TAO/orbsvcs/tests/ImplRepo/NotifyService/run_test.pl | 207 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/ImplRepo/NotifyService/test.cpp | 35 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/ImplRepo/RestartServer/Messenger.idl | 8 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/ImplRepo/RestartServer/MessengerClient.cpp | 59 | ||||
-rwxr-xr-x | TAO/orbsvcs/tests/ImplRepo/RestartServer/run_test.pl | 30 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/Notify/Basic/Sequence.cpp | 11 | ||||
-rw-r--r-- | TAO/tao/ImR_Client/ImR_Client.cpp | 41 |
16 files changed, 399 insertions, 63 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 7e3bee67cea..d08844ba2df 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,39 @@ +Fri Oct 24 07:25:44 UTC 2014 Johnny Willemsen <jwillemsen@remedy.nl> + + * bin/tao_other_tests.lst: + Added new unit tests + + * orbsvcs/ImplRepo_Service/Server_Info.h: + * orbsvcs/examples/Notify/Filter/Filter.cpp: + * orbsvcs/examples/Notify/Subscribe/Subscribe.cpp: + * orbsvcs/tests/Notify/Basic/Sequence.cpp: + Layout changes + + * orbsvcs/ImplRepo_Service/tao_imr_i.cpp: + Unicode logging fixes + + * orbsvcs/tests/ImplRepo/NameService/test.cpp: + Added orb shutdown to reduce amount of valgrind reported + leaks + + * orbsvcs/tests/ImplRepo/NotifyService/ImplRepo_NotifyService.mpc: + * orbsvcs/tests/ImplRepo/NotifyService/README: + * orbsvcs/tests/ImplRepo/NotifyService/run_test.pl: + * orbsvcs/tests/ImplRepo/NotifyService/test.cpp: + New test to reproduce bugzilla 4187, the notification + service can't be started by the ImR right now, have to fix + this + + * orbsvcs/tests/ImplRepo/RestartServer/Messenger.idl: + * orbsvcs/tests/ImplRepo/RestartServer/MessengerClient.cpp: + * orbsvcs/tests/ImplRepo/RestartServer/run_test.pl: + Extended this test so that it can also run with manual + start, which reproduces bugzilla 4186 + + * tao/ImR_Client/ImR_Client.cpp: + Updated logging statements to be uniform and also that + we can easily determine that they are from the ImR_Client + Thu Oct 23 21:43:09 UTC 2014 Phil Mesnier <mesnier_p@ociweb.com> * orbsvcs/ImplRepo_Service/AsyncAccessManager.h: diff --git a/TAO/bin/tao_other_tests.lst b/TAO/bin/tao_other_tests.lst index 8eae2e5c65b..f01ced68c5e 100644 --- a/TAO/bin/tao_other_tests.lst +++ b/TAO/bin/tao_other_tests.lst @@ -127,6 +127,7 @@ TAO/orbsvcs/tests/ImplRepo/run_test.pl persistent_listingcorrupt -replica: !MINI TAO/orbsvcs/tests/ImplRepo/run_test.pl persistent_activatorcorrupt -replica: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !Win32 TAO/orbsvcs/tests/ImplRepo/run_test.pl persistent_servercorrupt -replica: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !Win32 TAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/NotifyService/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO TAO/orbsvcs/tests/ImplRepo/double_start/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS !Win32 TAO/orbsvcs/tests/ImplRepo/double_start/run_test.pl -kill: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS !Win32 !FIXED_BUGS_ONLY TAO/orbsvcs/tests/ImplRepo/kill_server/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !LynxOS !ACE_FOR_TAO @@ -146,6 +147,7 @@ TAO/orbsvcs/tests/ImplRepo/ReconnectServer/run_test.pl -forwardalways: !MINIMUM TAO/orbsvcs/tests/ImplRepo/ReconnectServer/run_test.pl -forwardonce: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS TAO/orbsvcs/tests/ImplRepo/ReconnectServer/run_test.pl -pingexternal: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS TAO/orbsvcs/tests/ImplRepo/RestartServer/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS !OpenVMS +TAO/orbsvcs/tests/ImplRepo/RestartServer/run_test.pl -manual: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS !OpenVMS TAO/orbsvcs/tests/ImplRepo/servers_interact_on_startup/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS !OpenVMS TAO/orbsvcs/tests/ImplRepo/servers_interact_on_startup/run_test.pl -delay 20 -imr_start: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS !OpenVMS TAO/orbsvcs/tests/ImplRepo/servers_interact_on_startup/run_test.pl -hide_server -imr_start: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS !OpenVMS diff --git a/TAO/orbsvcs/ImplRepo_Service/Server_Info.h b/TAO/orbsvcs/ImplRepo_Service/Server_Info.h index 9676bd01501..6f84d02eeb3 100644 --- a/TAO/orbsvcs/ImplRepo_Service/Server_Info.h +++ b/TAO/orbsvcs/ImplRepo_Service/Server_Info.h @@ -43,8 +43,7 @@ struct Server_Info int start_limit, const ACE_CString& partial_ior = ACE_CString(""), const ACE_CString& server_ior = ACE_CString(""), - ImplementationRepository::ServerObject_ptr svrobj = ImplementationRepository::ServerObject::_nil() - ); + ImplementationRepository::ServerObject_ptr svrobj = ImplementationRepository::ServerObject::_nil()); Server_Info (const ACE_CString& serverId, const ACE_CString& pname, diff --git a/TAO/orbsvcs/ImplRepo_Service/tao_imr_i.cpp b/TAO/orbsvcs/ImplRepo_Service/tao_imr_i.cpp index 8d7b0fb7317..8f984bc2f44 100644 --- a/TAO/orbsvcs/ImplRepo_Service/tao_imr_i.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/tao_imr_i.cpp @@ -217,8 +217,8 @@ TAO_IMR_Op::display_server_information (const ImplementationRepository::ServerIn } ORBSVCS_DEBUG ((LM_DEBUG, - " Activator: %s\n" - " Command Line: %s\n" + " Activator: %C\n" + " Command Line: %C\n" " Working Directory: %s\n" " Activation Mode: %C\n" " Number of retries: %d\n" @@ -239,7 +239,7 @@ TAO_IMR_Op::display_server_information (const ImplementationRepository::ServerIn " No running info available for PER_CLIENT mode\n")); else if (ACE_OS::strlen (info.partial_ior.in ()) > 0) ORBSVCS_DEBUG ((LM_DEBUG, - " Running at endpoint: %s\n", + " Running at endpoint: %C\n", info.partial_ior.in ())); else // I am assuming that a blank partial_ior means currently not running. ORBSVCS_DEBUG ((LM_DEBUG, diff --git a/TAO/orbsvcs/examples/Notify/Filter/Filter.cpp b/TAO/orbsvcs/examples/Notify/Filter/Filter.cpp index db8e31cc3ea..72856f1663e 100644 --- a/TAO/orbsvcs/examples/Notify/Filter/Filter.cpp +++ b/TAO/orbsvcs/examples/Notify/Filter/Filter.cpp @@ -2,8 +2,6 @@ #include "Filter.h" - - #define NOTIFY_FACTORY_NAME "NotifyEventChannelFactory" #define NAMING_SERVICE_NAME "NameService" #define CA_FILTER "threshold < 20" @@ -13,7 +11,7 @@ #define EVENTS_TO_SEND 30 #define EVENTS_EXPECTED_TO_RECEIVE 9*4 // 2 consumers get the same events from 2 suppliers - ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> g_result_count = 0; +ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> g_result_count = 0; FilterClient::FilterClient (void) :done_ (0) diff --git a/TAO/orbsvcs/examples/Notify/Subscribe/Subscribe.cpp b/TAO/orbsvcs/examples/Notify/Subscribe/Subscribe.cpp index 527c1eb5c0d..a65f300fb3a 100644 --- a/TAO/orbsvcs/examples/Notify/Subscribe/Subscribe.cpp +++ b/TAO/orbsvcs/examples/Notify/Subscribe/Subscribe.cpp @@ -1,8 +1,6 @@ /* -*- C++ -*- $Id$ */ #include "Subscribe.h" - - #define NOTIFY_FACTORY_NAME "NotifyEventChannelFactory" #define NAMING_SERVICE_NAME "NameService" @@ -16,7 +14,7 @@ #define EVENT_COUNT 4 // number of events we expect the consumer to get from the EC - ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> g_result_count = 0; // we wait for 4 events. +ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> g_result_count = 0; // we wait for 4 events. Subscribe::Subscribe (void) : done_ (0) @@ -299,8 +297,7 @@ Subscribe_StructuredPushConsumer::disconnect (void) void Subscribe_StructuredPushConsumer::offer_change (const CosNotification::EventTypeSeq & /*added*/, - const CosNotification::EventTypeSeq & /*removed*/ - ) + const CosNotification::EventTypeSeq & /*removed*/) { // No-Op. } diff --git a/TAO/orbsvcs/tests/ImplRepo/NameService/test.cpp b/TAO/orbsvcs/tests/ImplRepo/NameService/test.cpp index 30bfdb277e5..fe6eb88b04a 100644 --- a/TAO/orbsvcs/tests/ImplRepo/NameService/test.cpp +++ b/TAO/orbsvcs/tests/ImplRepo/NameService/test.cpp @@ -32,6 +32,8 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) inc->bind (name, ns_obj.in ()); ACE_DEBUG ((LM_DEBUG, "Test Successful\n")); + + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/orbsvcs/tests/ImplRepo/NotifyService/ImplRepo_NotifyService.mpc b/TAO/orbsvcs/tests/ImplRepo/NotifyService/ImplRepo_NotifyService.mpc new file mode 100644 index 00000000000..cf4a2b1804a --- /dev/null +++ b/TAO/orbsvcs/tests/ImplRepo/NotifyService/ImplRepo_NotifyService.mpc @@ -0,0 +1,6 @@ +// -*- MPC -*- +// $Id$ + +project: notification_skel, notify_serv, svc_utils, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro { +} + diff --git a/TAO/orbsvcs/tests/ImplRepo/NotifyService/README b/TAO/orbsvcs/tests/ImplRepo/NotifyService/README new file mode 100644 index 00000000000..2bc8ce33054 --- /dev/null +++ b/TAO/orbsvcs/tests/ImplRepo/NotifyService/README @@ -0,0 +1,5 @@ +$Id$ + +================================================================================ +Soon there will be a test to show off how the Implementation Repository can +automatically activate the Notify service. diff --git a/TAO/orbsvcs/tests/ImplRepo/NotifyService/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/NotifyService/run_test.pl new file mode 100755 index 00000000000..14fd43ca7ec --- /dev/null +++ b/TAO/orbsvcs/tests/ImplRepo/NotifyService/run_test.pl @@ -0,0 +1,207 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::TestTarget; + +$status = 0; +$debug_level = '0'; + +foreach $i (@ARGV) { + if ($i eq '-debug') { + $debug_level = '10'; + } +} + +my $imr = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n"; +my $act = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n"; +my $ti = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n"; +my $ns = PerlACE::TestTarget::create_target (4) || die "Create target 4 failed\n"; +my $test = PerlACE::TestTarget::create_target (5) || die "Create target 5 failed\n"; + +################################################################################ +# Program locations + +$imriorfile = "imr.ior"; +$nsiorfile = "name.ior"; +$actiorfile = "activator.ior"; + +my $imr_imriorfile = $imr->LocalFile ($imriorfile); +my $act_imriorfile = $act->LocalFile ($imriorfile); +my $ti_imriorfile = $ti->LocalFile ($imriorfile); +my $ns_imriorfile = $ns->LocalFile ($imriorfile); +my $act_actiorfile = $act->LocalFile ($actiorfile); +my $ns_nsiorfile = $ns->LocalFile ($nsiorfile); +my $test_nsiorfile = $test->LocalFile ($nsiorfile); + +$IMR = $imr->CreateProcess ("../../../ImplRepo_Service/tao_imr_locator"); + +$ACT = $act->CreateProcess ("../../../ImplRepo_Service/tao_imr_activator"); + +$NS = $ns->CreateProcess ("../../../Notify_Service/tao_cosnotification"); +my $ns_cmd = $NS->Executable(); +my $ns_ns_cmd = $imr->LocalFile ($ns_cmd); + +$TI = $ti->CreateProcess ("$ENV{ACE_ROOT}/bin/tao_imr"); +# We want the tao_imr executable to be found exactly in the path +# given, without being modified by the value of -ExeSubDir. +# So, we tell its Process object to ignore the setting of -ExeSubDir. +$TI->IgnoreExeSubDir (1); + +$TEST = $test->CreateProcess ("test"); + +################################################################################ + +$imr->DeleteFile ($imriorfile); +$act->DeleteFile ($imriorfile); +$ti->DeleteFile ($imriorfile); +$ns->DeleteFile ($imriorfile); +$act->DeleteFile ($actiorfile); +$ns->DeleteFile ($nsiorfile); +$test->DeleteFile ($nsiorfile); + +################################################################################ +## Start the implementation Repository + +$IMR->Arguments ("-o $imr_imriorfile -d 2 -ORBDebugLevel $debug_level"); +$IMR_status = $IMR->Spawn (); +if ($IMR_status != 0) { + print STDERR "ERROR: ImplRepo Service returned $IMR_status\n"; + exit 1; +} +if ($imr->WaitForFileTimed ($imriorfile,$imr->ProcessStartWaitInterval()) == -1) { + print STDERR "ERROR: cannot find file <$imr_imriorfile>\n"; + $IMR->Kill (); $IMR->TimedWait (1); + exit 1; +} +if ($imr->GetFile ($imriorfile) == -1) { + print STDERR "ERROR: cannot retrieve file <$imr_imriorfile>\n"; + $IMR->Kill (); $IMR->TimedWait (1); + exit 1; +} +if ($act->PutFile ($imriorfile) == -1) { + print STDERR "ERROR: cannot set file <$act_imriorfile>\n"; + $IMR->Kill (); $IMR->TimedWait (1); + exit 1; +} +if ($ti->PutFile ($imriorfile) == -1) { + print STDERR "ERROR: cannot set file <$ti_imriorfile>\n"; + $IMR->Kill (); $IMR->TimedWait (1); + exit 1; +} +if ($ns->PutFile ($imriorfile) == -1) { + print STDERR "ERROR: cannot set file <$ns_imriorfile>\n"; + $IMR->Kill (); $IMR->TimedWait (1); + exit 1; +} + +$ACT->Arguments("-d 1 -o $act_actiorfile -ORBInitRef ImplRepoService=file://$act_imriorfile -ORBDebugLevel $debug_level"); +$ACT_status = $ACT->Spawn (); +if ($ACT_status != 0) { + print STDERR "ERROR: IMR Activator Service returned $ACT_status\n"; + exit 1; +} +if ($act->WaitForFileTimed ($actiorfile,$act->ProcessStartWaitInterval()) == -1) { + print STDERR "ERROR: cannot find file <$act_actiorfile>\n"; + $ACT->Kill (); $ACT->TimedWait (1); + $IMR->Kill (); $IMR->TimedWait (1); + exit 1; +} + +################################################################################ +## Register the NotifyService + +$TI->Arguments("-ORBInitRef ImplRepoService=file://$ti_imriorfile" + . " add NotifyService -c \"" + . "$ns_ns_cmd -ORBInitRef ImplRepoService=file://$imr_imriorfile -ORBUseIMR 1 -ORBDebugLevel $debug_level" + . "\""); + +$TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval()+45); +if ($TI_status != 0) { + print STDERR "ERROR: TAO IMR returned $TI_status\n"; + $ACT->Kill (); $ACT->TimedWait (1); + $IMR->Kill (); $IMR->TimedWait (1); + exit 1; +} + +################################################################################ +## Create IOR for NotifyService + +$TI->Arguments ("-ORBInitRef ImplRepoService=file://$ti_imriorfile ior NotifyService -f $ns_nsiorfile -ORBDebugLevel $debug_level"); +$TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval()+45); +if ($TI_status != 0) { + print STDERR "ERROR: TAO IMR returned $TI_status\n"; + $ACT->Kill (); $ACT->TimedWait (1); + $IMR->Kill (); $IMR->TimedWait (1); + exit 1; +} +if ($ns->WaitForFileTimed ($nsiorfile,$ns->ProcessStartWaitInterval()) == -1) { + print STDERR "ERROR: cannot find file <$ns_nsiorfile>\n"; + $ACT->Kill (); $ACT->TimedWait (1); + $IMR->Kill (); $IMR->TimedWait (1); + exit 1; +} +if ($ns->GetFile ($nsiorfile) == -1) { + print STDERR "ERROR: cannot retrieve file <$ns_nsiorfile>\n"; + $ACT->Kill (); $ACT->TimedWait (1); + $IMR->Kill (); $IMR->TimedWait (1); + exit 1; +} +if ($test->PutFile ($nsiorfile) == -1) { + print STDERR "ERROR: cannot set file <$test_nsiorfile>\n"; + $ACT->Kill (); $ACT->TimedWait (1); + $IMR->Kill (); $IMR->TimedWait (1); + exit 1; +} + +################################################################################ +## Run the test + +$TEST->Arguments ("-ORBInitRef NotifyService=file://$test_nsiorfile -ORBDebugLevel $debug_level"); +$TEST_status = $TEST->SpawnWaitKill ($test->ProcessStartWaitInterval()+45); +if ($TEST_status != 0) { + print STDERR "ERROR: test returned $TEST_status\n"; + $status = 1; +} + +################################################################################ +## Shutdown the NotifyService + +$TI->Arguments ("-ORBInitRef ImplRepoService=file://$imr_imriorfile shutdown " + . "NotifyService "); +$TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval()+45); +if ($TI_status != 0) { + print STDERR "ERROR: TAO IMR returned $TI_status\n"; + $status = 1; +} + +################################################################################ +## Kill the IMR + +$ACT_status = $ACT->TerminateWaitKill ($act->ProcessStopWaitInterval()); + +if ($ACT_status != 0) { + print STDERR "ERROR: IMR Activator returned $ACT_status\n"; + $status = 1; +} + +$IMR_status = $IMR->TerminateWaitKill ($imr->ProcessStopWaitInterval()); + +if ($IMR_status != 0) { + print STDERR "ERROR: ImplRepo Service returned $IMR_status\n"; + $status = 1; +} + +$imr->DeleteFile ($imriorfile); +$act->DeleteFile ($imriorfile); +$ti->DeleteFile ($imriorfile); +$ns->DeleteFile ($imriorfile); +$act->DeleteFile ($actiorfile); +$ns->DeleteFile ($nsiorfile); +$test->DeleteFile ($nsiorfile); + +exit $status; diff --git a/TAO/orbsvcs/tests/ImplRepo/NotifyService/test.cpp b/TAO/orbsvcs/tests/ImplRepo/NotifyService/test.cpp new file mode 100644 index 00000000000..c98fb9e284a --- /dev/null +++ b/TAO/orbsvcs/tests/ImplRepo/NotifyService/test.cpp @@ -0,0 +1,35 @@ +// $Id$ + +#include "orbsvcs/CosNotifyChannelAdminC.h" +#include "orbsvcs/CosNotifyCommC.h" +#include "ace/Log_Msg.h" + +int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) +{ + try + { + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + + CORBA::Object_var obj = + orb->resolve_initial_references ("NotifyService"); + + if (CORBA::is_nil (obj.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + "Could not resolve Notify Service"), + 1); + + CosNotifyChannelAdmin::EventChannelFactory_var notify_factory_ = + CosNotifyChannelAdmin::EventChannelFactory::_narrow (obj.in ()); + + orb->destroy (); + + ACE_DEBUG ((LM_DEBUG, "Test Successful\n")); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Test"); + return 1; + } + + return 0; +} diff --git a/TAO/orbsvcs/tests/ImplRepo/RestartServer/Messenger.idl b/TAO/orbsvcs/tests/ImplRepo/RestartServer/Messenger.idl index 42a6b413857..5860f3ef5d6 100644 --- a/TAO/orbsvcs/tests/ImplRepo/RestartServer/Messenger.idl +++ b/TAO/orbsvcs/tests/ImplRepo/RestartServer/Messenger.idl @@ -2,13 +2,13 @@ interface Messenger { - boolean send_message ( in string user_name, - in string subject, - inout string message ); + boolean send_message (in string user_name, + in string subject, + inout string message); // After replying, abort process in // delay_secs seconds. - void abort ( in short delay_secs ); + void abort (in short delay_secs); // Perform a graceful shutdown. oneway void shutdown (); diff --git a/TAO/orbsvcs/tests/ImplRepo/RestartServer/MessengerClient.cpp b/TAO/orbsvcs/tests/ImplRepo/RestartServer/MessengerClient.cpp index 1c4daf1fc00..96bc33660d4 100644 --- a/TAO/orbsvcs/tests/ImplRepo/RestartServer/MessengerClient.cpp +++ b/TAO/orbsvcs/tests/ImplRepo/RestartServer/MessengerClient.cpp @@ -7,11 +7,15 @@ const ACE_TCHAR *ior = ACE_TEXT("file://Messenger.ior"); int seconds_between_requests = 4; +// Number of times we try to invoke the operation +int number_of_tries = 2; +// Number of times the invocation should succeed +int number_of_succeed = 2; int parse_args (int argc, ACE_TCHAR *argv[]) { - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:d:")); + ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:d:t:s:")); int c; while ((c = get_opts ()) != -1) @@ -25,12 +29,22 @@ parse_args (int argc, ACE_TCHAR *argv[]) seconds_between_requests = ACE_OS::atoi (get_opts.opt_arg ()); break; + case 't': + number_of_tries = ACE_OS::atoi (get_opts.opt_arg ()); + break; + + case 's': + number_of_succeed = ACE_OS::atoi (get_opts.opt_arg ()); + break; + case '?': default: ACE_ERROR_RETURN ((LM_ERROR, "usage: %s " "-k <ior> " "-d <seconds> (Delay between requests) " + "-t <number> (Number of times we try the invocation) " + "-s <number> (Number of times the invocation should succeed) " "\n", argv [0]), -1); @@ -42,7 +56,6 @@ parse_args (int argc, ACE_TCHAR *argv[]) int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { - // Detection of closed on read currently not working certain platforms. #if defined (sun) || defined (AIX) || defined (__FreeBSD_version) return 2; @@ -71,19 +84,43 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) CORBA::String_var message = CORBA::string_dup( "Hello!" ); - messenger->send_message( "TAO User", "Test 1", message.inout() ); + int try_count = 0; + int succeeded = 0; + for (; try_count < number_of_tries; ++try_count) + { + ACE_DEBUG ((LM_INFO, + "(%P|%t) - Sending message <%d> to server\n", try_count)); + + try { + messenger->send_message( "TAO User", "Test 1", message.inout() ); - // Force server to abort to verify it will be brought - // back up when send_message() is called. - messenger->abort(2); - ACE_OS::sleep(seconds_between_requests); + ACE_DEBUG ((LM_INFO, + "(%P|%t) - Successfully received response for message <%d> to server\n", try_count)); + ++succeeded; - ACE_DEBUG ((LM_INFO, - "(%P|%t) - Sending another message after abort of server\n")); + // Force server to abort to verify it will be brought + // back up when send_message() is called. + messenger->abort(2); + ACE_OS::sleep(seconds_between_requests); + } + catch (const CORBA::Exception&) + { + // Swallow + } + } - messenger->send_message( "TAO User", "Test 2", message.inout() ); + if (succeeded == number_of_succeed) + { + ACE_DEBUG ((LM_INFO, + "(%P|%t) - <%d> Messages where send to the server, <%d> succeeded\n", try_count, succeeded)); + } + else + { + ACE_ERROR ((LM_INFO, + "(%P|%t) - ERROR: <%d> Messages where send to the server, <%d> succeeded, should be <%d>\n", try_count, succeeded, number_of_succeed)); + } - std::cout << "messages were sent" << std::endl; + orb->destroy (); } catch(const CORBA::Exception& ex) { std::cerr << "Client main() Caught CORBA::Exception: " << ex << std::endl; diff --git a/TAO/orbsvcs/tests/ImplRepo/RestartServer/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/RestartServer/run_test.pl index 0f1b0335f60..4c23629eaf7 100755 --- a/TAO/orbsvcs/tests/ImplRepo/RestartServer/run_test.pl +++ b/TAO/orbsvcs/tests/ImplRepo/RestartServer/run_test.pl @@ -10,13 +10,22 @@ use PerlACE::TestTarget; $status = 0; $debug_level = '0'; $mode = "-a NORMAL "; +$start_limit = 1; +$number_tries = 2; +$number_succeed = 2; foreach $i (@ARGV) { if ($i eq '-debug') { $debug_level = '10'; } elsif ($i eq '-manual') { + # in manual mode the server is manually started, so it should + # just succeed once $mode = "-a MANUAL "; + $number_succeed = 1; + } + elsif ($i eq '-start_limit') { + $start_limit = "1"; } } @@ -93,16 +102,14 @@ $TI = $ti->CreateProcess ($tao_imr, $mode . "-c \"$srv_server -orbobjrefstyle url -ORBUseIMR 1 -ORBInitRef ImplRepoService=file://$imr_imriorfile\" "); - - $SI = $si->CreateProcess ($tao_imr, "-ORBInitRef ImplRepoService=file://$si_imriorfile ". "ior MessengerService ". "-f $si_srviorfile "); $C1 = $c1->CreateProcess ("MessengerClient", "-k file://$c1_srviorfile ". - "-ORBForwardOnReplyClosedLimit 20 -ORBForwardDelay 500 ". - "-ORBSvcConf $c1_conffile -ORBdebuglevel $debug_level ". - "-d $seconds_between_requests"); + "-ORBForwardOnReplyClosedLimit 20 -ORBForwardDelay 500 ". + "-ORBSvcConf $c1_conffile -ORBdebuglevel $debug_level ". + "-d $seconds_between_requests -t $number_tries -s $number_succeed"); $SDN = $sdn->CreateProcess ("$tao_imr", "-ORBInitRef ImplRepoService=file://$sdn_imriorfile ". "shutdown MessengerService"); @@ -178,10 +185,21 @@ if ($TI_status != 0) { exit 1; } +if ($mode == "-a MANUAL ") +{ + print STDOUT "Manually starting MessengerService\n"; + $TI->Arguments ("-ORBInitRef ImplRepoService=file://$si_imriorfile ". + "start MessengerService" ); + $TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval()); + if ($TI_status != 0) { + print STDERR "ERROR: tao_imr start returned $TI_status\n"; + $status = 1; + } +} + print ">>> " . $SI->CommandLine() . "\n"; $SI->IgnoreExeSubDir (1); - $SI_status = $SI->SpawnWaitKill ($si->ProcessStartWaitInterval() + $extra_timeout); if ($SI_status != 0) { diff --git a/TAO/orbsvcs/tests/Notify/Basic/Sequence.cpp b/TAO/orbsvcs/tests/Notify/Basic/Sequence.cpp index 9d4b0f3768b..337cdd0bf48 100644 --- a/TAO/orbsvcs/tests/Notify/Basic/Sequence.cpp +++ b/TAO/orbsvcs/tests/Notify/Basic/Sequence.cpp @@ -17,8 +17,7 @@ SequencePushConsumer::SequencePushConsumer (Sequence *test_client) void SequencePushConsumer::push_structured_events ( - const CosNotification::EventBatch &batch - ) + const CosNotification::EventBatch &batch) { this->test_client_->events_received_ += batch.length (); @@ -35,8 +34,7 @@ SequencePushConsumer::push_structured_events ( /***************************************************************************/ SequencePushSupplier::SequencePushSupplier ( - Sequence* test_client - ) + Sequence* test_client) : test_client_ (test_client) { } @@ -122,7 +120,7 @@ Sequence::init (int argc, this->supplier_->connect (this->supplier_admin_.in ()); - consumer_start( 0 ); + consumer_start (0); return 0; } @@ -336,8 +334,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) try { - events.init (argc, - argv); + events.init (argc, argv); events.run_test (); diff --git a/TAO/tao/ImR_Client/ImR_Client.cpp b/TAO/tao/ImR_Client/ImR_Client.cpp index c62aeb6c9d0..f1749479c86 100644 --- a/TAO/tao/ImR_Client/ImR_Client.cpp +++ b/TAO/tao/ImR_Client/ImR_Client.cpp @@ -40,7 +40,7 @@ namespace if (TAO_debug_level > 0) { TAOLIB_DEBUG ((LM_DEBUG, - ACE_TEXT ("************** IMR partial IOR =\n%C\n"), + ACE_TEXT ("TAO_ImR_Client (%P|%t) - IMR partial IOR =\n%C\n"), profile_str.in ())); } char* const pos = find_delimiter (profile_str.inout (), @@ -52,7 +52,7 @@ namespace if (TAO_debug_level > 0) { TAOLIB_ERROR ((LM_ERROR, - ACE_TEXT ("Could not parse ImR IOR, skipping ImRification\n"))); + ACE_TEXT ("TAO_ImR_Client (%P|%t) - Could not parse ImR IOR, skipping ImRification\n"))); } return CORBA::Object::_nil(); } @@ -65,7 +65,7 @@ namespace if (TAO_debug_level > 0) { TAOLIB_DEBUG ((LM_DEBUG, - ACE_TEXT ("************** ImR-ified IOR =\n%C\n\n"), + ACE_TEXT ("TAO_ImR_Client (%P|%t) - ImR-ified IOR =\n%C\n\n"), ior.c_str ())); } CORBA::Object_ptr obj = orb_core.orb ()->string_to_object (ior.c_str ()); @@ -104,8 +104,7 @@ namespace { if (!combine_profile (i)) { - return default_obj ( - "could not resolve IORManipulation"); + return default_obj ("could not resolve IORManipulation"); } } @@ -114,8 +113,7 @@ namespace if (CORBA::is_nil (IORM.in ())) { - return default_obj ( - "could not resolve IORManipulation"); + return default_obj ("could not resolve IORManipulation"); } TAO_IOP::TAO_IOR_Manipulation_var iorm = @@ -123,8 +121,7 @@ namespace if (CORBA::is_nil (iorm.in ())) { - return default_obj ( - "could not narrow IORManipulation"); + return default_obj ("could not narrow IORManipulation"); } try @@ -178,7 +175,7 @@ namespace break; } TAOLIB_ERROR((LM_ERROR, - ACE_TEXT("ERROR: %C. ") + ACE_TEXT("TAO_ImR_Client (%P|%t) - ERROR: %C. ") ACE_TEXT("Defaulting to ImR-ifying profile_in_use\n"), desc)); return objs_[i]._retn (); @@ -186,7 +183,7 @@ namespace } TAOLIB_ERROR((LM_ERROR, - ACE_TEXT ("ERROR: %C, ") + ACE_TEXT ("TAO_ImR_Client (%P|%t) - ERROR: %C, ") ACE_TEXT ("but cannot default to ImR-ifying profile_in_use %C\n"), desc, info)); @@ -221,7 +218,7 @@ namespace TAO if (CORBA::is_nil (imr.in ())) { TAOLIB_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) ERROR: No usable IMR initial reference ") + ACE_TEXT ("TAO_ImR_Client (%P|%t) - ERROR: No usable IMR initial reference ") ACE_TEXT ("available but use IMR has been specified.\n"))); throw ::CORBA::TRANSIENT ( CORBA::SystemException::_tao_minor_code (TAO_IMPLREPO_MINOR_CODE, 0), @@ -238,7 +235,7 @@ namespace TAO imr_info = ACE_CString (", IMR IOR=") + ior.in (); } TAOLIB_DEBUG ((LM_DEBUG, - ACE_TEXT ("Notifying ImR of startup%C\n"), + ACE_TEXT ("TAO_ImR_Client (%P|%t) - Notifying ImR of startup <%C>\n"), imr_info.c_str ())); } @@ -256,7 +253,7 @@ namespace TAO if (CORBA::is_nil (imr_locator.in ())) { TAOLIB_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) ERROR: Narrowed IMR initial reference ") + ACE_TEXT ("TAO_ImR_Client (%P|%t) - ERROR: Narrowed IMR initial reference ") ACE_TEXT ("is nil but use IMR has been specified.\n"))); throw ::CORBA::TRANSIENT ( @@ -293,7 +290,7 @@ namespace TAO { if (TAO_debug_level > 0) { - TAOLIB_ERROR ((LM_ERROR, "Invalid ImR ServerObject, bailing out.\n")); + TAOLIB_ERROR ((LM_ERROR, "TAO_ImR_Client (%P|%t) - Invalid ImR ServerObject, bailing out.\n")); } return; } @@ -304,7 +301,7 @@ namespace TAO if (TAO_debug_level > 0) { TAOLIB_DEBUG((LM_INFO, - "\n\nfull_ior=<%C>\n\nior=<%C>\n\n", + "TAO_ImR_Client (%P|%t) - full_ior=<%C>\n\nior=<%C>\n\n", full_ior.in(), ior.in())); } @@ -315,7 +312,7 @@ namespace TAO if (TAO_debug_level > 0) TAOLIB_DEBUG ((LM_DEBUG, - ACE_TEXT ("Informing IMR that we are running at: %C\n"), + ACE_TEXT ("TAO_ImR_Client (%P|%t) - Informing IMR that we are running at: <%C>\n"), partial_ior.c_str ())); try @@ -353,7 +350,7 @@ namespace TAO if (TAO_debug_level > 0) { TAOLIB_DEBUG ((LM_DEBUG, - ACE_TEXT ("Successfully notified ImR of Startup\n"))); + ACE_TEXT ("TAO_ImR_Client (%P|%t) - Successfully notified ImR of Startup\n"))); } } @@ -374,7 +371,7 @@ namespace TAO { CORBA::String_var poaname = poa->the_name (); TAOLIB_DEBUG ((LM_DEBUG, - ACE_TEXT ("Notifying IMR of Shutdown server:%s\n"), + ACE_TEXT ("TAO_ImR_Client (%P|%t) - Notifying IMR of Shutdown server: <%C>\n"), poaname.in ())); } @@ -396,7 +393,7 @@ namespace TAO if (TAO_debug_level > 0) { TAOLIB_DEBUG ((LM_DEBUG, - ACE_TEXT ("Ignoring COMM_FAILURE while unregistering") + ACE_TEXT ("TAO_ImR_Client (%P|%t) - Ignoring COMM_FAILURE while unregistering") ACE_TEXT ("from ImR.\n"))); } } @@ -406,7 +403,7 @@ namespace TAO if (TAO_debug_level > 0) { TAOLIB_DEBUG ((LM_DEBUG, - ACE_TEXT ("Ignoring TRANSIENT while unregistering") + ACE_TEXT ("TAO_ImR_Client (%P|%t) - Ignoring TRANSIENT while unregistering") ACE_TEXT ("from ImR.\n"))); } } @@ -469,7 +466,7 @@ namespace TAO if (TAO_debug_level > 1) { TAOLIB_DEBUG ((LM_DEBUG, - ACE_TEXT ("Missing ImR IOR, will not use the ImR\n"))); + ACE_TEXT ("TAO_ImR_Client (%P|%t) - Missing ImR IOR, will not use the ImR\n"))); } return CORBA::Object::_nil(); } |