diff options
author | jwh1 <jwh1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-06-22 22:13:49 +0000 |
---|---|---|
committer | jwh1 <jwh1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-06-22 22:13:49 +0000 |
commit | c5297184be87e858260eba324e25611caeb37786 (patch) | |
tree | e9149d001922dae54962a81fa80acab839f32c66 /TAO/orbsvcs/tests/Time | |
parent | b43a960dc1912c97227a1e9f6d30f5f5acf4c345 (diff) | |
download | ATCD-c5297184be87e858260eba324e25611caeb37786.tar.gz |
Changed to reflect new guidelines on blocking.
Diffstat (limited to 'TAO/orbsvcs/tests/Time')
-rwxr-xr-x | TAO/orbsvcs/tests/Time/run_test.pl | 98 |
1 files changed, 69 insertions, 29 deletions
diff --git a/TAO/orbsvcs/tests/Time/run_test.pl b/TAO/orbsvcs/tests/Time/run_test.pl index a0236d03047..1f1f47aefcd 100755 --- a/TAO/orbsvcs/tests/Time/run_test.pl +++ b/TAO/orbsvcs/tests/Time/run_test.pl @@ -12,6 +12,7 @@ require ACEutils; $server_ior = "server_ior"; $clerk_ior = "clerk_ior"; $implrepo_ior = "implrepo.ior"; +$status = 0; # Make sure the files are gone, so we can wait on them. @@ -31,13 +32,18 @@ sub time_service_test_using_naming_service sleep 10; - $status = system ($EXEPREFIX."client".$EXE_EXT. - ""); + $CL = system ($EXEPREFIX."client".$EXE_EXT, ""); + + if ($CL->TimedWait (60) == -1) { + print STDERR "ERROR: client timedout\n"; + $status = 1; + $CL->Kill (); $CL->TimedWait (1); + } $SV1->Kill (); $SV2->Kill (); - $SV1->Wait (); - $SV2->Wait (); + $SV1->TimedWait (1); + $SV2->TimedWait (1); } sub time_service_test_using_files @@ -45,24 +51,41 @@ sub time_service_test_using_files $SV1 = Process::Create ($time_dir."server".$EXE_EXT, "-o $server_ior"); - ACE::waitforfile ($server_ior); - sleep 5; - - $SV2 = Process::Create ($time_dir."clerk".$EXE_EXT, - "-f $server_ior -o clerk_ior -t 2"); - - ACE::waitforfile ($clerk_ior); - - sleep 10; - - $status = system ($EXEPREFIX."client".$EXE_EXT. - " -f clerk_ior"); - - $SV1->Kill (); - $SV2->Kill (); - $SV1->Wait (); - $SV2->Wait (); - + if (ACE::waitforfile_timed ($server_ior, 5) == -1) { + print STDERR "ERROR: timedout waiting for file <$server_ior>\n"; + $status = 1; + $SV1->Kill (); $SV1->TimedWait (1); + } + else { + + sleep 5; + + $SV2 = Process::Create ($time_dir."clerk".$EXE_EXT, + "-f $server_ior -o clerk_ior -t 2"); + + if (ACE::waitforfile_timed ($clerk_ior, 5) == -1) { + print STDERR "ERROR: timedout waiting for file <$clerk_ior>\n"; + $status = 1; + $SV2->Kill (); $SV2->TimedWait (1); + } + else { + + sleep 10; + + $CL = Process::Create ($EXEPREFIX."client".$EXE_EXT, + " -f clerk_ior"); + if ($CL->TimedWait (60) == -1) { + print STDERR "ERROR: client timedout\n"; + $status = 1; + $CL->Kill (); $CL->TimedWait (1); + } + + $SV1->Kill (); + $SV2->Kill (); + $SV1->TimedWait (1); + $SV2->TimedWait (1); + } + } unlink $clerk_ior; unlink $server_ior; } @@ -73,12 +96,21 @@ sub time_service_test_using_ir $IR = Process::Create ($ir_dir."ImplRepo_Service".$EXE_EXT, "-ORBsvcconf implrepo.conf -d 1"); - ACE::waitforfile ($implrepo_ior); + if (ACE::waitforfile_timed ($implrepo_ior, 5) == -1) { + print STDERR "ERROR: timedout waiting for file <$implrepo_ior>\n"; + $IR->Kill (); $IR->TimedWait (1); + exit 1; + } $SV1 = Process::Create ($time_dir."server".$EXE_EXT, "-o $server_ior -i -r"); - ACE::waitforfile ($server_ior); + if (ACE::waitforfile_timed ($server_ior, 5) == -1) { + print STDERR "ERROR: timedout waiting for file <$implerepo_ior>\n"; + $IR->Kill (); $IR->TimedWait (1); + $SV1->Kill (); $SV1->TimedWait (1); + exit 1; + } sleep 10; @@ -87,14 +119,20 @@ sub time_service_test_using_ir sleep 10; - system($EXEPREFIX."client.$EXE_EXT -f $clerk_ior"); - + $CL = Process::Create ($EXEPREFIX."client.$EXE_EXT", "-f $clerk_ior"); + + if ($CL->TimedWait (60) == -1) { + print STDERR "ERROR: client timedout\n"; + $status = 1; + $CL->Kill (); $CL->TimedWait (1); + } + $IR->Kill (); - $IR->Wait (); + $IR->TimedWait (1); $SV1->Kill (); - $SV1->Wait (); + $SV1->TimedWait (1); $SV2->Kill (); - $SV2->Wait (); + $SV2->TimedWait (1); unlink $clerk_ior; unlink $server_ior; @@ -137,3 +175,5 @@ for ($i = 0; $i <= $#ARGV; $i++) print "run_test: Unknown Option: ".$ARGV[$i]."\n"; } } + +exit $status; |