Merge pull request #2301 from sonndinh/remove-dup-reactor-functions
[ACE_TAO.git] / TAO / orbsvcs / tests / EC_Mcast / run_test.pl
blobe08a69de63861b89dd6a70d4f264e4496bba1fa3
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 $event_count = '100';
14 $event_period = '50000';
15 $federation = 'Set02';
17 foreach $i (@ARGV) {
18 if ($i eq '-debug') {
19 $debug_level = '10';
23 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
24 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
26 my $config_base = "sample.cfg";
27 my $server_config = $server->LocalFile ($config_base);
28 my $client_config = $client->LocalFile ($config_base);
30 my $server_svc = $server->LocalFile ("svc" . "$PerlACE::svcconf_ext");
31 my $client_svc = $client->LocalFile ("svc" . "$PerlACE::svcconf_ext");
33 $SV = $server->CreateProcess ("EC_Mcast",
34 "-ORBdebuglevel $debug_level " .
35 "-ORBSvcConf $server_svc " .
36 "-c $server_config " .
37 "-n $event_count " .
38 "-t $event_period " .
39 "-f $federation");
41 $CL = $client->CreateProcess ("EC_Mcast",
42 "-ORBdebuglevel $debug_level " .
43 "-ORBSvcConf $client_svc " .
44 "-c $client_config " .
45 "-n $event_count " .
46 "-t $event_period " .
47 "-f $federation");
49 $server_status = $SV->Spawn ();
51 if ($server_status != 0) {
52 print STDERR "ERROR: server returned $server_status\n";
53 exit 1;
56 $client_status = $CL->Spawn ();
58 if ($client_status != 0) {
59 print STDERR "ERROR: client returned $client_status\n";
60 exit 1;
63 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval() + 45);
64 $client_status = $CL->WaitKill ($client->ProcessStopWaitInterval() + 45);
66 if ($server_status != 0) {
67 print STDERR "ERROR: server returned $server_status\n";
68 $status = 1;
71 if ($client_status != 0) {
72 print STDERR "ERROR: client returned $client_status\n";
73 exit 1;
76 exit $status;