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
;
12 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
13 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
15 my $client_conf_base = "mt_noupcall$PerlACE::svcconf_ext";
16 my $client_conf = $server->LocalFile ($client_conf_base);
17 if ($client->PutFile ($client_conf_base) == -1) {
18 print STDERR
"ERROR: cannot set file <$client_conf>\n";
23 my $server_conf_base = "mt_noupcall$PerlACE::svcconf_ext";
24 my $server_conf = $server->LocalFile ($server_conf_base);
25 if ($client->PutFile ($server_conf_base) == -1) {
26 print STDERR
"ERROR: cannot set file <$server_conf>\n";
37 my $server_iorbase = "server.ior";
38 my $client_iorbase = "client.ior";
39 my $server_iorfile = $server->LocalFile ($server_iorbase);
40 my $client_iorfile = $client->LocalFile ($client_iorbase);
42 $server->DeleteFile($server_iorbase);
43 $client->DeleteFile($client_iorbase);
45 $SV = $server->CreateProcess ("server",
46 "-ORBDebugLevel $debug_level -ORBSvcConf $server_conf " .
48 $server_status = $SV->Spawn ();
49 if ($server_status != 0) {
50 print STDERR
"ERROR: server returned $server_status\n";
53 if ($server->WaitForFileTimed ($server_iorbase,
54 $server->ProcessStartWaitInterval()) == -1) {
55 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
56 $SV->Kill (); $SV->TimedWait (1);
60 $CL = $client->CreateProcess ("client", "-t 1");
61 $client_status = $CL->Spawn ();
62 if ($client_status != 0) {
63 print STDERR
"ERROR: client returned $client_status\n";
64 $SV->Kill (); $SV->TimedWait (1);
68 if ($client->WaitForFileTimed ($client_iorbase,
69 $client->ProcessStartWaitInterval()) == -1) {
70 print STDERR
"ERROR: cannot find file <$client_iorfile>\n";
71 $SV->Kill (); $SV->TimedWait (1);
75 print "INFO: Awaiting server ...\n";
76 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval() + 60);
77 if ($server_status != 0) {
78 print STDERR
"ERROR: server returned $server_status\n";
82 print "INFO: Awaiting client ...\n";
83 $client_status = $CL->WaitKill ($client->ProcessStartWaitInterval() + 10);
84 if ($client_status != 0) {
85 print STDERR
"ERROR: client returned $client_status\n";
89 $server->DeleteFile($server_iorfile);
90 $client->DeleteFile($client_iorfile);
92 if ($exit_status == 0) {
93 print "INFO: Test succeeded\n";
96 print "INFO: Test Failed!\n";