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";
22 my $iorbase = "server.ior";
23 my $server_iorfile = $server->LocalFile ($iorbase);
24 my $client_iorfile = $client->LocalFile ($iorbase);
25 $server->DeleteFile($iorbase);
26 $client->DeleteFile($iorbase);
28 my $reactor_conf = "reactor$PerlACE::svcconf_ext";
29 my $client_reactor_conf = $client->LocalFile ($reactor_conf);
30 if ($client->PutFile ($reactor_conf) == -1) {
31 print STDERR
"ERROR: cannot set file <$client_reactor_conf>\n";
35 my $blocked_conf = "blocked$PerlACE::svcconf_ext";
36 my $client_blocked_conf = $client->LocalFile ($blocked_conf);
37 if ($client->PutFile ($blocked_conf) == -1) {
38 print STDERR
"ERROR: cannot set file <$client_blocked_conf>\n";
42 $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $server_iorfile");
43 $CL = $client->CreateProcess ("client", "-k file://$client_iorfile");
44 $server_status = $SV->Spawn ();
46 if ($server_status != 0) {
47 print STDERR
"ERROR: server returned $server_status\n";
51 if ($server->WaitForFileTimed ($iorbase,
52 $server->ProcessStartWaitInterval()) == -1) {
53 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
54 $SV->Kill (); $SV->TimedWait (1);
58 if ($server->GetFile ($iorbase) == -1) {
59 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
60 $SV->Kill (); $SV->TimedWait (1);
63 if ($client->PutFile ($iorbase) == -1) {
64 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
65 $SV->Kill (); $SV->TimedWait (1);
69 print STDERR
"===== Base test, using LF \n";
70 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
72 if ($client_status != 0) {
73 print STDERR
"ERROR: client returned $client_status\n";
77 print STDERR
"=================================== \n";
78 print STDERR
"===== Test, using reactor to connect \n";
80 $CL->Arguments ("-ORBSvcConf $client_reactor_conf -k file://$client_iorfile");
81 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
83 if ($client_status != 0) {
84 print STDERR
"ERROR: client returned $client_status\n";
88 print STDERR
"========================================= \n";
89 print STDERR
"===== Test, using blocked connect strategy\n";
91 $CL->Arguments ("-ORBSvcConf $client_blocked_conf -k file://$client_iorfile -x 1");
92 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
94 if ($client_status != 0) {
95 print STDERR
"ERROR: client returned $client_status\n";
99 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
101 if ($server_status != 0) {
102 print STDERR
"ERROR: server returned $server_status\n";
106 $server->DeleteFile($iorbase);
107 $client->DeleteFile($iorbase);