Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / POA / EndpointPolicy / run_test_lh.pl
blob23384fa1e494392dde0b6e9851f6ab47c0a4b165
1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
3 if 0;
5 # -*- perl -*-
7 use lib "$ENV{ACE_ROOT}/bin";
8 use PerlACE::TestTarget;
10 $status = 0;
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";
18 my $server_good_iorfile = $server->LocalFile ($goodiorbase);
19 my $server_bad_iorfile = $server->LocalFile ($badiorbase);
20 my $client_good_iorfile = $client->LocalFile ($goodiorbase);
21 my $client_bad_iorfile = $client->LocalFile ($badiorbase);
23 $server->DeleteFile($goodiorbase);
24 $server->DeleteFile($badiorbase);
25 $client->DeleteFile($goodiorbase);
26 $client->DeleteFile($badiorbase);
28 $port = 12345;
30 $sharedSV = $server->CreateProcess ("server", "-ORBDottedDecimalAddresses 0 -ORBUseSharedProfile 1 -h local -g $server_good_iorfile -b $server_bad_iorfile -p $port");
31 $goodCL = $client->CreateProcess ("client", "-k file://$client_good_iorfile");
32 $badCL = $client->CreateProcess ("client", "-b -k file://$client_bad_iorfile");
34 print "Starting server using shared profiles\n";
36 $server_status_shared = $sharedSV->Spawn ();
38 if ($server_status_shared != 0) {
39 print STDERR "ERROR: server returned $server_status_shared\n";
40 exit 1;
43 if ($server->WaitForFileTimed ($goodiorbase,
44 $server->ProcessStartWaitInterval()) == -1) {
45 print STDERR "ERROR: cannot find file [single profile per IOR] <$server_good_iorfile>\n";
46 $sharedSV->Kill (); $sharedSV->TimedWait (1);
47 exit 1;
50 $client_status_bad = $badCL->SpawnWaitKill ($client->ProcessStartWaitInterval());
52 if ($client_status_bad != 0) {
53 print STDERR "ERROR: bad client returned $client_status_bad\n";
54 $status = 1;
57 $client_good_status = $goodCL->SpawnWaitKill ($client->ProcessStartWaitInterval());
59 if ($client_good_status != 0) {
60 print STDERR "ERROR: good client returned $client_good_status\n";
61 $status = 1;
64 $server_status_shared = $sharedSV->WaitKill ($server->ProcessStopWaitInterval());
66 if ($server_status_shared != 0) {
67 print STDERR "ERROR: server [single profile per IOR] returned $server_status_shared\n";
68 $status = 1;
71 $server->DeleteFile($goodiorbase);
72 $server->DeleteFile($badiorbase);
73 $client->DeleteFile($goodiorbase);
74 $client->DeleteFile($badiorbase);
76 print "Starting server using multiple profiles\n";
78 $multiSV = $server->CreateProcess ("server", "-ORBDottedDecimalAddresses 0 -ORBUseSharedProfile 0 -h local -g $server_good_iorfile -b $server_bad_iorfile -p $port");
80 $server_status_multi = $multiSV->Spawn ();
82 if ($server_status_multi != 0) {
83 print STDERR "ERROR: multi server returned $server_status_multi\n";
84 exit 1;
87 if ($server->WaitForFileTimed ($goodiorbase,
88 $server->ProcessStartWaitInterval()) == -1) {
89 print STDERR "ERROR: cannot find file [multiple profiles per IOR] <$server_good_iorfile>\n";
90 $multiSV->Kill (); $multiSV->TimedWait (1);
91 exit 1;
94 $client_bad_status = $badCL->SpawnWaitKill ($client->ProcessStartWaitInterval());
96 if ($client_bad_status != 0) {
97 print STDERR "ERROR: bad client returned $client_bad_status\n";
98 $status = 1;
101 $client_good_status = $goodCL->SpawnWaitKill ($client->ProcessStartWaitInterval());
103 if ($client_good_status != 0) {
104 print STDERR "ERROR: good client returned $client_good_status\n";
105 $status = 1;
108 $server_multi_status = $multiSV->WaitKill ($server->ProcessStopWaitInterval());
110 if ($server_multi_status != 0) {
111 print STDERR "ERROR: server [multiple profiles per IOR] returned $server_multi_status\n";
112 $status = 1;
115 $server->DeleteFile($goodiorbase);
116 $server->DeleteFile($badiorbase);
117 $client->DeleteFile($goodiorbase);
118 $client->DeleteFile($badiorbase);
120 exit $status;