plugins/templates/check_template-WebTransact-with-client-certificate.pl

filter: Statementstmt 96.4% 27 / 28 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 94.4% 34 / 36 CC 2 SCAR 3.6
CC
2
Cov
93%
BEGIN
2.5
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« plugins/templates/check_template-WebTransact-with-client-authorization.pl ↑ Summary plugins/templates/check_template-IO.pl »
1 #!/usr/bin/env perl
2 # ----------------------------------------------------------------------------------------------------------
3 # © Copyright 2003-2011 by Alex Peeters [alex.peeters@citap.be]
4 # ----------------------------------------------------------------------------------------------------------
5 # 2011/mm/dd, v3.002.003, check_template-WebTransact-with-client-certificate.pl
6 # ----------------------------------------------------------------------------------------------------------
7  
8 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 ▶use warnings; # Must be used in test mode only. This reduces a little process speed
Subroutine BEGIN: called CC=1 SCAR=0.0
10 #use diagnostics; # Must be used in test mode only. This reduces a lot of process speed
11  
12 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
13  
14 0 ▶BEGIN { if ( $ENV{ASNMTAP_PERL5LIB} ) { eval 'use lib ( "$ENV{ASNMTAP_PERL5LIB}" )'; } }
Subroutine BEGIN: called CC=2 SCAR=9.2
Branch: 1 branch
BranchTrueFalseTotal
if ($ENV{"ASNMTAP_PERL5LIB"}) 0 3 3
15  
16 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
17  
18 3 ▶use ASNMTAP::Asnmtap::Plugins v3.002.003;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 3 ▶use ASNMTAP::Asnmtap::Plugins qw(:PLUGINS);
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
22  
23 3 my $objectPlugins = ASNMTAP::Asnmtap::Plugins->new (
24 _programName => 'check_template-WebTransact-with-client-certificate.pl',
25 _programDescription => "WebTransact plugin template for testing the '$APPLICATION' with client certificate",
26 _programVersion => '3.002.003',
27 _programGetOptions => ['environment|e:s', 'proxy:s', 'timeout|t:i', 'trendline|T:i'],
28 _clientCertificate => { certFile => 'ssl/crt/alex-peeters.crt', keyFile => 'ssl/key/alex-peeters-nopass.key'},
29 _timeout => 30,
30 _debug => 0);
31  
32 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
33  
34 3 ▶use ASNMTAP::Asnmtap::Plugins::WebTransact;
Subroutine BEGIN: called CC=1 SCAR=0.0
35  
36 1 my @URLS = ();
37 1 my $objectWebTransact = ASNMTAP::Asnmtap::Plugins::WebTransact->new ( \$objectPlugins, \@URLS );
38  
39 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
40 # Start plugin - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
41 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
42  
43 1 $objectPlugins->pluginValue ( message => 'www.citap.be/www.citap.com' );
44  
45 1 @URLS = (
46 { Method => 'GET', Url => "https://secure.citap.be/certificate", Qs_var => [], Qs_fixed => [], Exp => "Testing Client Certificate", Exp_Fault => ">>>NIHIL<<<", Msg => "Testing Client Certificate", Msg_Fault => "Testing Client Certificate" },
47 );
48  
49 1 my $returnCode = $objectWebTransact->check ( { } );
50  
51 # methode 2: my
52 1 my $urlCom = "https://secure.citap.com/certificate";
53  
54 1 @URLS = (
55 { Method => 'GET', Url => $urlCom, Qs_var => [], Qs_fixed => [], Exp => "Testing Client Certificate", Exp_Fault => ">>>NIHIL<<<", Msg => "Testing Client Certificate", Msg_Fault => "Testing Client Certificate" },
56 );
57  
58 1 $returnCode = $objectWebTransact->check ( { } );
59  
60 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
61 # End plugin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
62 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
63  
64 1 undef $objectWebTransact;
65 1 $objectPlugins->exit (7);
66  
67 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
68  
69 __END__
« plugins/templates/check_template-WebTransact-with-client-authorization.pl ↑ Summary plugins/templates/check_template-IO.pl »