summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Notify/Validate_Client/run_test.pl
blob: bd989d4e6cb28ba76727ee82273a42e12c0e89fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
    & eval 'exec perl -S $0 $argv:q'
    if 0;

# $Id$
# -*- perl -*-

use lib "$ENV{ACE_ROOT}/bin";
use PerlACE::Run_Test;
use File::Copy;

PerlACE::check_privilege_group();

$notifyior = PerlACE::LocalFile ("notify.ior");
$notify_conf = PerlACE::LocalFile ("notify$PerlACE::svcconf_ext");

$persistent_file_prefix = "persistency.notif";
$persistent_file = PerlACE::LocalFile ("persistency.notif.xml");

$status = 0;

$port = PerlACE::uniqueid () + 10001;
$TS = new PerlACE::Process ("../../../Notify_Service/Notify_Service",
                            "-NoNameSvc " .
                            "-IORoutput $notifyior -ORBSvcConf " .
                            "$notify_conf");

unlink $notifyior;
unlink <$persistent_file_prefix.*>;

$DUMMY = new PerlACE::Process ("proxy_dummy", "-o $persistent_file");
$DUMMY->Spawn();
if (PerlACE::waitforfile_timed ($persistent_file, $PerlACE::wait_interval_for_process_creation) == -1) {
    print STDERR "ERROR: waiting for the proxy_dummy to start\n";
    $DUMMY->Kill ();
    exit 1;
}


$TS->Spawn ();

if (PerlACE::waitforfile_timed ($notifyior, $PerlACE::wait_interval_for_process_creation) == -1) {
    print STDERR "ERROR: waiting for the notify service to start\n";
    $TS->Kill ();
    $DUMMY->Kill ();
    exit 1;
}

sleep (10);

$found = 0 ;
open (I_FILE, "$persistent_file") ;
while( <I_FILE> )
{
   chomp ;
   if( $_ =~ /proxy/ )
   {
       $found = 1 ;
       last ;
   }
}
if( $found == 1 )
{
    print STDERR "ERROR: validate consumer/supplier test failed.\n" ;
    $status = 1 ;
}
else
{
    print STDOUT "validate consumer/supplier test succeeded.\n";
}

$TS->Kill ();
$DUMMY->Kill ();

unlink $persistent_file;
unlink $notifyior;


exit $status;