diff options
author | pradeep <pradeep@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-01-25 05:59:00 +0000 |
---|---|---|
committer | pradeep <pradeep@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-01-25 05:59:00 +0000 |
commit | 3dea06e450781d176d77e3f967887a6536c87975 (patch) | |
tree | e200be105716d6906ae2bfa82be44ff5c3862c66 | |
parent | 05b9e9c089d779bb3c7b25d0e604adaec7957c79 (diff) | |
download | ATCD-3dea06e450781d176d77e3f967887a6536c87975.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/orbsvcs/tests/CosEC_Multiple/README | 63 | ||||
-rwxr-xr-x | TAO/orbsvcs/tests/CosEC_Multiple/run_test.pl | 49 | ||||
-rwxr-xr-x | TAO/orbsvcs/tests/CosEC_Multiple/run_test2.pl | 104 |
3 files changed, 210 insertions, 6 deletions
diff --git a/TAO/orbsvcs/tests/CosEC_Multiple/README b/TAO/orbsvcs/tests/CosEC_Multiple/README index e1a9358c9be..6b6d90cb706 100644 --- a/TAO/orbsvcs/tests/CosEC_Multiple/README +++ b/TAO/orbsvcs/tests/CosEC_Multiple/README @@ -1,9 +1,10 @@ CosEC_Multiple +------------------------------------------------------------------------ This test for the Cos Event Service has 2 executables - one for suppliers and the other for consumers. Both connect to a running Event Service. -To run the test: +To run a test manually: 1. Start one or more consumers. 2. Run a Supplier, the consumer displays the data received. @@ -15,4 +16,62 @@ The command line parameters for the Supplier are: The command line parameters for the Consumer are: -n <Name of the Event Service>,the default name is "CosEventService" - -c <event_count>, number of events to receive from the CosEC.
\ No newline at end of file + -c <event_count>, number of events to receive from the CosEC. + +------------------------------------------------------------------------ +Test Scripts: + +run_test.pl - Event filtering using the RtEC. + +This test starts up 2 CosEC's connected to one RtEC as shown.. + + --------- + | RtEC | + --------- + | + | + ________|____________ + | | + ____|____ ____|____ + | CosEC1 | | CosEC2 | + "cosec1" _________ _________ "cosec2" + | | + _____|________ _____|_______ + | | | | + consumerA supplierB consumerB supplierA + +The CosEC1 (see fig.) is setup with these parameters: +# cos event service name = "cosec1" +# for ConsumerQOS: EventID = 21, SourceID = 6 +# for SupplierQOS: EventID = 20, SourceID = 5 + +The CosEC2 (see fig.) is setup with these parameters: +# cos event service name = "cosec2" +# for ConsumerQOS: EventID = 20, SourceID = 5 +# for SupplierQOS: EventID = 21, SourceID = 6 + +This setup configures the CosEC's such that consumerA connected to CosEC1 receives events from supplierA connected to CosEC2. +similarly, consumerB and supplierB form the other pair. + +Parameters: + +-e event_count, The number of events supplied by each supplier + and also the number of events that a consumer will count + before shutting down. + +To execute this test, run the run_test.pl script. + +------------------------------------------------------------------------ +run_test2.pl: demostrates multiple consumers and suppliers connected +to one CosEC. +This test has the following params - + +-e event_count, The number of events supplied by each supplier + and also the number of events that a consumer will count + before shutting down. + +-c consumers, The number of consumers to connect the Event service. + +-s suppliers, The number of suppliers to connect the Event service. + +------------------------------------------------------------------------ diff --git a/TAO/orbsvcs/tests/CosEC_Multiple/run_test.pl b/TAO/orbsvcs/tests/CosEC_Multiple/run_test.pl index eb38cf8cc3a..63a6701aa35 100755 --- a/TAO/orbsvcs/tests/CosEC_Multiple/run_test.pl +++ b/TAO/orbsvcs/tests/CosEC_Multiple/run_test.pl @@ -8,6 +8,9 @@ use lib "../../../../bin"; require ACEutils; +#event count +$ev_count = 2; + # setup CosEC params such that.. # cos event service name = "cosec1" # for ConsumerQOS: EventID = 21, SourceID = 6 @@ -42,13 +45,13 @@ sub cosec_multiple_test1 sleep 10; - #start 1 consumer that uses CosEC1 to receive 2 events - $CONS = Process::Create ($EXEPREFIX."consumer".$Process::EXE_EXT,"-n cosec1 -c 2"); + #start 1 consumer that uses CosEC1 to receive events + $CONS = Process::Create ($EXEPREFIX."consumer".$Process::EXE_EXT,"-n cosec1 -c $ev_count"); sleep 10; - #start 1 supplier that uses CosEC2 to send 2 events - $SUPP = Process::Create ($EXEPREFIX."supplier".$Process::EXE_EXT,"-n cosec2 -c 2"); + #start 1 supplier that uses CosEC2 to send events + $SUPP = Process::Create ($EXEPREFIX."supplier".$Process::EXE_EXT,"-n cosec2 -c $ev_count"); sleep 10; @@ -59,6 +62,24 @@ sub cosec_multiple_test1 #wait for the consumer to finish $CONS->Wait (); + #---------- + #start 1 consumer that uses CosEC1 to receive events + $CONS2 = Process::Create ($EXEPREFIX."consumer".$Process::EXE_EXT,"-n cosec2 -c $ev_count"); + + sleep 10; + + #start 1 supplier that uses CosEC2 to send events + $SUPP2 = Process::Create ($EXEPREFIX."supplier".$Process::EXE_EXT,"-n cosec1 -c $ev_count"); + + sleep 10; + + #wait for the supplier to finish + $SUPP2->Wait (); + + + #wait for the consumer to finish + $CONS2->Wait (); + #---------- # cleanup.. $SV1->Kill (); $SV2->Kill (); @@ -71,4 +92,24 @@ sub cosec_multiple_test1 $SV4->Wait (); } +# Parse the arguments + +for ($i = 0; $i <= $#ARGV; $i++) +{ + SWITCH: + { + if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") + { + print "usage: run_test.pl -e event_count -h help\n"; + exit; + } + if ($ARGV[$i] eq "-e") + { + $ev_count = $ARGV[$i + 1]; + $i++; + last SWITCH; + } +} +} + cosec_multiple_test1 (); diff --git a/TAO/orbsvcs/tests/CosEC_Multiple/run_test2.pl b/TAO/orbsvcs/tests/CosEC_Multiple/run_test2.pl new file mode 100755 index 00000000000..a748182fe12 --- /dev/null +++ b/TAO/orbsvcs/tests/CosEC_Multiple/run_test2.pl @@ -0,0 +1,104 @@ +#$Id$ +# -*- perl -*- +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +use lib "../../../../bin"; + +require ACEutils; + +$con_count = 10; +$sup_count = 10; +$ev_count = 8; + +sub cosec_multiple_test2 +{ + # first start the Naming service.. + $SV1 = Process::Create ($EXEPREFIX."../../Naming_Service/Naming_Service".$Process::EXE_EXT,""); + + sleep 10; + + # now start the Rt EC.. + $SV2 = Process::Create ($EXEPREFIX."../../Event_Service/Event_Service".$Process::EXE_EXT,""); + + sleep 10; + + # now start the CosEC1.. + $SV3 = Process::Create ($EXEPREFIX."../../CosEvent_Service/CosEvent_Service".$Process::EXE_EXT); + + sleep 10; + + # now start the consumers + for ($cntr1 = 0; $cntr1 < $con_count ; $cntr1+=1) + { + print "creating consumer# $cntr1\n"; + $CONS = Process::Create ($EXEPREFIX."consumer".$Process::EXE_EXT, + "-c $ev_count"); + sleep 10; + } + + + # now start the suppliers + for ($cntr2 = 0; $cntr2 < $con_count ; $cntr2+=1) + { + print "creating supplier# $cntr2\n"; + $SUPP = Process::Create ($EXEPREFIX."supplier".$Process::EXE_EXT, + "-c $ev_count"); + sleep 10; + } + + print "waiting for the last supplier to finish\n"; + $SUPP->Wait (); + + + print "waiting for the last consumer to finish\n"; + $CONS->Wait (); + + + print "cleanup...\n"; + $SV1->Kill (); + $SV2->Kill (); + $SV3->Kill (); + + $SV1->Wait (); + $SV2->Wait (); + $SV3->Wait (); + + print "done!.\n"; +} + +# Parse the arguments + +for ($i = 0; $i <= $#ARGV; $i++) +{ + SWITCH: + { + if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") + { + print "usage: run_test2.pl -e event_count -c consumers -s suppliers -h help\n"; + exit; + } + if ($ARGV[$i] eq "-e") + { + $ev_count = $ARGV[$i + 1]; + $i++; + last SWITCH; + } + if ($ARGV[$i] eq "-c") + { + $con_count = $ARGV[$i + 1]; + $i++; + last SWITCH; + } + if ($ARGV[$i] eq "-s") + { + $sup_count = $ARGV[$i + 1]; + $i++; + last SWITCH; + } +} +} + + +cosec_multiple_test2 (); |