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
;
17 for ($i = 0; $i <= $#ARGV; $i++) {
18 if ($ARGV[$i] eq "-d") {
26 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
27 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
29 my $iorbase = "if_repo.ior";
30 my $backing_file = "ifr_default_backing_store";
33 my $server_iorfile = $server->LocalFile ($iorbase);
34 my $server_backing_file = $server->LocalFile ($backing_file);
35 my $client_iorfile = $client->LocalFile ($iorbase);
36 $server->DeleteFile($iorbase);
37 $server->DeleteFile($backing_file);
38 $client->DeleteFile($iorbase);
40 $SV = $server->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/IFR_Service/tao_ifr_service",
41 " -o $server_iorfile " .
44 $CL = $client->CreateProcess ("Persistence_Test",
45 "-ORBInitRef InterfaceRepository=file://$client_iorfile");
47 $server_status = $SV->Spawn ();
49 if ($server_status != 0) {
50 print STDERR
"ERROR: server returned $server_status\n";
54 if ($server->WaitForFileTimed ($iorbase,
55 $server->ProcessStartWaitInterval()) == -1) {
56 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
57 $SV->Kill (); $SV->TimedWait (1);
58 $server->DeleteFile($backing_file);
62 if ($server->GetFile ($iorbase) == -1) {
63 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
64 $SV->Kill (); $SV->TimedWait (1);
65 $server->DeleteFile($backing_file);
68 if ($client->PutFile ($iorbase) == -1) {
69 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
70 $SV->Kill (); $SV->TimedWait (1);
71 $server->DeleteFile($backing_file);
75 print "Starting Persistence_Test 1\n";
77 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
79 if ($client_status != 0) {
80 print STDERR
"ERROR: client returned $client_status\n";
84 print "Terminating IFR_Service\n";
85 $server_status = $SV->TerminateWaitKill ($server->ProcessStopWaitInterval());
87 if ($server_status != 0) {
88 print STDERR
"ERROR: server returned $server_status\n";
92 $server->DeleteFile($iorbase);
93 $client->DeleteFile($iorbase);
95 $CL->Arguments ("-ORBInitRef InterfaceRepository=file://$client_iorfile $debug $query_opt");
97 $server_status = $SV->Spawn ();
99 if ($server_status != 0) {
100 print STDERR
"ERROR: server returned $server_status\n";
104 if ($server->WaitForFileTimed ($iorbase,
105 $server->ProcessStartWaitInterval()) == -1) {
106 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
107 $SV->Kill (); $SV->TimedWait (1);
108 $server->DeleteFile($backing_file);
112 if ($server->GetFile ($iorbase) == -1) {
113 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
114 $SV->Kill (); $SV->TimedWait (1);
115 $server->DeleteFile($backing_file);
118 if ($client->PutFile ($iorbase) == -1) {
119 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
120 $SV->Kill (); $SV->TimedWait (1);
121 $server->DeleteFile($backing_file);
125 print "Starting Persistence_Test 2\n";
127 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
129 if ($client_status != 0) {
130 print STDERR
"ERROR: client returned $client_status\n";
134 print "Terminating IFR_Service\n";
135 $server_status = $SV->TerminateWaitKill ($server->ProcessStopWaitInterval());
137 if ($server_status != 0) {
138 print STDERR
"ERROR: server returned $server_status\n";
142 $server->DeleteFile($iorbase);
143 $client->DeleteFile($iorbase);
144 $server->DeleteFile($backing_file);