summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-09-14 08:46:48 +0000
committermcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-09-14 08:46:48 +0000
commit3ffbd69c80594d6e366a77c291ff37273ce258ba (patch)
treec53aa99f4fabe073747965c90d19c724871fac7a
parent0a818e13a9d706468b79e69f0505f9abe2206ce1 (diff)
downloadATCD-3ffbd69c80594d6e366a77c291ff37273ce258ba.tar.gz
ChangeLogTag: Tue Sep 14 08:41:00 UTC 2004 Martin Corino <mcorino@remedy.nl>
-rw-r--r--TAO/ChangeLog26
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl28
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/run_test.pl22
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Component_Switching/run_test.pl23
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Full_Profile/run_test.pl54
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Modify_QoS/run_test.pl23
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Multicast/run_test.pl23
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/run_test.pl23
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Multiple_Flows/run_test.pl21
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl49
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/run_test.pl21
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/run_test.pl23
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/run_test.pl49
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/run_test.pl49
-rw-r--r--bin/PerlACE/Run_Test.pm25
15 files changed, 129 insertions, 330 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index bc2ac050841..830a3709b4c 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,4 +1,28 @@
->Mon Sep 13 15:56:53 2004 J.T. Conklin <jtc@acorntoolworks.com>
+Tue Sep 14 08:41:00 UTC 2004 Martin Corino <mcorino@remedy.nl>
+
+ * bin/PerlACE/Run_test.pm:
+
+ Added a new PerlACE::generate_test_file(<basename>, <size>) subroutine
+ to be used with tests needing (large) testdata as input (like AVStreams
+ tests).
+
+ * tao/orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl:
+ * tao/orbsvcs/tests/AVStreams/Bidirectional_Flows/run_test.pl:
+ * tao/orbsvcs/tests/AVStreams/Component_Switching/run_test.pl:
+ * tao/orbsvcs/tests/AVStreams/Full_Profile/run_test.pl:
+ * tao/orbsvcs/tests/AVStreams/Modify_QoS/run_test.pl:
+ * tao/orbsvcs/tests/AVStreams/Multicast/run_test.pl:
+ * tao/orbsvcs/tests/AVStreams/Multicast_Full_Profile/run_test.pl:
+ * tao/orbsvcs/tests/AVStreams/Multiple_Flows/run_test.pl:
+ * tao/orbsvcs/tests/AVStreams/Pluggable/run_test.pl:
+ * tao/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/run_test.pl:
+ * tao/orbsvcs/tests/AVStreams/Simple_Three_Stage/run_test.pl:
+ * tao/orbsvcs/tests/AVStreams/Simple_Two_Stage/run_test.pl:
+ * tao/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/run_test.pl:
+
+ Changed to use the new PerlACE::generate_test_file() subroutine.
+
+Mon Sep 13 15:56:53 2004 J.T. Conklin <jtc@acorntoolworks.com>
* orbsvcs/tests/Trading/Trading.mpc:
diff --git a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl
index 43c15be216f..2495144eff1 100755
--- a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl
+++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl
@@ -18,27 +18,7 @@ $nsior = PerlACE::LocalFile ("ns.ior");
$testfile = PerlACE::LocalFile ("output");
# generate test stream data
-$input = "test_input";
-while ( -e $input ) {
- $input = $input."X";
-}
-open( INPUT, "> $input" ) || die( "can't create input file: $input" );
-for($i =0; $i < 1000 ; $i++ ) {
- print INPUT <<EOFINPUT;
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-EOFINPUT
-}
-close(INPUT);
-
+$input = PerlACE::generate_test_file("test_input", 102400);
unlink $nsior;
@@ -57,7 +37,7 @@ $NS->Spawn ();
if (PerlACE::waitforfile_timed ($nsior, 10) == -1) {
print STDERR "ERROR: cannot find naming service IOR file\n";
- $NS->Kill ();
+ $NS->Kill ();
exit 1;
}
@@ -127,7 +107,7 @@ $NS->Spawn ();
if (PerlACE::waitforfile_timed ($nsior, 10) == -1) {
print STDERR "ERROR: cannot find naming service IOR file\n";
- $NS->Kill ();
+ $NS->Kill ();
exit 1;
}
@@ -197,7 +177,7 @@ $NS->Spawn ();
if (PerlACE::waitforfile_timed ($nsior, 10) == -1) {
print STDERR "ERROR: cannot find naming service IOR file\n";
- $NS->Kill ();
+ $NS->Kill ();
exit 1;
}
diff --git a/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/run_test.pl
index 482b8444379..efe05403c37 100755
--- a/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/run_test.pl
+++ b/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/run_test.pl
@@ -18,27 +18,7 @@ $nsior = PerlACE::LocalFile ("ns.ior");
$outfile = PerlACE::LocalFile ("output");
# generate test stream data
-$input = "test_input";
-while ( -e $input ) {
- $input = $input."X";
-}
-open( INPUT, "> $input" ) || die( "can't create input file: $input" );
-for($i =0; $i < 1000 ; $i++ ) {
- print INPUT <<EOFINPUT;
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-EOFINPUT
-}
-close(INPUT);
-
+$input = PerlACE::generate_test_file("test_input", 102400);
unlink $nsior;
diff --git a/TAO/orbsvcs/tests/AVStreams/Component_Switching/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Component_Switching/run_test.pl
index 0557c5928f2..386c038f9a0 100755
--- a/TAO/orbsvcs/tests/AVStreams/Component_Switching/run_test.pl
+++ b/TAO/orbsvcs/tests/AVStreams/Component_Switching/run_test.pl
@@ -20,26 +20,7 @@ $nsior = PerlACE::LocalFile ("ns.ior");
$testfile = PerlACE::LocalFile ("output");
# generate test stream data
-$input = "test_input";
-while ( -e $input ) {
- $input = $input."X";
-}
-open( INPUT, "> $input" ) || die( "can't create input file: $input" );
-for($i =0; $i < 1000 ; $i++ ) {
- print INPUT <<EOFINPUT;
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-EOFINPUT
-}
-close(INPUT);
+$input = PerlACE::generate_test_file("test_input", 102400);
unlink $nsior;
@@ -62,7 +43,7 @@ $NS->Spawn ();
if (PerlACE::waitforfile_timed ($nsior, 10) == -1) {
print STDERR "ERROR: cannot find naming service IOR file\n";
- $NS->Kill ();
+ $NS->Kill ();
exit 1;
}
diff --git a/TAO/orbsvcs/tests/AVStreams/Full_Profile/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Full_Profile/run_test.pl
index d6df72209c9..242253d1740 100755
--- a/TAO/orbsvcs/tests/AVStreams/Full_Profile/run_test.pl
+++ b/TAO/orbsvcs/tests/AVStreams/Full_Profile/run_test.pl
@@ -19,38 +19,18 @@ $outfile = PerlACE::LocalFile ("output");
$debug = 0;
-unlink # generate test stream data
-$input = "test_input";
-while ( -e $input ) {
- $input = $input."X";
-}
-open( INPUT, "> $input" ) || die( "can't create input file: $input" );
-for($i =0; $i < 1000 ; $i++ ) {
- print INPUT <<EOFINPUT;
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-EOFINPUT
-}
-close(INPUT);
-
-$nsior;
+unlink $nsior;
+# generate test stream data
+$input = PerlACE::generate_test_file("test_input", 102400);
@protocols = ("TCP",
"UDP"
);
-for ($i = 0; $i <= $#ARGV; $i++)
+for ($i = 0; $i <= $#ARGV; $i++)
{
- if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?")
+ if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?")
{
print STDERR "\nusage: run_test\n";
@@ -62,7 +42,7 @@ for ($i = 0; $i <= $#ARGV; $i++)
exit;
}
- elsif ($ARGV[$i] eq "-d")
+ elsif ($ARGV[$i] eq "-d")
{
$debug = $ARGV[$i + 1];
$i++;
@@ -75,10 +55,10 @@ print STDERR "Starting Naming Service\n";
$NS->Spawn ();
-if (PerlACE::waitforfile_timed ($nsior, 10) == -1)
+if (PerlACE::waitforfile_timed ($nsior, 10) == -1)
{
print STDERR "ERROR: cannot find naming service IOR file\n";
- $NS->Kill ();
+ $NS->Kill ();
exit 1;
}
@@ -90,31 +70,31 @@ for $protocol (@protocols)
{
$output_file = "RTP_output";
}
- else {
+ else {
$output_file = $protocol."_output";
}
$SV = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior -ORBDebugLevel ".$debug." -f ".$output_file);
$CL = new PerlACE::Process ("ftp", "-ORBInitRef NameService=file://$nsior -ORBDebugLevel ".$debug." -p ".$protocol." -f $input");
-
+
print STDERR "Using ".$protocol."\n";
print STDERR "Starting Server\n";
-
+
$SV->Spawn ();
-
+
sleep $sleeptime;
-
+
print STDERR "Starting Client\n";
-
+
$sender = $CL->SpawnWaitKill (200);
-
+
if ($sender != 0) {
print STDERR "ERROR: sender returned $sender\n";
$status = 1;
}
-
+
$receiver = $SV->TerminateWaitKill (200);
-
+
if ($receiver != 0) {
print STDERR "ERROR: receiver returned $receiver\n";
$status = 1;
diff --git a/TAO/orbsvcs/tests/AVStreams/Modify_QoS/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Modify_QoS/run_test.pl
index ba441e80fd2..878bbe54a79 100755
--- a/TAO/orbsvcs/tests/AVStreams/Modify_QoS/run_test.pl
+++ b/TAO/orbsvcs/tests/AVStreams/Modify_QoS/run_test.pl
@@ -18,26 +18,7 @@ $nsior = PerlACE::LocalFile ("ns.ior");
$outfile = PerlACE::LocalFile ("output");
# generate test stream data
-$input = "test_input";
-while ( -e $input ) {
- $input = $input."X";
-}
-open( INPUT, "> $input" ) || die( "can't create input file: $input" );
-for($i =0; $i < 1000 ; $i++ ) {
- print INPUT <<EOFINPUT;
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-EOFINPUT
-}
-close(INPUT);
+$input = PerlACE::generate_test_file("test_input", 102400);
unlink $nsior;
@@ -51,7 +32,7 @@ $NS->Spawn ();
if (PerlACE::waitforfile_timed ($nsior, 5) == -1) {
print STDERR "ERROR: cannot find naming service IOR file\n";
- $NS->Kill ();
+ $NS->Kill ();
exit 1;
}
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Multicast/run_test.pl
index 5d765cf3e20..9552c5f8c89 100755
--- a/TAO/orbsvcs/tests/AVStreams/Multicast/run_test.pl
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast/run_test.pl
@@ -19,26 +19,7 @@ $test1 = PerlACE::LocalFile ("test1");
$test2 = PerlACE::LocalFile ("test2");
# generate test stream data
-$input = "test_input";
-while ( -e $input ) {
- $input = $input."X";
-}
-open( INPUT, "> $input" ) || die( "can't create input file: $input" );
-for($i =0; $i < 1000 ; $i++ ) {
- print INPUT <<EOFINPUT;
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-EOFINPUT
-}
-close(INPUT);
+$input = PerlACE::generate_test_file("test_input", 102400);
unlink $nsior, $test1, $test2;
@@ -53,7 +34,7 @@ $NS->Spawn ();
if (PerlACE::waitforfile_timed ($nsior, 15) == -1) {
print STDERR "ERROR: cannot find naming service IOR file\n";
- $NS->Kill ();
+ $NS->Kill ();
exit 1;
}
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/run_test.pl
index 6da1a3b9156..bbc47d41b8a 100755
--- a/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/run_test.pl
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/run_test.pl
@@ -19,26 +19,7 @@ $test1 = PerlACE::LocalFile ("test1");
$test2 = PerlACE::LocalFile ("test2");
# generate test stream data
-$input = "test_input";
-while ( -e $input ) {
- $input = $input."X";
-}
-open( INPUT, "> $input" ) || die( "can't create input file: $input" );
-for($i =0; $i < 1000 ; $i++ ) {
- print INPUT <<EOFINPUT;
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-EOFINPUT
-}
-close(INPUT);
+$input = PerlACE::generate_test_file("test_input", 102400);
unlink $nsior, $test1, $test2;
@@ -53,7 +34,7 @@ $NS->Spawn ();
if (PerlACE::waitforfile_timed ($nsior, 5) == -1) {
print STDERR "ERROR: cannot find naming service IOR file\n";
- $NS->Kill ();
+ $NS->Kill ();
exit 1;
}
diff --git a/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/run_test.pl
index 16bf0c48a16..c04de62dfd6 100755
--- a/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/run_test.pl
+++ b/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/run_test.pl
@@ -18,26 +18,7 @@ $nsior = PerlACE::LocalFile ("ns.ior");
$outfile = PerlACE::LocalFile ("output");
# generate test stream data
-$input = "test_input";
-while ( -e $input ) {
- $input = $input."X";
-}
-open( INPUT, "> $input" ) || die( "can't create input file: $input" );
-for($i =0; $i < 1000 ; $i++ ) {
- print INPUT <<EOFINPUT;
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-EOFINPUT
-}
-close(INPUT);
+$input = PerlACE::generate_test_file("test_input", 102400);
unlink $nsior;
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl
index 45a2d6e274c..87223c84b1a 100755
--- a/TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl
@@ -19,32 +19,13 @@ $nsior = PerlACE::LocalFile ("ns.ior");
$debug = 0;
# generate test stream data
-$input = "test_input";
-while ( -e $input ) {
- $input = $input."X";
-}
-open( INPUT, "> $input" ) || die( "can't create input file: $input" );
-for($i =0; $i < 1000 ; $i++ ) {
- print INPUT <<EOFINPUT;
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-EOFINPUT
-}
-close(INPUT);
+$input = PerlACE::generate_test_file("test_input", 102400);
unlink $nsior;
-for ($i = 0; $i <= $#ARGV; $i++)
+for ($i = 0; $i <= $#ARGV; $i++)
{
- if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?")
+ if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?")
{
print STDERR "\nusage: run_test\n";
@@ -63,12 +44,12 @@ for ($i = 0; $i <= $#ARGV; $i++)
exit;
}
- elsif ($ARGV[$i] eq "-p")
+ elsif ($ARGV[$i] eq "-p")
{
@protocols = split (',', $ARGV[$i + 1]);
$i++;
}
- elsif ($ARGV[$i] eq "-d")
+ elsif ($ARGV[$i] eq "-d")
{
$debug = $ARGV[$i + 1];
$i++;
@@ -81,10 +62,10 @@ print STDERR "Starting Naming Service\n";
$NS->Spawn ();
-if (PerlACE::waitforfile_timed ($nsior, 100) == -1)
+if (PerlACE::waitforfile_timed ($nsior, 100) == -1)
{
print STDERR "ERROR: cannot find naming service IOR file\n";
- $NS->Kill ();
+ $NS->Kill ();
exit 1;
}
@@ -103,25 +84,25 @@ for $protocol (@protocols)
$SV = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior -ORBDebugLevel ".$debug." -f ".$output_file);
$CL = new PerlACE::Process ("ftp", "-ORBInitRef NameService=file://$nsior -ORBDebugLevel ".$debug." -p ".$protocol." -f $input");
-
+
print STDERR "Using ".$protocol."\n";
print STDERR "Starting Receiver\n";
-
+
$SV->Spawn ();
-
+
sleep $sleeptime;
-
+
print STDERR "Starting Sender\n";
-
+
$sender = $CL->SpawnWaitKill (200);
-
+
if ($sender != 0) {
print STDERR "ERROR: sender returned $sender\n";
$status = 1;
}
-
+
$receiver = $SV->TerminateWaitKill (200);
-
+
if ($receiver != 0) {
print STDERR "ERROR: receiver returned $receiver\n";
$status = 1;
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/run_test.pl
index 16bf0c48a16..c04de62dfd6 100755
--- a/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/run_test.pl
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/run_test.pl
@@ -18,26 +18,7 @@ $nsior = PerlACE::LocalFile ("ns.ior");
$outfile = PerlACE::LocalFile ("output");
# generate test stream data
-$input = "test_input";
-while ( -e $input ) {
- $input = $input."X";
-}
-open( INPUT, "> $input" ) || die( "can't create input file: $input" );
-for($i =0; $i < 1000 ; $i++ ) {
- print INPUT <<EOFINPUT;
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-EOFINPUT
-}
-close(INPUT);
+$input = PerlACE::generate_test_file("test_input", 102400);
unlink $nsior;
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/run_test.pl
index 119954f397c..955ef15c05d 100755
--- a/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/run_test.pl
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/run_test.pl
@@ -18,26 +18,7 @@ $nsior = PerlACE::LocalFile ("ns.ior");
$testfile = PerlACE::LocalFile ("test");
# generate test stream data
-$input = "test_input";
-while ( -e $input ) {
- $input = $input."X";
-}
-open( INPUT, "> $input" ) || die( "can't create input file: $input" );
-for($i =0; $i < 1000 ; $i++ ) {
- print INPUT <<EOFINPUT;
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-EOFINPUT
-}
-close(INPUT);
+$input = PerlACE::generate_test_file("test_input", 102400);
unlink $nsior;
@@ -52,7 +33,7 @@ $NS->Spawn ();
if (PerlACE::waitforfile_timed ($nsior, 10) == -1) {
print STDERR "ERROR: cannot find naming service IOR file\n";
- $NS->Kill ();
+ $NS->Kill ();
exit 1;
}
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/run_test.pl
index c691d65aa8a..d8bde72c0f5 100755
--- a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/run_test.pl
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/run_test.pl
@@ -20,32 +20,13 @@ $outfile = PerlACE::LocalFile ("output");
$debug = 0;
# generate test stream data
-$input = "test_input";
-while ( -e $input ) {
- $input = $input."X";
-}
-open( INPUT, "> $input" ) || die( "can't create input file: $input" );
-for($i =0; $i < 1000 ; $i++ ) {
- print INPUT <<EOFINPUT;
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-EOFINPUT
-}
-close(INPUT);
+$input = PerlACE::generate_test_file("test_input", 102400);
unlink $nsior;
-for ($i = 0; $i <= $#ARGV; $i++)
+for ($i = 0; $i <= $#ARGV; $i++)
{
- if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?")
+ if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?")
{
print STDERR "\nusage: run_test\n";
@@ -64,12 +45,12 @@ for ($i = 0; $i <= $#ARGV; $i++)
exit;
}
- elsif ($ARGV[$i] eq "-p")
+ elsif ($ARGV[$i] eq "-p")
{
@protocols = split (',', $ARGV[$i + 1]);
$i++;
}
- elsif ($ARGV[$i] eq "-d")
+ elsif ($ARGV[$i] eq "-d")
{
$debug = $ARGV[$i + 1];
$i++;
@@ -82,10 +63,10 @@ print STDERR "Starting Naming Service\n";
$NS->Spawn ();
-if (PerlACE::waitforfile_timed ($nsior, 100) == -1)
+if (PerlACE::waitforfile_timed ($nsior, 100) == -1)
{
print STDERR "ERROR: cannot find naming service IOR file\n";
- $NS->Kill ();
+ $NS->Kill ();
exit 1;
}
@@ -103,25 +84,25 @@ for $protocol (@protocols)
$SV = new PerlACE::Process ("receiver", "-ORBInitRef NameService=file://$nsior -ORBDebugLevel ".$debug." -f ".$output_file);
$CL = new PerlACE::Process ("sender", "-ORBInitRef NameService=file://$nsior -ORBDebugLevel ".$debug." -p ".$protocol." -f $input");
-
+
print STDERR "Using ".$protocol."\n";
print STDERR "Starting Receiver\n";
-
+
$SV->Spawn ();
-
+
sleep $sleeptime;
-
+
print STDERR "Starting Sender\n";
-
+
$sender = $CL->SpawnWaitKill (200);
-
+
if ($sender != 0) {
print STDERR "ERROR: sender returned $sender\n";
$status = 1;
}
-
+
$receiver = $SV->TerminateWaitKill (200);
-
+
if ($receiver != 0) {
print STDERR "ERROR: receiver returned $receiver\n";
$status = 1;
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/run_test.pl
index c691d65aa8a..d8bde72c0f5 100755
--- a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/run_test.pl
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/run_test.pl
@@ -20,32 +20,13 @@ $outfile = PerlACE::LocalFile ("output");
$debug = 0;
# generate test stream data
-$input = "test_input";
-while ( -e $input ) {
- $input = $input."X";
-}
-open( INPUT, "> $input" ) || die( "can't create input file: $input" );
-for($i =0; $i < 1000 ; $i++ ) {
- print INPUT <<EOFINPUT;
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-0123456789
-EOFINPUT
-}
-close(INPUT);
+$input = PerlACE::generate_test_file("test_input", 102400);
unlink $nsior;
-for ($i = 0; $i <= $#ARGV; $i++)
+for ($i = 0; $i <= $#ARGV; $i++)
{
- if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?")
+ if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?")
{
print STDERR "\nusage: run_test\n";
@@ -64,12 +45,12 @@ for ($i = 0; $i <= $#ARGV; $i++)
exit;
}
- elsif ($ARGV[$i] eq "-p")
+ elsif ($ARGV[$i] eq "-p")
{
@protocols = split (',', $ARGV[$i + 1]);
$i++;
}
- elsif ($ARGV[$i] eq "-d")
+ elsif ($ARGV[$i] eq "-d")
{
$debug = $ARGV[$i + 1];
$i++;
@@ -82,10 +63,10 @@ print STDERR "Starting Naming Service\n";
$NS->Spawn ();
-if (PerlACE::waitforfile_timed ($nsior, 100) == -1)
+if (PerlACE::waitforfile_timed ($nsior, 100) == -1)
{
print STDERR "ERROR: cannot find naming service IOR file\n";
- $NS->Kill ();
+ $NS->Kill ();
exit 1;
}
@@ -103,25 +84,25 @@ for $protocol (@protocols)
$SV = new PerlACE::Process ("receiver", "-ORBInitRef NameService=file://$nsior -ORBDebugLevel ".$debug." -f ".$output_file);
$CL = new PerlACE::Process ("sender", "-ORBInitRef NameService=file://$nsior -ORBDebugLevel ".$debug." -p ".$protocol." -f $input");
-
+
print STDERR "Using ".$protocol."\n";
print STDERR "Starting Receiver\n";
-
+
$SV->Spawn ();
-
+
sleep $sleeptime;
-
+
print STDERR "Starting Sender\n";
-
+
$sender = $CL->SpawnWaitKill (200);
-
+
if ($sender != 0) {
print STDERR "ERROR: sender returned $sender\n";
$status = 1;
}
-
+
$receiver = $SV->TerminateWaitKill (200);
-
+
if ($receiver != 0) {
print STDERR "ERROR: receiver returned $receiver\n";
$status = 1;
diff --git a/bin/PerlACE/Run_Test.pm b/bin/PerlACE/Run_Test.pm
index 50a41484e3d..e40d0c15721 100644
--- a/bin/PerlACE/Run_Test.pm
+++ b/bin/PerlACE/Run_Test.pm
@@ -101,6 +101,31 @@ sub check_n_cleanup_files
}
}
+sub generate_test_file
+{
+ my $file = shift;
+ my $size = shift;
+
+ while ( -e $file ) {
+ $file = $file."X";
+ }
+
+ my $data = "abcdefghijklmnopqrstuvwxyz";
+ $data = $data.uc($data)."0123456789";
+
+ open( INPUT, "> $file" ) || die( "can't create input file: $file" );
+ for($i=62; $i < $size ; $i += 62 ) {
+ print INPUT $data;
+ }
+ $i -= 62;
+ if ($i < $size) {
+ print INPUT substr($data, 0, $size-$i);
+ }
+ close(INPUT);
+
+ return $file;
+}
+
$sleeptime = 5;
1;