Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Bug_1330_Regression / run_test.pl
blobc46f85446808fa9b46ab4affd0ee90156a408029
1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
3 if 0;
5 # -*- perl -*-
7 use lib "$ENV{ACE_ROOT}/bin";
8 use PerlACE::TestTarget;
10 $status = 0;
11 $debug_level = '0';
15 foreach $i (@ARGV) {
16 if ($i eq '-debug') {
17 $debug_level = '10';
21 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
22 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
24 $TARGETHOSTNAME = $server->HostName();
25 $port = $server->RandomPort();
27 my $iorbase = "server.ior";
28 my $server_iorfile = $server->LocalFile ($iorbase);
29 $server->DeleteFile($iorbase);
31 $SV = $server->CreateProcess ("server",
32 "-ORBdebuglevel $debug_level " .
33 "-ORBEndpoint iiop://:$port " .
34 "-o $server_iorfile");
36 $CL1 = $client->CreateProcess ("client",
37 "-ORBdebuglevel $debug_level -k \"corbaloc:iiop:$TARGETHOSTNAME:$port/Name\\2dwith\\2dhyphens\"");
39 $CL2 = $client->CreateProcess ("client",
40 "-ORBdebuglevel $debug_level -s -k corbaloc:iiop:$TARGETHOSTNAME:$port/Name%2dwith%2dhyphens");
43 $server_status = $SV->Spawn ();
45 if ($server_status != 0) {
46 print STDERR "ERROR: server returned $server_status\n";
47 exit 1;
50 if ($server->WaitForFileTimed ($iorbase,
51 $server->ProcessStartWaitInterval()) == -1) {
52 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
53 $SV->Kill (); $SV->TimedWait (1);
54 exit 1;
57 $client_status = $CL1->SpawnWaitKill ($client->ProcessStartWaitInterval());
59 if ($client_status != 0) {
60 print STDERR "ERROR: Bug 1330 Regression failed. Correct escape characters rejected\n";
61 $status = 1;
64 $client_status = $CL2->SpawnWaitKill ($client->ProcessStartWaitInterval());
66 if ($client_status != 0) {
67 print STDERR "ERROR: Bug 1330 Regression failed. Correct escape characters rejected\n";
68 $status = 1;
71 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
73 if ($server_status != 0) {
74 print STDERR "ERROR: server returned $server_status\n";
75 $status = 1;
78 $server->DeleteFile($iorbase);
80 exit $status;