Merge pull request #2303 from jwillemsen/jwi-803
[ACE_TAO.git] / TAO / tests / DIOP / run_test_ipv6.pl
blobe91775cc6118543ed33fc3782f0a6194979964e7
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';
13 $iterations = '10';
14 $port = '8888';
15 $timeout = '10';
16 $hostname = '[::1]';
18 foreach $i (@ARGV) {
19 if ($i eq '-debug') {
20 $debug_level = '10';
24 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
25 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
27 my $iorbase = "test.ior";
28 my $server_iorfile = $server->LocalFile ($iorbase);
29 my $client_iorfile = $client->LocalFile ($iorbase);
30 $server->DeleteFile($iorbase);
31 $client->DeleteFile($iorbase);
33 $SV = $server->CreateProcess ("server",
34 "-ORBdebuglevel $debug_level " .
35 "-ORBEndpoint diop://$hostname:$port " .
36 "-o $server_iorfile");
38 $CL = $client->CreateProcess ("client",
39 "-ORBdebuglevel $debug_level " .
40 "-k file://$client_iorfile " .
41 "-t $timeout -i $iterations");
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 if ($server->GetFile ($iorbase) == -1) {
58 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
59 $SV->Kill (); $SV->TimedWait (1);
60 exit 1;
62 if ($client->PutFile ($iorbase) == -1) {
63 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
64 $SV->Kill (); $SV->TimedWait (1);
65 exit 1;
68 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 75);
70 if ($client_status != 0) {
71 print STDERR "ERROR: client returned $client_status\n";
72 $status = 1;
75 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
77 if ($server_status != 0) {
78 print STDERR "ERROR: server returned $server_status\n";
79 $status = 1;
82 $server->DeleteFile($iorbase);
83 $client->DeleteFile($iorbase);
85 exit $status;