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 = "test.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 $server_conf_base = "server.conf";
29 my $client_conf_base = "client.conf";
30 my $server_conf = $server->LocalFile ($server_conf_base);
31 my $client_conf = $client->LocalFile ($client_conf_base);
33 if ($server->PutFile ($server_conf_base) == -1) {
34 print STDERR
"ERROR: cannot set file <$server_conf>\n";
35 $SV->Kill (); $SV->TimedWait (1);
38 if ($client->PutFile ($client_conf_base) == -1) {
39 print STDERR
"ERROR: cannot set file <$client_conf>\n";
40 $SV->Kill (); $SV->TimedWait (1);
44 $SV = $server->CreateProcess ("server",
45 "-ORBdebuglevel $debug_level " .
46 "-ORBSvcConf $server_conf " .
47 "-ORBListenendpoints iiop://:/reuse_addr=0 " .
48 "-o $server_iorfile");
50 $CL = $client->CreateProcess ("client",
51 "-ORBSvcConf $client_conf " .
52 "-k file://$client_iorfile");
54 $server_status = $SV->Spawn ();
56 if ($server_status != 0) {
57 print STDERR
"ERROR: server returned $server_status\n";
61 if ($server->WaitForFileTimed ($iorbase,
62 $server->ProcessStartWaitInterval()) == -1) {
63 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
64 $SV->Kill (); $SV->TimedWait (1);
68 if ($server->GetFile ($iorbase) == -1) {
69 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
70 $SV->Kill (); $SV->TimedWait (1);
73 if ($client->PutFile ($iorbase) == -1) {
74 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
75 $SV->Kill (); $SV->TimedWait (1);
79 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 105);
81 if ($client_status != 0) {
82 print STDERR
"ERROR: client returned $client_status\n";
86 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
88 if ($server_status != 0) {
89 print STDERR
"ERROR: server returned $server_status\n";
93 $server->DeleteFile($iorbase);
94 $client->DeleteFile($iorbase);
97 print STDERR
"Test failed\n";
100 print STDERR
"Test succeded\n";