Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / Notify / Bug_1884_Regression / run_test.pl
blobd24e9a843cf12ea44f9707c6cb2d0f3f806f192e
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 $nfs = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
20 my $sup = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
21 my $con = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
22 my $flt = PerlACE::TestTarget::create_target (4) || die "Create target 4 failed\n";
24 my $persistent_test = 0;
25 my $port = $nfs->RandomPort ();
26 my $host = $nfs->HostName ();
27 my $nts_ref = "NotifyService=iioploc://$host:$port/NotifyService";
28 my $consumer_runtime = 5;
29 my $svcconf = "";
31 my $nfsiorfile = "ecf.ior";
32 #my $nfs2iorfile = "ecf2.ior";
33 my $nfsconffile = "ecf$PerlACE::svcconf_ext";
34 #my $persistfile = "persistency.notif.xml";
35 #my $persistfilebackup = "persistency.notif.000";
37 my $nfs_nfsiorfile = $nfs->LocalFile ($nfsiorfile);
38 my $nfs_nfsconffile = $nfs->LocalFile ($nfsconffile);
39 $nfs->DeleteFile ($nfsiorfile);
41 if ($#ARGV >= 0 && $ARGV[0] eq '-p') {
42 $persistent_test = 1;
43 $svcconf = " -ORBSvcConf $nfs_nfsconffile";
44 $consumer_runtime = 20;
47 my $NFS = $nfs->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Notify_Service/tao_cosnotification",
48 "-ORBDebugLevel $debug_level ".
49 "-NoNameSvc -IORoutput $nfs_nfsiorfile $svcconf " .
50 "-ORBEndpoint iiop://$host:$port");
51 my $SUP = $sup->CreateProcess ("supplier", "$nts_ref");
52 my $CON = $con->CreateProcess ("consumer", "$nts_ref -t $consumer_runtime");
53 my $FLT = $flt->CreateProcess ("filter", "$nts_ref");
56 print "\n*********** Starting the Notify Service ***********\n\n";
57 $NFS_status = $NFS->Spawn ();
58 if ($NFS_status != 0) {
59 print STDERR "ERROR: Notify Service returned $NFS_status\n";
60 exit 1;
62 if ($nfs->WaitForFileTimed ($nfsiorfile,$nfs->ProcessStartWaitInterval()) == -1) {
63 print STDERR "ERROR: cannot find file <$nfs_nfsiorfile>\n";
64 $NFS->Kill (); $NFS->TimedWait (1);
65 exit 1;
68 if ($persistent_test == 0) {
69 print "\n*********** Starting the filter test ***********\n\n";
70 $FLT_status = $FLT->SpawnWaitKill ($flt->ProcessStartWaitInterval());
71 if ($FLT_status != 0) {
72 print STDERR "ERROR: Filter returned $FLT_status\n";
73 $NFS->Kill (); $NFS->TimedWait (1);
74 exit 1;
76 print "\n*********** Filter test passed ***********\n\n";
79 print "\n*********** Starting the notification Consumer ***********\n\n";
80 print STDERR $CON->CommandLine (). "\n";
82 $CON_status = $CON->Spawn ();
83 if ($CON_status != 0) {
84 print STDERR "ERROR: Consumer returned $CON_status\n";
85 $NFS->Kill (); $NFS->TimedWait (1);
86 exit 1;
89 sleep(5);
91 if ($persistent_test == 1) {
92 print "*********** Killing the first Notify Service ***********\n";
93 $NFS_status = $NFS->TerminateWaitKill ($nfs->ProcessStopWaitInterval());
94 if ($NFS_status != 0) {
95 print STDERR "ERROR: Notification Service returned $NFS_status\n";
96 $CON->Kill (); $CON->TimedWait (1);
97 exit 1;
99 sleep(1);
101 $nfs->DeleteFile ($nfsiorfile);
103 print "*********** Starting the second Notify Service ***********\n";
104 print STDERR $NFS->CommandLine (). "\n";
105 $NFS_status = $NFS->Spawn ();
106 if ($NFS_status != 0) {
107 print STDERR "ERROR: Notify Service returned $NFS_status\n";
108 $CON->Kill (); $CON->TimedWait (1);
109 exit 1;
111 if ($nfs->WaitForFileTimed ($nfsiorfile,$nfs->ProcessStartWaitInterval()) == -1) {
112 print STDERR "ERROR: cannot find file <$nfs_nfsiorfile>\n";
113 $CON->Kill (); $CON->TimedWait (1);
114 $NFS->Kill (); $NFS->TimedWait (1);
115 exit 1;
118 sleep(5);
121 print "\n*********** Starting the notification Supplier ***********\n\n";
122 print STDERR $SUP->CommandLine (). "\n";
124 $SUP_status = $SUP->Spawn ();
125 if ($SUP_status != 0) {
126 print STDERR "ERROR: Supplier returned $SUP_status\n";
127 $CON->Kill (); $CON->TimedWait (1);
128 $NFS->Kill (); $NFS->TimedWait (1);
129 exit 1;
132 $SUP_status = $SUP->WaitKill ($sup->ProcessStopWaitInterval());
133 if ($SUP_status != 0) {
134 print STDERR "ERROR: Supplier returned $SUP_status\n";
135 $status =1;
138 $CON_status = $CON->WaitKill ($con->ProcessStopWaitInterval()+$consumer_runtime);
139 if ($CON_status != 0) {
140 print STDERR "ERROR: Consumer returned $CON_status\n";
141 $status =1;
144 $NFS_status = $NFS->TerminateWaitKill ($nfs->ProcessStopWaitInterval());
145 if ($NFS_status != 0) {
146 print STDERR "ERROR: Notification Service returned $NFS_status\n";
147 $status = 1;
150 $nfs->DeleteFile ($nfsiorfile);
152 exit $status;