summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/examples/CosEC/Simple/run_test.pl
blob: 43dea3aa3cc3ad01d12b31200a13476b5c922dbe (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
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;

$iorfile = PerlACE::LocalFile ("ec.ior");

unlink $iorfile;

$T = new PerlACE::Process ("Service",  "-o $iorfile");
$C = new PerlACE::Process ("Consumer", "file://$iorfile");
$S = new PerlACE::Process ("Supplier", "file://$iorfile");

$T->Spawn ();

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

$C->Spawn ();

sleep 5;

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

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

$consumer = $C->WaitKill (15);

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

$service = $T->TerminateWaitKill (5);

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

unlink $iorfile;

exit $status;