summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/FaultTolerance/IOGR/run_test.pl
blob: fe9d674c54723161b0b60dd084a4cea70e4ba8f9 (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
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;

$file1ior = PerlACE::LocalFile ("file1.ior");
$file2ior = PerlACE::LocalFile ("file2.ior");
$outputior = PerlACE::LocalFile ("output.ior");

unlink $file1ior, $file2ior, $outputior;

$SERV1 = new PerlACE::Process ("server", "-o $file1ior");
$SERV2 = new PerlACE::Process ("server", "-o $file2ior");
$MANAGER = new PerlACE::Process ("Manager", "-a file://$file1ior -b file://$file2ior -c $outputior");

print STDERR "Starting Server\n";

$SERV1->Spawn ();

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

print STDERR "Starting Server\n";

$SERV2->Spawn ();

if (PerlACE::waitforfile_timed ($file2ior, $PerlACE::wait_interval_for_process_creation) == -1) {
	print STDERR "ERROR: cannot find file <$file2ior>\n";
	$SERV1->Kill ();
	$SERV2->Kill ();
	exit 1;
}

print STDERR "Starting Manager\n";

$MANAGER->Spawn ();

$manager = $MANAGER->WaitKill (30);

$SERV1->WaitKill(5);

$SERV2->WaitKill(5);

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

unlink $file1ior, $file2ior, $outputior;

exit $status