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

## Avoid code duplication by determining the process type and
## storing it as a string for use later.
my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' :
                                          'PerlACE::Process');

## First test that the -ORBSvcConfDirective works with good options.
my $SV = $class->new('server',
                     '-ORBSvcConfDirective "static ' .
                     'Server_Strategy_Factory \'-ORBConcurrency ' .
                     'thread-per-connection\'"');
$SV->Spawn ();
my $server = $SV->WaitKill(5);
if ($server != 0) {
  print STDERR "ERROR: server returned $server\n";
  exit(1);
}

## Next, test that the -ORBSvcConfDirective gives an error with bad
## options.
$SV = $class->new('server',
                  '-ORBSvcConfDirective "static Foo_Strategy_Factory"');

## Run the server, but redirect stdout and stderr to /dev/null
## so that the errors messages don't show up on the scoreboard
open(SAVEOUT, ">&STDOUT");
open(SAVEERR, ">&STDERR");
open(STDOUT, '>' . File::Spec->devnull());
open(STDERR, ">&STDOUT");
$SV->Spawn ();
$server = $SV->WaitKill(5);
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 == 0) {
  print STDERR "ERROR: server returned $server\n";
  exit(1);
}


exit(0);