1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
7 use lib
"$ENV{ACE_ROOT}/bin";
8 use PerlACE
::TestTarget
;
10 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
11 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
14 $server_debug_level = '0';
15 $client_debug_level = '0';
19 $server_debug_level = '10';
20 $client_debug_level = '10';
24 my $iorbase_master = "master.ior";
25 my $iorbase_slave = "slave.ior";
26 my $server_master_iorfile = $server->LocalFile ($iorbase_master);
27 my $server_slave_iorfile = $server->LocalFile ($iorbase_slave);
28 my $client_master_iorfile = $client->LocalFile ($iorbase_master);
29 my $client_slave_iorfile = $client->LocalFile ($iorbase_slave);
30 $server->DeleteFile($iorbase_master);
31 $server->DeleteFile($iorbase_slave);
32 $client->DeleteFile($iorbase_master);
33 $client->DeleteFile($iorbase_slave);
35 $SV = $server->CreateProcess ("tester", "-ORBdebuglevel $server_debug_level -o $server_slave_iorfile -k file://$server_master_iorfile");
37 $server_status = $SV->Spawn ();
39 if ($server_status != 0) {
40 print STDERR
"ERROR: server returned $server_status\n";
44 if ($server->WaitForFileTimed ($iorbase_slave,
45 $server->ProcessStartWaitInterval()) == -1) {
46 print STDERR
"ERROR: cannot find file <$server_slave_iorfile>\n";
47 $SV->Kill (); $SV->TimedWait (1);
50 if ($server->GetFile ($iorbase_slave) == -1) {
51 print STDERR
"ERROR: cannot get file <$server_slave_iorfile>\n";
52 $SV->Kill (); $SV->TimedWait (1);
55 if ($client->PutFile ($iorbase_slave) == -1) {
56 print STDERR
"ERROR: cannot set file <$client_slave_iorfile>\n";
57 $SV->Kill (); $SV->TimedWait (1);
61 $CL = $client->CreateProcess ("tester",
62 "-ORBdebuglevel $client_debug_level"
63 . " -o $client_master_iorfile"
64 . " -m -k file://$client_slave_iorfile ");
66 $client_status = $CL->Spawn ();
68 if ($client_status != 0) {
69 print STDERR
"ERROR: client returned $client_status\n";
73 if ($client->WaitForFileTimed ($iorbase_master,
74 $client->ProcessStartWaitInterval()) == -1) {
75 print STDERR
"ERROR: cannot find file <$client_master_iorfile>\n";
76 $CL->Kill (); $CL->TimedWait (1);
79 if ($client->GetFile ($iorbase_master) == -1) {
80 print STDERR
"ERROR: cannot get file <$client_master_iorfile>\n";
81 $CL->Kill (); $CL->TimedWait (1);
84 if ($server->PutFile ($iorbase_master) == -1) {
85 print STDERR
"ERROR: cannot set file <$server_master_iorfile>\n";
86 $CL->Kill (); $CL->TimedWait (1);
90 $client_status = $CL->WaitKill ($client->ProcessStartWaitInterval());
92 if ($client_status != 0) {
93 print STDERR
"ERROR: client returned $client_status\n";
97 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
99 if ($server_status != 0) {
100 print STDERR
"ERROR: server returned $server_status\n";
104 $server->DeleteFile($iorbase_master);
105 $server->DeleteFile($iorbase_slave);
106 $client->DeleteFile($iorbase_master);
107 $client->DeleteFile($iorbase_slave);