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 $server_conf_base = "mt_noupcall$PerlACE::svcconf_ext";
16 my $server_conf = $server->LocalFile ($server_conf_base);
17 if ($server->PutFile ($server_conf_base) == -1) {
18 print STDERR
"ERROR: cannot set file <$server_conf>\n";
29 my $debugarg = "-ORBDebugLevel $debug_level -ORBVerboseLogging 1 -ORBLogFile ";
30 my $server_debug = $debugarg . " server.log" if ($debug_level > 0);
31 my $client_debug = $debugarg . " client.log" if ($debug_level > 0);
33 my $server_iorbase = "server.ior";
34 my $server_iorfile = $server->LocalFile ($server_iorbase);
36 $server->DeleteFile($server_iorbase);
37 $server->DeleteFile("server.log");
38 $client->DeleteFile("client.log");
41 $SV = $server->CreateProcess ("server", "-ORBSvcConf $server_conf_base $server_debug");
42 $server_status = $SV->Spawn ();
43 if ($server_status != 0) {
44 print STDERR
"ERROR: server returned $server_status\n";
47 if ($server->WaitForFileTimed ($server_iorbase,
48 $server->ProcessStartWaitInterval()) == -1) {
49 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
50 $SV->Kill (); $SV->TimedWait (1);
54 $CL = $client->CreateProcess ("client", "$client_debug");
55 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 300);
56 if ($client_status != 0) {
57 print STDERR
"ERROR: client returned $client_status\n";
61 print "INFO: Awaiting server ...\n";
62 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
63 if ($server_status != 0) {
64 print STDERR
"ERROR: server returned $server_status\n";
68 $server->DeleteFile($server_iorfile);
70 if ($exit_status == 0) {
71 print "INFO: Test succeeded\n";
74 print "INFO: Test Failed!\n";