1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
7 use lib
"$ENV{ACE_ROOT}/bin";
8 use PerlACE
::TestTarget
;
10 my $usage = "Usage: ORB_portspan/run_test.pl [-iiop|-diop]";
17 elsif ($i eq "-diop") {
21 print STDERR
"ERROR: Unknown option: $i\n$usage\n";
27 print STDERR
"ERROR: $usage\n";
33 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
35 $port = $server->RandomPort ();
36 $endpoint = "$protocol://:$port/portspan=2";
39 if (-e
"svc-$protocol.conf") {
40 $svcconf = "-ORBSvcConf svc-$protocol.conf";
41 print STDOUT
"Using $svcconf\n";
44 print STDOUT
"Creating three $protocol servers with endpoint $endpoint...\n";
46 $SV1 = $server->CreateProcess ("server", "-ORBEndpoint $endpoint $svcconf");
47 $SV2 = $server->CreateProcess ("server", "-ORBEndpoint $endpoint $svcconf");
48 $SV3 = $server->CreateProcess ("server", "-ORBEndpoint $endpoint $svcconf");
50 print STDOUT
"Starting server 1\n";
51 $server_status = $SV1->Spawn ();
52 if ($server_status != 0) {
53 print STDERR
"ERROR: server failed to start: $server_status\n";
56 $server_status = $SV1->Wait (1);
57 if ($server_status != -1) {
58 print STDERR
"ERROR: server exited prematurely: $server_status\n";
61 print STDOUT
"Started server 1\n";
63 print STDOUT
"Starting server 2\n";
64 $server_status = $SV2->Spawn ();
65 if ($server_status != 0) {
66 print STDERR
"ERROR: server failed to start: $server_status\n";
70 $server_status = $SV2->Wait (1);
71 if ($server_status != -1) {
72 print STDERR
"ERROR: server exited prematurely: $server_status\n";
75 print STDOUT
"Started server 2\n";
77 print STDOUT
"Starting server 3\n";
78 $server_status = $SV3->Spawn ();
79 if ($server_status == 0) {
80 $server_status = $SV3->Wait (1);
81 if ($server_status == -1) {
82 print STDERR
"ERROR: Last server didn't fail, still running!\n";
89 print STDOUT
"Success: server 3 failed to start, stopping...\n";
95 print STDOUT
"Portspan $protocol test completed successfully.\n\n";