summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Notify/Basic/run_test.pl
blob: 0e059f3c9a039b878b5970f8de9682c98b551eda (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
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
    & eval 'exec perl -S $0 $argv:q'
    if 0;

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

use lib "../../../../../bin";
use PerlACE::Run_Test;

$experiment_timeout = 60;
$startup_timeout = 60;
$notifyior = PerlACE::LocalFile ("notify.ior");
$namingior = PerlACE::LocalFile ("naming.ior");
$status = 0;

unlink $notifyior;
unlink $namingior;

$Naming = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
                                "-o $namingior");
$Notification = new PerlACE::Process ("../../../Notify_Service/Notify_Service",
                                      "-ORBInitRef NameService=file://$namingior " .
                                      "-IORoutput $notifyior " .
                                      "-ORBSvcConf ../../../Notify_Service/svc.conf");
@tests = 
  (
   "AdminProperties",
   "ConnectDisconnect",
   "Events",
   "IdAssignment",
   "LifeCycle",
   "Simple",
   "MultiTypes",
   "Filter",
   "Updates",
  );

$Naming->Spawn ();

if (PerlACE::waitforfile_timed ($namingior, $startup_timeout) == -1) {
    print STDERR "ERROR: waiting for the naming service to start\n";
    $Naming->Kill ();
    exit 1;
}

$Notification->Spawn ();

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

for $name (@tests)
  {
    print STDERR "\nTesting $name....\n\n";
    $test = new PerlACE::Process ("./$name",
                                  "-ORBInitRef NameService=file://$namingior ");
    $test->Spawn ();

    $status = $test->WaitKill ($experiment_timeout);

    if ($status != 0) 
    {
        print STDERR "ERROR: $name returned $status\n";
        break;
    }
  }


$Notification->Kill ();
$Naming->Kill ();

unlink $namingior;
unlink $notifyior;

exit $status;