Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / tests / Notify / Validate_Client / run_test.pl
blobcfe55680976dfd4c514b6762c7f799d75fea3a3c
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 $conf = $PerlACE::svcconf_ext;
15 foreach $i (@ARGV) {
16 if ($i eq '-debug') {
17 $debug_level = '10';
21 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
22 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
24 $iorbase = "notify.ior";
25 $notify_conf = "notify" . $conf;
27 my $server_iorfile = $server->LocalFile ($iorbase);
29 my $persistent_file_xml = "persistency.notif.xml";
30 my $persistent_file_000 = "persistency.notif.000";
32 my $server_conf = $server->LocalFile ($notify_conf);
34 my $server_persistent_file = $server->LocalFile ($persistent_file_xml);
35 my $persistent_file = $client->LocalFile ($persistent_file_xml);
37 $server->DeleteFile($iorbase);
38 $client->DeleteFile ($persistent_file_xml);
39 $client->DeleteFile ($persistent_file_000);
41 $SV = $server->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Notify_Service/tao_cosnotification",
42 "-ORBdebuglevel $debug_level " .
43 "-NoNameSvc " .
44 "-IORoutput $server_iorfile " .
45 "-ORBSvcConf $server_conf");
47 $CL = $client->CreateProcess ("proxy_dummy", "-o $persistent_file");
49 $client_status = $CL->Spawn ();
51 if ($client_status != 0) {
52 print STDERR "ERROR: client returned $client_status\n";
53 exit 1;
56 if ($client->WaitForFileTimed ($persistent_file_xml,
57 $client->ProcessStartWaitInterval()) == -1) {
58 print STDERR "ERROR: cannot find file <$persistent_file_xml>\n";
59 $CL->Kill (); $CL->TimedWait (1);
60 exit 1;
63 $server_status = $SV->Spawn ();
65 if ($server_status != 0) {
66 print STDERR "ERROR: server returned $server_status\n";
67 exit 1;
70 if ($server->WaitForFileTimed ($iorbase,
71 $server->ProcessStartWaitInterval()) == -1) {
72 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
73 $SV->Kill (); $SV->TimedWait (1);
74 exit 1;
77 sleep($server->ProcessStartWaitInterval / 2);
79 $found = 0 ;
80 open (I_FILE, "$persistent_file") ;
81 while( <I_FILE> ){
83 chomp ;
84 if( $_ =~ /proxy/ ){
85 $found = 1 ;
86 last ;
89 if( $found == 1 ){
90 print STDERR "ERROR: validate consumer/supplier test failed.\n" ;
91 $status = 1 ;
93 else{
94 print STDOUT "validate consumer/supplier test succeeded.\n";
97 $SV->Kill ();
98 $CL->Kill ();
100 $server->DeleteFile($iorbase);
101 $client->DeleteFile ($persistent_file_xml);
102 $client->DeleteFile ($persistent_file_000);
104 exit $status;