summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/EC_Throughput/run_test.pl
blob: abbf7f3dc6fd90b550be967d390e191192c4a935 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
    & eval 'exec perl -S $0 $argv:q'
    if 0;

# $Id$
# -*- perl -*-

use lib '../../../../bin';
use PerlACE::Run_Test;

$status = 0;

$ec_conf = PerlACE::LocalFile ("ec$PerlACE::svcconf_ext");
$ec_mt_conf = PerlACE::LocalFile ("ec$PerlACE::svcconf_ext");

print STDERR "================ Collocated tests, single threaded\n";

$T = new PerlACE::Process ("ECT_Throughput",
                           "-ORBSvcConf $ec_conf"
                           . " -m new -u 10000 -n 1 -t 0 -c 4");


$test = $T->SpawnWaitKill (120);

if ($test != 0) {
    print STDERR "ERROR: test returned $test\n";
    $status = 1;
}

print STDERR "================ Collocated tests, multi threaded\n";

$T = new PerlACE::Process ("ECT_Throughput",
                           "-ORBSvcConf $ec_mt_conf" 
                           . " -m new -u 10000 -n 1 -t 0 -c 4");

$test = $T->SpawnWaitKill (60);

if ($test != 0) {
    print STDERR "ERROR: test returned $test\n";
    $status = 1;
}

print STDERR "================ Remote test\n";

$ns_ior = PerlACE::LocalFile ("NameService.ior");

unlink $ns_ior;

$NS = new PerlACE::Process ("../../Naming_Service/Naming_Service",
                           "-o $ns_ior");
                           
$ES = new PerlACE::Process ("../../Event_Service/Event_Service",
                            "-ORBInitRef NameService=file://$ns_ior "
                            . " -ORBSvcConf $ec_conf "
                            . " -t NEW -s local");
                            
$C = new PerlACE::Process ("ECT_Consumer",
                           "-ORBInitRef NameService=file://$ns_ior "
                           . " -c 4 -s 1");

$S = new PerlACE::Process ("ECT_Supplier",
                           "-ORBInitRef NameService=file://$ns_ior "
                           . " -s 1 -u 5000 -n 1 -t 0");

$NS->Spawn ();

if (PerlACE::waitforfile_timed ($ns_ior, 10) == -1) {
    print STDERR "ERROR: cannot find file <$ns_ior>\n";
    $NS->Kill (); 
    exit 1;
}

$ES->Spawn ();

sleep 10;

$C->Spawn ();
$S->Spawn ();

$supplier = $S->WaitKill (300);

if ($supplier != 0) {
    print STDERR "ERROR: supplier returned $supplier\n";
    $status = 1;
}

$consumer = $C->WaitKill (60);

if ($consumer != 0) {
    print STDERR "ERROR: consumer returned $consumer\n";
    $status = 1;
}

$eserver = $ES->WaitKill (5);

if ($eserver != 0) {
    print STDERR "ERROR: event server returned $eserver\n";
    $status = 1;
}

$nserver = $NS->TerminateWaitKill (5);

if ($nserver != 0) {
    print STDERR "ERROR: name server returned $nserver\n";
    $status = 1;
}

unlink $ns_ior;

exit $status;