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
;
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;
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') {
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";
62 if ($nfs->WaitForFileTimed ($nfsiorfile,$nfs->ProcessStartWaitInterval()) == -1) {
63 print STDERR
"ERROR: cannot find file <$nfs_nfsiorfile>\n";
64 $NFS->Kill (); $NFS->TimedWait (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);
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);
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);
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);
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);
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);
132 $SUP_status = $SUP->WaitKill ($sup->ProcessStopWaitInterval());
133 if ($SUP_status != 0) {
134 print STDERR
"ERROR: Supplier returned $SUP_status\n";
138 $CON_status = $CON->WaitKill ($con->ProcessStopWaitInterval()+$consumer_runtime);
139 if ($CON_status != 0) {
140 print STDERR
"ERROR: Consumer returned $CON_status\n";
144 $NFS_status = $NFS->TerminateWaitKill ($nfs->ProcessStopWaitInterval());
145 if ($NFS_status != 0) {
146 print STDERR
"ERROR: Notification Service returned $NFS_status\n";
150 $nfs->DeleteFile ($nfsiorfile);