summaryrefslogtreecommitdiff
path: root/TAO/tests/OBV/Collocated/Forward/run_test.pl
blob: f47b12fe2da060db7d00daf62f1d64541ad0ede6 (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
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::TestTarget;

my $collocated = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";

$iorbase = "test.ior";
$iorfile = $collocated->LocalFile ("test.ior");
$collocated->DeleteFile ($iorbase);

$CO = $collocated->CreateProcess ("collocated");

$collocated_status = $CO->Spawn ();

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

if ($collocated->WaitForFileTimed ($iorbase,
                                   $collocated->ProcessStartWaitInterval ()) == -1) {
    print STDERR "ERROR: cannot find file <$iorfile>\n";
    $CO->Kill (); $CO->TimedWait (1);
    exit 1;
}

$collocated_status = $CO->WaitKill ($collocated->ProcessStopWaitInterval ());

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

$collocated->DeleteFile ($iorbase);

exit $collocated_status;