Warning, /EventFilter/Utilities/scripts/exceptionGeneratorTest is written in an unsupported language. File is not indexed.
0001 #!/usr/bin/env perl
0002
0003 ################################################################################
0004 #
0005 # exceptionGeneratorTest
0006 # ----------
0007 #
0008 # Run Exception generator tests on FU EventFilter Processor
0009 #
0010 # 05/16/2012 Srecko Morovic
0011 ################################################################################
0012
0013 my $usage =
0014 "USAGE:\nexceptionGeneratorTest - run tests on ExceptionGenerator in slave EP's \n\n" .
0015 "\t-help (print this )\n" .
0016 "\t-host (host to run on [default: local host ])\n" .
0017 "\t-port (port to connect to [default: 40002 ])\n" .
0018 "\t-mask (mask of slave slots to test [default: 0xffffffff ])\n" .
0019 "\t-lid (EP local id [default: 50 ])\n" .
0020 "\t-action (Exception action id [default: 8 (segv) ])\n" .
0021 "\t-qualifier (parameter to action id [default: 0 ])\n" .
0022 "\n";
0023 die $usage if($ARGV[0] eq "-help");
0024 die $usage if($ARGV[0] eq "");
0025
0026 print "\n============================================================";
0027 print "\nexceptionGeneratorTest...";
0028 print "\n============================================================\n";
0029
0030 # set variables
0031 my $hostname = `hostname -f`;
0032 chop($hostname);
0033 my $EPport = 40002;
0034 my $EPappname = "evf::FUEventProcessor";
0035 my $EPid=50;
0036
0037 my $mask=0xffffffff;
0038 my $testtype=8;
0039 my $testqual=0;
0040
0041 foreach $param (@ARGV) {
0042 if ($param eq "-host") { $hostname="fillme";}
0043 elsif ($hostname eq "fillme") { $hostname=$param; }
0044 elsif ($param eq "-port") { $EPport="fillme";}
0045 elsif ($EPport eq "fillme") { $EPport=$param; }
0046 elsif ($param eq "-mask") { $mask="fillme";}
0047 elsif ($mask eq "fillme") { $mask=hex($param); }
0048 elsif ($param eq "-lid") { $EPid="fillme";}
0049 elsif ($EPid eq "fillme") { $EPid=$param; }
0050 elsif ($param eq "-action") { $testtype="fillme";}
0051 elsif ($testtype eq "fillme") { $testtype=$param; }
0052 elsif ($param eq "-qualifier") { $testqual="fillme";}
0053 elsif ($testqual eq "fillme") { $testqual=$param; }
0054 }
0055
0056 my $EPs = "http://$hostname:$EPport/urn:xdaq-application:lid=$EPid/getSlavePids";
0057 my $pids = `curl -s $EPs`;
0058 print "\ngot slave EP pids: $pids ...\n\n";
0059 @tokens = split(/,/,$pids);
0060
0061 my $EPx = "http://$hostname:$EPport/urn:xdaq-application:lid=$EPid/SubWeb?process=";
0062 my $count = 0;
0063
0064 foreach my $token (@tokens) {
0065 if ((1<<$count) & $mask) {
0066 my $cmd = $EPx.$token."&method=moduleWeb&module=ExceptionGenerator&exceptionType=$testtype"."&qualifier=$testqual";
0067 print "calling exception for http://".$hostname.":".$EPport."/urn:xdaq-application:lid=$EPid test $testtype qualifier:$testqual \n";
0068 `curl -s "$cmd"`;
0069 }
0070 $count = $count+1;
0071 }
0072