From ba53062f997eebb140baeea44e3fc10ef3c049f4 Mon Sep 17 00:00:00 2001 From: "William R. Otte" Date: Wed, 4 Feb 2009 22:12:10 +0000 Subject: Wed Feb 4 22:08:09 UTC 2009 William R. Otte --- flat/CIAO/ChangeLog | 24 ++++- .../tests/CIAO/Components/SimpleConsumer_exec.cpp | 2 +- .../CIAO/Components/SimpleMultipleUser_exec.cpp | 10 +- .../tests/CIAO/Components/SimpleProvider_exec.cpp | 2 +- .../tests/CIAO/Components/SimpleUser_exec.cpp | 8 +- .../tests/CIAO/NodeManager-Deployments/run_test.pl | 110 +++++++++++++++++++++ .../NodeManager-Deployments/simple_nm_launcher.cpp | 5 +- flat/CIAO/tools/XML/XML_Helper.tpp | 5 +- 8 files changed, 147 insertions(+), 19 deletions(-) create mode 100755 flat/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/run_test.pl diff --git a/flat/CIAO/ChangeLog b/flat/CIAO/ChangeLog index 31de1912e43..1a1f26c8266 100644 --- a/flat/CIAO/ChangeLog +++ b/flat/CIAO/ChangeLog @@ -1,13 +1,31 @@ +Wed Feb 4 22:08:09 UTC 2009 William R. Otte + + * DAnCE/tests/CIAO/Components/SimpleConsumer_exec.cpp: + * DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec.cpp: + * DAnCE/tests/CIAO/Components/SimpleProvider_exec.cpp: + * DAnCE/tests/CIAO/Components/SimpleUser_exec.cpp: + + Removed CLINFO from the logging messages. + + * DAnCE/tests/CIAO/NodeManager-Deployments/run_test.pl: + + Test script to execute all deployments in this directory + + * tools/XML/XML_Helper.tpp: + * DAnCE/tests/CIAO/NodeManager-Deployments/simple_nm_launcher.cpp: + + Reduced logging. + Wed Feb 4 21:18:18 UTC 2009 William R. Otte * ciao/Containers/Container_Base.cpp: - + Demoted the logging priority of failure to find a receptacle policy. * examples/Hello/descriptors/run_test.pl: - removed some extraneous logging. - + removed some extraneous logging. + Wed Feb 4 19:07:27 UTC 2009 William R. Otte * DAnCE/NodeApplication/NodeApplication_Impl.cpp: diff --git a/flat/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer_exec.cpp b/flat/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer_exec.cpp index a5d6d4e7b24..e615cc12cd6 100644 --- a/flat/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer_exec.cpp +++ b/flat/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer_exec.cpp @@ -52,7 +52,7 @@ namespace CIDL_SimpleConsumer_Impl ::Simple::Hello_var hello (ev); - CIAO_DEBUG ((LM_EMERGENCY, CLINFO "SimpleConsumer_exec_i::push_hello_ - " + CIAO_DEBUG ((LM_EMERGENCY, "SimpleConsumer_exec_i::push_hello_ - " "Received hell event, value is %s\n", ev->hello_ ())); } diff --git a/flat/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec.cpp b/flat/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec.cpp index 9fedb6b4bff..e69a11e6e0e 100644 --- a/flat/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec.cpp +++ b/flat/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec.cpp @@ -74,7 +74,7 @@ namespace CIDL_SimpleMultipleUser_Impl ::Simple::SimpleMultipleUser::trigConnections_var conns = this->context_->get_connections_trig (); - CIAO_DEBUG ((LM_NOTICE, CLINFO "SimpleMultipleUser_exec_i::ccm_activate - " + CIAO_DEBUG ((LM_NOTICE, "SimpleMultipleUser_exec_i::ccm_activate - " "Got %u connections to my receptacle\n", conns->length ())); @@ -82,7 +82,7 @@ namespace CIDL_SimpleMultipleUser_Impl { try { - CIAO_DEBUG ((LM_NOTICE, CLINFO "SimpleMultipleUser_exec_i::ccm_activate - " + CIAO_DEBUG ((LM_NOTICE, "SimpleMultipleUser_exec_i::ccm_activate - " "Invoking %u'th connection\n", i)); ::Simple::Trigger_var trig (conns[i].objref); @@ -90,14 +90,14 @@ namespace CIDL_SimpleMultipleUser_Impl } catch (CORBA::Exception &ex) { - CIAO_ERROR ((LM_ERROR, CLINFO "SimpleMultipleUser_exec_i::ccm_activate () - " + CIAO_ERROR ((LM_ERROR, "SimpleMultipleUser_exec_i::ccm_activate () - " "Caught CORBA exception on %u'th reference, details follow:\n", i)); - ex._tao_print_exception (CLINFO "SimpleUser_exec_i::ccm_activate () - "); + ex._tao_print_exception ("SimpleUser_exec_i::ccm_activate () - "); } catch (...) { - CIAO_ERROR ((LM_ERROR, CLINFO "SimpleMultipleUser_exec_i::ccm_activate () - " + CIAO_ERROR ((LM_ERROR, "SimpleMultipleUser_exec_i::ccm_activate () - " "Error: Caught unknown exception whilst invoking reference for port trig.\n")); } } diff --git a/flat/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider_exec.cpp b/flat/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider_exec.cpp index 8271afe1faa..63453474a67 100644 --- a/flat/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider_exec.cpp +++ b/flat/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider_exec.cpp @@ -45,7 +45,7 @@ namespace CIDL_SimpleProvider_Impl { CIAO_TRACE ("Trigger_exec_i::hello ()"); // Your code here. - CIAO_DEBUG ((LM_EMERGENCY, CLINFO "Trigger_exec_i::hello - " + CIAO_DEBUG ((LM_EMERGENCY, "Trigger_exec_i::hello - " "Got the following intofrmation from trig port: %s\n", hello)); } diff --git a/flat/CIAO/DAnCE/tests/CIAO/Components/SimpleUser_exec.cpp b/flat/CIAO/DAnCE/tests/CIAO/Components/SimpleUser_exec.cpp index 03d8eb16527..aa9064211c9 100644 --- a/flat/CIAO/DAnCE/tests/CIAO/Components/SimpleUser_exec.cpp +++ b/flat/CIAO/DAnCE/tests/CIAO/Components/SimpleUser_exec.cpp @@ -75,7 +75,7 @@ namespace CIDL_SimpleUser_Impl if (CORBA::is_nil (trig.in ())) { - CIAO_ERROR ((LM_ERROR, CLINFO "SimpleUser_exec_i::ccm_activate () - " + CIAO_ERROR ((LM_ERROR, "SimpleUser_exec_i::ccm_activate () - " "Error: Reference nil for port trig\n")); return; } @@ -87,13 +87,13 @@ namespace CIDL_SimpleUser_Impl } catch (CORBA::Exception &ex) { - CIAO_ERROR ((LM_ERROR, CLINFO "SimpleUser_exec_i::ccm_activate () - " + CIAO_ERROR ((LM_ERROR, "SimpleUser_exec_i::ccm_activate () - " "Caught CORBA exception, details follow:\n")); - ex._tao_print_exception (CLINFO "SimpleUser_exec_i::ccm_activate () - "); + ex._tao_print_exception ("SimpleUser_exec_i::ccm_activate () - "); } catch (...) { - CIAO_ERROR ((LM_ERROR, CLINFO "SimpleUser_exec_i::ccm_activate () - " + CIAO_ERROR ((LM_ERROR, "SimpleUser_exec_i::ccm_activate () - " "Error: Caught unknown exception whilst invoking reference for port trig.\n")); } } diff --git a/flat/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/run_test.pl b/flat/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/run_test.pl new file mode 100755 index 00000000000..2ac8a0613bb --- /dev/null +++ b/flat/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/run_test.pl @@ -0,0 +1,110 @@ +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::Run_Test; + +$CIAO_ROOT = "$ENV{'CIAO_ROOT'}"; +$TAO_ROOT = "$ENV{'TAO_ROOT'}"; +$DAnCE = "$ENV{'CIAO_ROOT'}/DAnCE"; +$daemons_running = 0; +$daemons = 1; +@ports = ( 60001 ); +@iorfiles = ( "NodeApp1.ior" ); +@nodenames = ( "Node" ); +$status = 0; + +$E = 0; +$EM = 0; + +# Delete if there are any .ior files. +sub delete_ior_files { + for ($i = 0; $i < $daemons; ++$i) { + unlink $iorfiles[$i]; + } +} + +sub kill_node_daemons { + for ($i = 0; $i < $daemons; ++$i) { + $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1); + } +} + +sub kill_open_processes { + if ($daemons_running == 1) { + kill_node_daemons (); + } +} + +sub run_node_daemons { + for ($i = 0; $i < $daemons; ++$i) + { + $iorfile = $iorfiles[$i]; + $port = $ports[$i]; + $nodename = $nodenames[$i]; + $iiop = "iiop://localhost:$port"; + $node_app = "$CIAO_ROOT/bin/ciao_componentserver"; + + $d_cmd = "$DAnCE/bin/dance_node_manager"; + $d_param = "-ORBEndpoint $iiop -s $node_app -n $nodename=$iorfile -t 30"; + + $Daemons[$i] = new PerlACE::Process ($d_cmd, $d_param); + $result = $Daemons[$i]->Spawn (); + push(@processes, $Daemons[$i]); + + if (PerlACE::waitforfile_timed ($iorfile, + 30) == -1) { + print STDERR + "ERROR: The ior $iorfile file of node daemon $i could not be found\n"; + for (; $i >= 0; --$i) { + $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1); + } + return -1; + } + } + return 0; +} + +opendir(DIR, "."); +@files = grep(/\.cdp$/,readdir(DIR)); +closedir(DIR); + +foreach $file (@files) { + delete_ior_files (); + + print "Running test for plan $file\n"; + + # Invoke node daemons. + print "Invoking node daemon\n"; + $status = run_node_daemons (); + + if ($status != 0) { + print STDERR "ERROR: Unable to execute the node daemon\n"; + kill_open_processes (); + exit 1; + } + + $daemons_running = 1; + + # Invoke executor - start the application -. + print "Launching the plan. file://NodeApp1.ior \n"; + $E = new PerlACE::Process ("simple_nm_launcher", + "file://NodeApp1.ior $file"); + + $status = $E->SpawnWaitKill (5000); + + if ($status != 0) + { + print "ERROR: simple_nm_launcher returned error status $status\n"; + } + + print "Test for plan $file succeeded\n"; + kill_open_processes (); +} + + +exit $status; diff --git a/flat/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/simple_nm_launcher.cpp b/flat/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/simple_nm_launcher.cpp index e3281a44412..8b4d5531816 100644 --- a/flat/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/simple_nm_launcher.cpp +++ b/flat/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/simple_nm_launcher.cpp @@ -37,7 +37,6 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) logger.reset (dlf); logger->init (argc, argv); - std::cerr << "2\n"; CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); @@ -86,8 +85,8 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE_DEBUG ((LM_DEBUG, "*** simple_nm_launcher: calling start\n")); na->start (); - ACE_DEBUG ((LM_DEBUG, "*** simple_nm_launcher: start finished, sleeping 20 seconds.\n")); - ACE_OS::sleep (20); + ACE_DEBUG ((LM_DEBUG, "*** simple_nm_launcher: start finished, sleeping 5 seconds.\n")); + ACE_OS::sleep (5); ACE_DEBUG ((LM_DEBUG, "*** simple_nm_launcher: waking up from sleep, calling destroyApplication\n")); nam->destroyApplication (na.in ()); diff --git a/flat/CIAO/tools/XML/XML_Helper.tpp b/flat/CIAO/tools/XML/XML_Helper.tpp index 53ad48ff5f7..7c4b25d6439 100644 --- a/flat/CIAO/tools/XML/XML_Helper.tpp +++ b/flat/CIAO/tools/XML/XML_Helper.tpp @@ -2,6 +2,7 @@ #include "XML_Helper.h" #include "ace/Auto_Ptr.h" #include "ace/Log_Msg.h" +#include "ciao/Logger/Log_Macros.h" #include "xercesc/util/XMLUniDefs.hpp" #include "xercesc/dom/DOM.hpp" #include "XML_Error_Handler.h" @@ -62,8 +63,8 @@ namespace CIAO if (this->initialized_) return; - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Initializing the Xerces runtime \n")); + CIAO_DEBUG ((LM_TRACE, CLINFO + "XML_Helper<>::is_initialized - Initializing the Xerces runtime \n")); // Initialize the Xerces run-time try { -- cgit v1.2.1