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 $goodiorbase = "good.ior";
16 my $badiorbase = "bad.ior";
17 my $svcconf = "multi_prot.conf";
19 my $server_svcconf_file = $server->LocalFile ($svcconf);
20 my $server_good_iorfile = $server->LocalFile ($goodiorbase);
21 my $server_bad_iorfile = $server->LocalFile ($badiorbase);
22 my $client_good_iorfile = $client->LocalFile ($goodiorbase);
23 my $client_bad_iorfile = $client->LocalFile ($badiorbase);
25 $server->DeleteFile($goodiorbase);
26 $server->DeleteFile($badiorbase);
27 $client->DeleteFile($goodiorbase);
28 $client->DeleteFile($badiorbase);
32 $sharedSV = $server->CreateProcess ("server", "-ORBDottedDecimalAddresses 0 -ORBUseSharedProfile 1 -g $server_good_iorfile -b $server_bad_iorfile -p $port -c $server_svcconf_file");
33 $goodCL = $client->CreateProcess ("client", "-k file://$client_good_iorfile");
34 $badCL = $client->CreateProcess ("client", "-b -k file://$client_bad_iorfile");
36 print "Starting server using shared profiles\n";
38 $server_status_shared = $sharedSV->Spawn ();
40 if ($server_status_shared != 0) {
41 print STDERR
"ERROR: server returned $server_status_shared\n";
45 if ($server->WaitForFileTimed ($goodiorbase,
46 $server->ProcessStartWaitInterval()) == -1) {
47 print STDERR
"ERROR: cannot find file <$server_good_iorfile>\n";
48 $sharedSV->Kill (); $sharedSV->TimedWait (1);
52 $client_status_bad = $badCL->SpawnWaitKill ($client->ProcessStartWaitInterval());
54 if ($client_status_bad != 0) {
55 print STDERR
"ERROR: bad client returned $client_status_bad\n";
59 $client_good_status = $goodCL->SpawnWaitKill ($client->ProcessStartWaitInterval());
61 if ($client_good_status != 0) {
62 print STDERR
"ERROR: good client returned $client_good_status\n";
66 $server_status_shared = $sharedSV->WaitKill ($server->ProcessStopWaitInterval());
68 if ($server_status_shared != 0) {
69 print STDERR
"ERROR: server [single profile per IOR] returned $server_status_shared\n";
73 $server->DeleteFile($goodiorbase);
74 $server->DeleteFile($badiorbase);
75 $client->DeleteFile($goodiorbase);
76 $client->DeleteFile($badiorbase);
78 print "Starting server using multiple profiles\n";
80 $multiSV = $server->CreateProcess ("server", "-ORBDottedDecimalAddresses 0 -ORBUseSharedProfile 0 -g $server_good_iorfile -b $server_bad_iorfile -p $port");
82 $server_status_multi = $multiSV->Spawn ();
84 if ($server_status_multi != 0) {
85 print STDERR
"ERROR: server returned $server_status_multi\n";
89 if ($server->WaitForFileTimed ($goodiorbase,
90 $server->ProcessStartWaitInterval()) == -1) {
91 print STDERR
"ERROR: cannot find file <$server_good_iorfile>\n";
92 $multiSV->Kill (); $multiSV->TimedWait (1);
96 $client_bad_status = $badCL->SpawnWaitKill ($client->ProcessStartWaitInterval());
98 if ($client_bad_status != 0) {
99 print STDERR
"ERROR: bad client returned $client_bad_status\n";
103 $client_good_status = $goodCL->SpawnWaitKill ($client->ProcessStartWaitInterval());
105 if ($client_good_status != 0) {
106 print STDERR
"ERROR: good client returned $client_good_status\n";
110 $server_multi_status = $multiSV->WaitKill ($server->ProcessStopWaitInterval());
112 if ($server_multi_status != 0) {
113 print STDERR
"ERROR: server [multiple profiles per IOR] returned $server_multi_status\n";
117 $server->DeleteFile($goodiorbase);
118 $server->DeleteFile($badiorbase);
119 $client->DeleteFile($goodiorbase);
120 $client->DeleteFile($badiorbase);