summaryrefslogtreecommitdiff
path: root/TAO/tests/Bug_2735_Regression/run_test.pl
blob: 70bf92430e89fa8a7deb81312e05868c39c0c219 (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::TestTarget;
use File::Spec;

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

## First test that the -ORBSvcConfDirective works with good options.
my $SV = $server->CreateProcess ("server", "-s");

$server_status = $SV->Spawn ($server->ProcessStartWaitInterval());

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

$server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());

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

## Next, test that the -ORBSvcConfDirective gives an error with bad
## options.
$SV = $server->CreateProcess ("server", "-f");

## Run the server, but redirect stdout and stderr to /dev/null
## so that the errors messages don't show up on the scoreboard

open(STDOUT, '>' . File::Spec->devnull());
open(STDERR, ">&STDOUT");

$server_status = $SV->Spawn ($server->ProcessStartWaitInterval());

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

$server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());

open(STDOUT, ">&SAVEOUT");
open(STDERR, ">&SAVEERR");

## It should have thrown an exception, so if the server exits
## with a zero status, then something is wrong.
if ($server_status == 0) {
    print STDERR "ERROR: server returned $server\n";
    exit(1);
}


exit(0);