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
;
19 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
20 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
21 my $admin = PerlACE
::TestTarget
::create_target
(3) || die "Create target 3 failed\n";
23 my $iorfile_admin = "admin.ior";
24 my $iorfile = "server.ior";
26 #Files which used by server
27 my $server_iorfile = $server->LocalFile ($iorfile);
28 my $server_iorfile_admin = $server->LocalFile ($iorfile_admin);
29 $server->DeleteFile($iorfile);
30 $server->DeleteFile($iorfile_admin);
32 #Files which used by client
33 my $client_iorfile = $client->LocalFile ($iorfile);
34 my $client_iorfile_admin = $client->LocalFile ($iorfile_admin);
35 $client->DeleteFile($iorfile);
36 $client->DeleteFile($iorfile_admin);
38 #Files which used by admin
39 my $admin_iorfile_admin = $admin->LocalFile ($iorfile_admin);
40 $admin->DeleteFile($iorfile_admin);
42 $AD = $admin->CreateProcess ("admin",
43 "-ORBdebuglevel $debug_level " .
44 "-o $admin_iorfile_admin");
46 $SV = $server->CreateProcess ("server",
47 "-ORBdebuglevel $debug_level " .
48 "-o $server_iorfile " .
49 "-k file://$server_iorfile_admin");
51 $CL = $client->CreateProcess ("client",
52 "-k file://$client_iorfile " .
53 "-a file://$client_iorfile_admin " .
56 $admin_status = $AD->Spawn ();
58 if ($admin_status != 0) {
59 print STDERR
"ERROR: admin returned $admin_status\n";
63 if ($admin->WaitForFileTimed ($iorfile_admin,
64 $admin->ProcessStartWaitInterval()) == -1) {
65 print STDERR
"ERROR: cannot find file <$iorfile_admin>\n";
66 $AD->Kill (); $AD->TimedWait (1);
69 if ($admin->GetFile ($iorfile_admin) == -1) {
70 print STDERR
"ERROR: cannot retrieve file <$admin_iorfile_admin>\n";
71 $AD->Kill (); $AD->TimedWait (1);
74 if ($client->PutFile ($iorfile_admin) == -1) {
75 print STDERR
"ERROR: cannot set file <$client_iorfile_admin>\n";
76 $AD->Kill (); $AD->TimedWait (1);
79 if ($server->PutFile ($iorfile_admin) == -1) {
80 print STDERR
"ERROR: cannot set file <$server_iorfile_admin>\n";
81 $AD->Kill (); $AD->TimedWait (1);
85 $server_status = $SV->Spawn ();
87 if ($server_status != 0) {
88 print STDERR
"ERROR: server returned $server_status\n";
93 $SV->Kill (); $SV->TimedWait (1);
94 $AD->Kill (); $AD->TimedWait (1);
97 if ($server->WaitForFileTimed ($iorfile,
98 $server->ProcessStartWaitInterval()) == -1) {
99 print STDERR
"ERROR: cannot find file <$iorfile>\n";
104 if ($server->GetFile ($iorfile) == -1) {
105 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
109 if ($client->PutFile ($iorfile) == -1) {
110 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
115 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 15);
117 if ($client_status != 0) {
118 print STDERR
"ERROR: client returned $client_status\n";
122 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
124 if ($server_status != 0) {
125 print STDERR
"ERROR: server returned $server_status\n";
129 $admin_status = $AD->WaitKill ($admin->ProcessStopWaitInterval());
131 if ($admin_status != 0) {
132 print STDERR
"ERROR: admin returned $admin_status\n";
136 $server->DeleteFile($iorfile);
137 $client->DeleteFile($iorfile);
138 $client->DeleteFile($iorfile_admin);
139 $server->DeleteFile($iorfile_admin);
140 $admin->DeleteFile($iorfile_admin);