summaryrefslogtreecommitdiff
path: root/TAO/examples/Callback_Quoter/run_test.pl
blob: eb62f6acf312da1d2436a27eb6229513a73bc9e4 (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
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;

$status = 0;
$ns_ior = PerlACE::LocalFile ("NameService.ior");
$sleeptime = 5;

unlink $ns_ior;

$NS = new PerlACE::Process ("../../orbsvcs/Naming_Service/Naming_Service", "-o $ns_ior");
$N = new PerlACE::Process ("notifier", "-ORBInitRef NameService=file://$ns_ior");
$C = new PerlACE::Process ("consumer", "-ORBInitRef NameService=file://$ns_ior -t 12 -a TAO");
$S = new PerlACE::Process ("supplier", "-ORBInitRef NameService=file://$ns_ior -iexample.stocks");

print STDERR "================ Remote test\n";

$NS->Spawn ();

if (PerlACE::waitforfile_timed ($ns_ior, 5) == -1) {
    print STDERR "ERROR: cannot find file <$ns_ior>\n";
    $NS->Kill (); 
    exit 1;
}


$N->Spawn ();

sleep $sleeptime;

$C->Spawn ();

sleep $sleeptime;

$supplier = $S->SpawnWaitKill (60);

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

$server = $C->TerminateWaitKill (5);

if ($server != 0) {
    print STDERR "ERROR: consumer returned $server\n";
    $status = 1;
}

$server = $N->TerminateWaitKill (5);

if ($server != 0) {
    print STDERR "ERROR: notifier returned $server\n";
    $status = 1;
}

$server = $NS->TerminateWaitKill (5);

if ($server != 0) {
    print STDERR "ERROR: naming service returned $server\n";
    $status = 1;
}

unlink $ns_ior;

exit $status;