summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarijke Hengstmengel <MHengstmengel@users.noreply.github.com>2013-10-23 08:57:42 +0000
committerMarijke Hengstmengel <MHengstmengel@users.noreply.github.com>2013-10-23 08:57:42 +0000
commitea7244874d88d80737fd5a1c26046183f51f564f (patch)
tree6a19371a5a79019b03256fd84819a4fd792e5194
parent29cbf75d9c11fe9c4b3e3698a38932354a397e7d (diff)
downloadATCD-ea7244874d88d80737fd5a1c26046183f51f564f.tar.gz
Changes for Android port
-rw-r--r--CIAO/examples/Hello/Receiver/Hello_Receiver_exec.cpp7
-rwxr-xr-xCIAO/examples/Hello/descriptors/run_test.pl235
-rw-r--r--CIAO/examples/ciao_android.lst12
3 files changed, 146 insertions, 108 deletions
diff --git a/CIAO/examples/Hello/Receiver/Hello_Receiver_exec.cpp b/CIAO/examples/Hello/Receiver/Hello_Receiver_exec.cpp
index 8b431b6d6c5..bdc2eb69bcc 100644
--- a/CIAO/examples/Hello/Receiver/Hello_Receiver_exec.cpp
+++ b/CIAO/examples/Hello/Receiver/Hello_Receiver_exec.cpp
@@ -92,6 +92,8 @@ namespace CIAO_Hello_Receiver_Impl
Receiver_exec_i::Receiver_exec_i (void)
{
+ ACE_DEBUG ((LM_DEBUG,ACE_TEXT(" Receiver_exec_i::Receiver_exec_i \n")));
+
}
Receiver_exec_i::~Receiver_exec_i (void)
@@ -122,6 +124,7 @@ namespace CIAO_Hello_Receiver_Impl
Receiver_exec_i::set_session_context (
::Components::SessionContext_ptr ctx)
{
+ ACE_DEBUG ((LM_DEBUG,ACE_TEXT(" Receiver_exec_i::set_session_context \n")));
this->context_ = ::Hello::CCM_Receiver_Context::_narrow (ctx);
if ( ::CORBA::is_nil (this->context_.in ()))
@@ -133,16 +136,20 @@ namespace CIAO_Hello_Receiver_Impl
void
Receiver_exec_i::configuration_complete (void)
{
+ ACE_DEBUG ((LM_DEBUG,ACE_TEXT(" Receiver_exec_i::configuration_complete \n")));
}
void
Receiver_exec_i::ccm_activate (void)
{
+ ACE_DEBUG ((LM_DEBUG,ACE_TEXT(" Receiver_exec_i::ccm_activate \n")));
+
}
void
Receiver_exec_i::ccm_passivate (void)
{
+ ACE_DEBUG ((LM_DEBUG,ACE_TEXT(" Receiver_exec_i::ccm_passivate \n")));
}
void
diff --git a/CIAO/examples/Hello/descriptors/run_test.pl b/CIAO/examples/Hello/descriptors/run_test.pl
index e1ac985ad30..45d9a1964dc 100755
--- a/CIAO/examples/Hello/descriptors/run_test.pl
+++ b/CIAO/examples/Hello/descriptors/run_test.pl
@@ -7,6 +7,10 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
use lib "$ENV{'ACE_ROOT'}/bin";
use PerlACE::TestTarget;
+use Socket;
+use Sys::Hostname;
+
+
$CIAO_ROOT = "$ENV{'CIAO_ROOT'}";
$TAO_ROOT = "$ENV{'TAO_ROOT'}";
@@ -109,11 +113,12 @@ sub run_node_daemons {
$iorfile = $iorfiles[$i];
$port = $ports[$i];
$nodename = $nodenames[$i];
- $iiop = "iiop://localhost:$port";
- $node_app = $tg_daemons[$i]->GetArchDir("$DANCE_ROOT/bin/") . "dance_locality_manager";
-
+ #c$iiop = "iiop://localhost:$port";
+ $iiop = "iiop://0.0.0.0:$port";
+ $node_app = $tg_daemons[$i]->GetArchDir($tg_daemons[$i]->LocalEnvDir("$DANCE_ROOT"). "/bin/") . "dance_locality_manager";
$d_cmd = "$DANCE_ROOT/bin/dance_node_manager";
- $d_param = "-ORBEndpoint $iiop -s $node_app -n $nodename=$iorfile -t 30 --domain-nc corbaloc:rir:/NameService";
+
+ $d_param = "-ORBEndpoint $iiop -s $node_app -n $nodename=$iorfile -t 30 --domain-nc ". $ENV{"NameServiceIOR"};
print "Run dance_node_manager with $d_param\n";
@@ -121,7 +126,7 @@ sub run_node_daemons {
$DEAMONS[$i]->Spawn ();
if ($tg_daemons[$i]->WaitForFileTimed($iorbase,
- $tg_daemons[$i]->ProcessStartWaitInterval ()) == -1) {
+ 2 * $tg_daemons[$i]->ProcessStartWaitInterval ()) == -1) {
print STDERR
"ERROR: The ior $iorfile file of node daemon $i could not be found\n";
for (; $i >= 0; --$i) {
@@ -132,6 +137,19 @@ sub run_node_daemons {
}
return 0;
}
+sub host_ip()
+{
+ my @host = gethostbyname(hostname());
+ if (scalar(@host) == 0) {
+ $ipaddr = "not found";
+ } else {
+ $ipaddr = inet_ntoa($host[4]);
+ }
+ print "host : " . $host . " and ipaddres : " . $ipaddr;
+ return $ipaddr;
+}
+
+$my_ip = host_ip();
create_targets ();
init_ior_files ();
@@ -144,112 +162,113 @@ if ($#ARGV == -1) {
else {
@files = @ARGV;
}
-
+$file=$cdp_file;
foreach $file (@files) {
print "=============================\nStarting test for deployment $file\n================================\n";
- # Invoke naming service
-
- $NS = $tg_naming->CreateProcess ("$TAO_ROOT/orbsvcs/Naming_Service/tao_cosnaming", " -ORBEndpoint iiop://localhost:60003 -o $ior_nsfile");
-
- print STDERR "Starting Naming Service with -ORBEndpoint iiop://localhost:60003 -o ns.ior\n";
-
- $ns_status = $NS->Spawn ();
-
- if ($ns_status != 0) {
- print STDERR "ERROR: Unable to execute the naming service\n";
- kill_open_processes ();
- exit 1;
- }
-
- if ($tg_naming->WaitForFileTimed ($ior_nsbase,
- $tg_naming->ProcessStartWaitInterval ()) == -1) {
- print STDERR "ERROR: cannot find naming service IOR file\n";
- $NS->Kill (); $NS->TimedWait (1);
- exit 1;
- }
-
- $ns_running = 1;
- # Set up NamingService environment
- $ENV{"NameServiceIOR"} = "corbaloc:iiop:localhost:60003/NameService";
-
- # Invoke node daemon.
- 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 execution manager.
- print "Invoking execution manager (dance_execution_manager.exe) with -e$ior_emfile\n";
- $EM = $tg_exe_man->CreateProcess ("$DANCE_ROOT/bin/dance_execution_manager",
- "-e$ior_emfile --domain-nc corbaloc:rir:/NameService");
- $em_status = $EM->Spawn ();
-
- if ($em_status != 0) {
- print STDERR "ERROR: dance_execution_manager returned $em_status";
- exit 1;
- }
-
- if ($tg_exe_man->WaitForFileTimed ($ior_embase,
- $tg_exe_man->ProcessStartWaitInterval ()) == -1) {
- print STDERR
- "ERROR: The ior file of execution manager could not be found\n";
- kill_open_processes ();
- exit 1;
- }
-
- $em_running = 1;
-
- # Invoke executor - start the application -.
- print "Invoking executor - launch the application -\n";
-
- print "Start dance_plan_launcher.exe with -x $file -k file://$ior_emfile\n";
- $E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher",
- "-x $file -k file://$ior_emfile");
-
- $pl_status = $E->SpawnWaitKill (2 * $tg_executor->ProcessStartWaitInterval ());
-
- if ($pl_status != 0) {
- print STDERR "ERROR: dance_plan_launcher returned $pl_status\n";
- kill_open_processes ();
- exit 1;
- }
-
- for ($i = 0; $i < $nr_daemon; ++$i) {
- if ($tg_daemons[$i]->WaitForFileTimed ($iorbases[$i],
- $tg_daemons[$i]->ProcessStopWaitInterval ()) == -1) {
- print STDERR "ERROR: The ior file of daemon $i could not be found\n";
- kill_open_processes ();
- exit 1;
- }
- }
-
- print "Sleeping 90 seconds to allow task to complete\n";
- sleep (90);
-
- # Invoke executor - stop the application -.
- print "Invoking executor - stop the application -\n";
- print "by running dance_plan_launcher.exe with -k file://$ior_emfile -x $file\n";
-
- $E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher",
- "-k file://$ior_emfile -x $file -s");
- $pl_status = $E->SpawnWaitKill ($tg_executor->ProcessStartWaitInterval ());
-
- if ($pl_status != 0) {
- print STDERR "ERROR: dance_plan_launcher returned $pl_status\n";
- kill_open_processes ();
- exit 1;
- }
- delete_ior_files ();
- kill_open_processes ();
- # Sleep for a couple seconds to make sure everything has a chance to shut down.
- sleep 5;
+ # Invoke naming service
+
+ $NS = $tg_naming->CreateProcess ("$TAO_ROOT/orbsvcs/Naming_Service/tao_cosnaming", " -ORBEndpoint iiop://". $my_ip . ":60003 -o $ior_nsfile");
+
+ print STDERR "Starting Naming Service with -ORBEndpoint iiop://". $my_ip . ":60003 -o ns.ior\n";
+
+ $ns_status = $NS->Spawn ();
+
+ if ($ns_status != 0) {
+ print STDERR "ERROR: Unable to execute the naming service\n";
+ kill_open_processes ();
+ exit 1;
+ }
+
+ if ($tg_naming->WaitForFileTimed ($ior_nsbase,
+ $tg_naming->ProcessStartWaitInterval ()) == -1) {
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+ }
+
+ $ns_running = 1;
+ # Set up NamingService environment
+ $ENV{"NameServiceIOR"} = "corbaloc:iiop:".$my_ip.":60003/NameService";
+
+ # Invoke node daemon.
+ 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 execution manager.
+ print "Invoking execution manager (dance_execution_manager.exe) with -e$ior_emfile\n";
+ $EM = $tg_exe_man->CreateProcess ("$DANCE_ROOT/bin/dance_execution_manager",
+ "-e$ior_emfile --domain-nc " . $ENV{"NameServiceIOR"});
+
+ $em_status = $EM->Spawn ();
+
+ if ($em_status != 0) {
+ print STDERR "ERROR: dance_execution_manager returned $em_status";
+ exit 1;
+ }
+
+ if ($tg_exe_man->WaitForFileTimed ($ior_embase,
+ $tg_exe_man->ProcessStartWaitInterval ()) == -1) {
+ print STDERR
+ "ERROR: The ior file of execution manager could not be found\n";
+ kill_open_processes ();
+ exit 1;
+ }
+
+ $em_running = 1;
+
+ # Invoke executor - start the application -.
+ print "Invoking executor - launch the application -\n";
+
+ print "Start dance_plan_launcher.exe with -x $file -k file://$ior_emfile\n";
+ $E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher",
+ "-x $file -k file://$ior_emfile");
+
+ $pl_status = $E->SpawnWaitKill (2 * $tg_executor->ProcessStartWaitInterval ());
+
+ if ($pl_status != 0) {
+ print STDERR "ERROR: dance_plan_launcher returned $pl_status\n";
+ kill_open_processes ();
+ exit 1;
+ }
+
+ for ($i = 0; $i < $nr_daemon; ++$i) {
+ if ($tg_daemons[$i]->WaitForFileTimed ($iorbases[$i],
+ $tg_daemons[$i]->ProcessStopWaitInterval ()) == -1) {
+ print STDERR "ERROR: The ior file of daemon $i could not be found\n";
+ kill_open_processes ();
+ exit 1;
+ }
+ }
+
+ print "Sleeping 90 seconds to allow task to complete\n";
+ sleep (90);
+
+ # Invoke executor - stop the application -.
+ print "Invoking executor - stop the application -\n";
+ print "by running dance_plan_launcher.exe with -k file://$ior_emfile -x $file\n";
+
+ $E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher",
+ "-k file://$ior_emfile -x $file -s");
+ $pl_status = $E->SpawnWaitKill ($tg_executor->ProcessStartWaitInterval ());
+
+ if ($pl_status != 0) {
+ print STDERR "ERROR: dance_plan_launcher returned $pl_status\n";
+ kill_open_processes ();
+ exit 1;
+ }
+ delete_ior_files ();
+ kill_open_processes ();
+ # Sleep for a couple seconds to make sure everything has a chance to shut down.
+ sleep 5;
}
print "Executor returned.\n";
print "Shutting down rest of the processes.\n";
diff --git a/CIAO/examples/ciao_android.lst b/CIAO/examples/ciao_android.lst
new file mode 100644
index 00000000000..4196bd289cc
--- /dev/null
+++ b/CIAO/examples/ciao_android.lst
@@ -0,0 +1,12 @@
+# $Id$
+#
+# This is the list of run_test.pl's that need to be run by
+# auto_run_tests.pl.
+#
+# This list is used for running tests where the run_test.pl scripts
+# are already adapted for running the test on 2 different targets.
+# Target 1 is default and Target 2 is Android.
+#
+TAO/CIAO/examples/Hello/descriptors/run_test.pl
+
+