Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Bug_3755_Regression / run_test.pl
blob7973e34b174bc537fb5b01c2916e3ea54887ac7d
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;
11 $debug_level = '0';
13 foreach $i (@ARGV) {
14 if ($i eq '-debug') {
15 $debug_level = '10';
19 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
21 my $mapping1 = "mapping_file1.dat";
22 my $server_mapping1 = $server->LocalFile ($mapping1);
23 my $mapping2 = "mapping_file2.dat";
24 my $server_mapping2 = $server->LocalFile ($mapping2);
25 my $svc_conf1 = "orb1_svc.conf";
26 my $server_svc_conf1 = $server->LocalFile ($svc_conf1);
27 my $svc_conf2 = "orb2_svc.conf";
28 my $server_svc_conf2 = $server->LocalFile ($svc_conf2);
29 $server->DeleteFile($mapping1);
30 $server->DeleteFile($mapping2);
32 # copy the configuation files
33 if ($server->PutFile ($svc_conf1) == -1) {
34 print STDERR "ERROR: cannot set file <$server_svc_conf1>\n";
35 return 1;
37 if ($server->PutFile ($svc_conf2) == -1) {
38 print STDERR "ERROR: cannot set file <$server_svc_conf2>\n";
39 return 1;
42 $SV = $server->CreateProcess ("server",
43 "-a \"AAA -ORBdebuglevel $debug_level -ORBSvcConf $server_svc_conf1\" " .
44 "-b \"BBB -ORBdebuglevel $debug_level -ORBGestalt LOCAL -ORBSvcConf $server_svc_conf2\" " .
45 "-y $server_mapping1 " .
46 "-z $server_mapping2");
47 $server_status = $SV->SpawnWaitKill ($server->ProcessStartWaitInterval());
49 if ($server_status != 0) {
50 print STDERR "ERROR: server returned $server_status\n";
51 exit 1;
54 if ($server->GetFile ($mapping1) == -1) {
55 print STDERR "ERROR: cannot retrieve file <$server_mapping1>\n";
56 $SV->Kill (); $SV->TimedWait (1);
57 exit 1;
60 if ($server->GetFile ($mapping2) == -1) {
61 print STDERR "ERROR: cannot retrieve file <$server_mapping2>\n";
62 $SV->Kill (); $SV->TimedWait (1);
63 exit 1;
66 if (-s $mapping1 == -s $mapping2) {
67 print STDERR "ERROR: <$server_mapping1> and <$server_mapping2> are identical\n";
68 $status = 1;
71 $server->DeleteFile($mapping1);
72 $server->DeleteFile($mapping2);
74 exit $status;