diff options
-rw-r--r-- | coverage.xml | 1454 | ||||
-rw-r--r-- | snmptrap/mod/trapd_stormwatch.py | 27 | ||||
-rw-r--r-- | tests/test_trapd_stormwatch.py | 114 |
3 files changed, 1091 insertions, 504 deletions
diff --git a/coverage.xml b/coverage.xml index 96da2c6..1ef294e 100644 --- a/coverage.xml +++ b/coverage.xml @@ -1,347 +1,388 @@ <?xml version="1.0" ?> -<coverage branch-rate="0" branches-covered="0" branches-valid="0" complexity="0" line-rate="0.07154" lines-covered="45" lines-valid="629" timestamp="1522110803348" version="4.5.1"> +<coverage branch-rate="0" branches-covered="0" branches-valid="0" complexity="0" line-rate="0.6032" lines-covered="646" lines-valid="1071" timestamp="1584496786177" version="5.0.4"> <!-- Generated by coverage.py: https://coverage.readthedocs.io --> <!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd --> <sources> - <source>C:\Users\vv770d\git\onap\snmptrap\snmptrap</source> + <source>/home/th1395x/onap/dcaegen2/snmptrap/snmptrap</source> </sources> <packages> - <package branch-rate="0" complexity="0" line-rate="0" name="."> + <package branch-rate="0" complexity="0" line-rate="0.2397" name="."> <classes> <class branch-rate="0" complexity="0" filename="__init__.py" line-rate="1" name="__init__.py"> <methods/> <lines/> </class> - <class branch-rate="0" complexity="0" filename="snmptrapd.py" line-rate="0" name="snmptrapd.py"> + <class branch-rate="0" complexity="0" filename="snmptrapd.py" line-rate="0.2397" name="snmptrapd.py"> <methods/> <lines> - <line hits="0" number="21"/> - <line hits="0" number="36"/> - <line hits="0" number="39"/> - <line hits="0" number="40"/> - <line hits="0" number="41"/> - <line hits="0" number="42"/> - <line hits="0" number="43"/> - <line hits="0" number="44"/> - <line hits="0" number="45"/> - <line hits="0" number="46"/> - <line hits="0" number="47"/> - <line hits="0" number="48"/> - <line hits="0" number="49"/> - <line hits="0" number="50"/> - <line hits="0" number="51"/> - <line hits="0" number="52"/> - <line hits="0" number="53"/> - <line hits="0" number="54"/> - <line hits="0" number="55"/> - <line hits="0" number="56"/> - <line hits="0" number="57"/> - <line hits="0" number="58"/> - <line hits="0" number="59"/> - <line hits="0" number="60"/> - <line hits="0" number="63"/> - <line hits="0" number="64"/> - <line hits="0" number="66"/> - <line hits="0" number="67"/> - <line hits="0" number="70"/> - <line hits="0" number="71"/> - <line hits="0" number="72"/> - <line hits="0" number="73"/> - <line hits="0" number="74"/> - <line hits="0" number="76"/> - <line hits="0" number="77"/> - <line hits="0" number="79"/> - <line hits="0" number="80"/> - <line hits="0" number="87"/> - <line hits="0" number="98"/> - <line hits="0" number="99"/> - <line hits="0" number="100"/> - <line hits="0" number="108"/> - <line hits="0" number="125"/> - <line hits="0" number="126"/> - <line hits="0" number="128"/> - <line hits="0" number="133"/> - <line hits="0" number="134"/> - <line hits="0" number="136"/> + <line hits="1" number="16"/> + <line hits="1" number="31"/> + <line hits="1" number="34"/> + <line hits="1" number="35"/> + <line hits="1" number="36"/> + <line hits="1" number="37"/> + <line hits="1" number="38"/> + <line hits="1" number="39"/> + <line hits="1" number="40"/> + <line hits="1" number="41"/> + <line hits="1" number="42"/> + <line hits="1" number="43"/> + <line hits="1" number="44"/> + <line hits="1" number="45"/> + <line hits="1" number="46"/> + <line hits="1" number="47"/> + <line hits="1" number="48"/> + <line hits="1" number="49"/> + <line hits="1" number="50"/> + <line hits="1" number="51"/> + <line hits="1" number="52"/> + <line hits="1" number="53"/> + <line hits="1" number="54"/> + <line hits="1" number="55"/> + <line hits="1" number="58"/> + <line hits="1" number="59"/> + <line hits="1" number="61"/> + <line hits="1" number="62"/> + <line hits="1" number="63"/> + <line hits="1" number="66"/> + <line hits="1" number="68"/> + <line hits="1" number="69"/> + <line hits="1" number="70"/> + <line hits="1" number="71"/> + <line hits="1" number="73"/> + <line hits="1" number="74"/> + <line hits="1" number="75"/> + <line hits="1" number="78"/> + <line hits="1" number="79"/> + <line hits="1" number="81"/> + <line hits="1" number="83"/> + <line hits="1" number="84"/> + <line hits="1" number="91"/> + <line hits="1" number="102"/> + <line hits="1" number="103"/> + <line hits="1" number="104"/> + <line hits="1" number="112"/> + <line hits="1" number="129"/> + <line hits="1" number="130"/> + <line hits="1" number="132"/> + <line hits="1" number="136"/> <line hits="0" number="137"/> <line hits="0" number="138"/> <line hits="0" number="139"/> - <line hits="0" number="140"/> - <line hits="0" number="141"/> - <line hits="0" number="145"/> - <line hits="0" number="146"/> - <line hits="0" number="147"/> - <line hits="0" number="148"/> - <line hits="0" number="156"/> - <line hits="0" number="159"/> - <line hits="0" number="160"/> - <line hits="0" number="161"/> - <line hits="0" number="162"/> - <line hits="0" number="163"/> - <line hits="0" number="164"/> - <line hits="0" number="165"/> - <line hits="0" number="166"/> - <line hits="0" number="167"/> - <line hits="0" number="168"/> - <line hits="0" number="171"/> - <line hits="0" number="172"/> - <line hits="0" number="173"/> - <line hits="0" number="174"/> - <line hits="0" number="177"/> + <line hits="1" number="141"/> + <line hits="1" number="144"/> + <line hits="1" number="145"/> + <line hits="1" number="148"/> + <line hits="1" number="150"/> + <line hits="1" number="153"/> + <line hits="1" number="154"/> + <line hits="1" number="157"/> + <line hits="1" number="160"/> + <line hits="1" number="161"/> + <line hits="1" number="163"/> + <line hits="1" number="166"/> + <line hits="1" number="167"/> + <line hits="1" number="168"/> + <line hits="1" number="171"/> + <line hits="1" number="177"/> + <line hits="0" number="179"/> + <line hits="0" number="180"/> <line hits="0" number="181"/> + <line hits="0" number="185"/> + <line hits="0" number="187"/> + <line hits="0" number="188"/> + <line hits="0" number="190"/> + <line hits="0" number="192"/> + <line hits="0" number="193"/> + <line hits="0" number="195"/> + <line hits="0" number="196"/> <line hits="0" number="198"/> <line hits="0" number="199"/> <line hits="0" number="201"/> - <line hits="0" number="209"/> - <line hits="0" number="214"/> - <line hits="0" number="215"/> - <line hits="0" number="217"/> + <line hits="0" number="204"/> + <line hits="0" number="207"/> + <line hits="1" number="214"/> + <line hits="1" number="217"/> <line hits="0" number="218"/> <line hits="0" number="219"/> + <line hits="0" number="220"/> <line hits="0" number="221"/> + <line hits="1" number="222"/> <line hits="0" number="223"/> <line hits="0" number="224"/> + <line hits="0" number="225"/> <line hits="0" number="226"/> - <line hits="0" number="234"/> - <line hits="0" number="245"/> - <line hits="0" number="247"/> - <line hits="0" number="248"/> - <line hits="0" number="249"/> - <line hits="0" number="251"/> - <line hits="0" number="254"/> - <line hits="0" number="255"/> - <line hits="0" number="258"/> - <line hits="0" number="260"/> - <line hits="0" number="261"/> - <line hits="0" number="263"/> - <line hits="0" number="264"/> - <line hits="0" number="266"/> - <line hits="0" number="267"/> - <line hits="0" number="268"/> - <line hits="0" number="269"/> + <line hits="1" number="229"/> + <line hits="1" number="230"/> + <line hits="0" number="231"/> + <line hits="0" number="232"/> + <line hits="1" number="235"/> + <line hits="1" number="236"/> + <line hits="1" number="237"/> + <line hits="1" number="238"/> + <line hits="1" number="255"/> + <line hits="1" number="256"/> + <line hits="1" number="258"/> + <line hits="1" number="266"/> <line hits="0" number="271"/> - <line hits="0" number="273"/> - <line hits="0" number="277"/> - <line hits="0" number="279"/> + <line hits="0" number="272"/> + <line hits="0" number="274"/> + <line hits="0" number="275"/> + <line hits="0" number="276"/> + <line hits="0" number="278"/> + <line hits="0" number="280"/> <line hits="0" number="281"/> - <line hits="0" number="287"/> - <line hits="0" number="289"/> - <line hits="0" number="291"/> - <line hits="0" number="293"/> - <line hits="0" number="294"/> - <line hits="0" number="295"/> - <line hits="0" number="296"/> - <line hits="0" number="298"/> - <line hits="0" number="300"/> - <line hits="0" number="303"/> + <line hits="0" number="283"/> + <line hits="1" number="291"/> + <line hits="0" number="302"/> <line hits="0" number="304"/> + <line hits="0" number="305"/> <line hits="0" number="306"/> - <line hits="0" number="309"/> - <line hits="0" number="310"/> + <line hits="0" number="308"/> + <line hits="0" number="311"/> <line hits="0" number="312"/> <line hits="0" number="315"/> <line hits="0" number="317"/> <line hits="0" number="318"/> <line hits="0" number="320"/> - <line hits="0" number="322"/> + <line hits="0" number="321"/> + <line hits="0" number="323"/> <line hits="0" number="324"/> + <line hits="0" number="325"/> <line hits="0" number="326"/> - <line hits="0" number="327"/> - <line hits="0" number="329"/> - <line hits="0" number="332"/> - <line hits="0" number="333"/> + <line hits="0" number="328"/> + <line hits="0" number="330"/> <line hits="0" number="334"/> - <line hits="0" number="335"/> - <line hits="0" number="342"/> + <line hits="0" number="336"/> + <line hits="0" number="338"/> + <line hits="0" number="344"/> <line hits="0" number="345"/> + <line hits="0" number="347"/> <line hits="0" number="349"/> - <line hits="0" number="357"/> + <line hits="0" number="350"/> + <line hits="0" number="351"/> + <line hits="0" number="352"/> + <line hits="0" number="354"/> + <line hits="0" number="356"/> + <line hits="0" number="359"/> + <line hits="0" number="360"/> + <line hits="0" number="362"/> + <line hits="0" number="365"/> + <line hits="0" number="366"/> + <line hits="0" number="368"/> + <line hits="0" number="371"/> + <line hits="0" number="373"/> + <line hits="0" number="374"/> + <line hits="0" number="376"/> <line hits="0" number="378"/> - <line hits="0" number="381"/> - <line hits="0" number="384"/> + <line hits="0" number="380"/> + <line hits="0" number="382"/> + <line hits="0" number="383"/> <line hits="0" number="385"/> - <line hits="0" number="387"/> + <line hits="0" number="388"/> <line hits="0" number="389"/> + <line hits="0" number="390"/> <line hits="0" number="391"/> - <line hits="0" number="392"/> - <line hits="0" number="393"/> - <line hits="0" number="396"/> - <line hits="0" number="397"/> - <line hits="0" number="398"/> - <line hits="0" number="399"/> + <line hits="1" number="398"/> <line hits="0" number="401"/> <line hits="0" number="402"/> - <line hits="0" number="403"/> - <line hits="0" number="404"/> - <line hits="0" number="406"/> - <line hits="0" number="408"/> - <line hits="0" number="409"/> - <line hits="0" number="411"/> - <line hits="0" number="413"/> - <line hits="0" number="416"/> - <line hits="0" number="418"/> - <line hits="0" number="419"/> - <line hits="0" number="423"/> - <line hits="0" number="424"/> - <line hits="0" number="425"/> - <line hits="0" number="426"/> - <line hits="0" number="428"/> - <line hits="0" number="429"/> - <line hits="0" number="430"/> - <line hits="0" number="431"/> - <line hits="0" number="434"/> - <line hits="0" number="435"/> - <line hits="0" number="436"/> - <line hits="0" number="438"/> - <line hits="0" number="439"/> - <line hits="0" number="441"/> - <line hits="0" number="442"/> - <line hits="0" number="444"/> - <line hits="0" number="446"/> - <line hits="0" number="447"/> - <line hits="0" number="448"/> + <line hits="1" number="410"/> <line hits="0" number="449"/> - <line hits="0" number="451"/> - <line hits="0" number="452"/> + <line hits="0" number="453"/> <line hits="0" number="454"/> <line hits="0" number="455"/> + <line hits="0" number="456"/> + <line hits="0" number="458"/> + <line hits="0" number="459"/> + <line hits="0" number="460"/> + <line hits="0" number="461"/> <line hits="0" number="462"/> - <line hits="0" number="480"/> + <line hits="0" number="466"/> + <line hits="0" number="469"/> + <line hits="0" number="472"/> + <line hits="0" number="473"/> + <line hits="0" number="478"/> + <line hits="0" number="479"/> <line hits="0" number="482"/> - <line hits="0" number="485"/> - <line hits="0" number="486"/> + <line hits="0" number="484"/> <line hits="0" number="487"/> <line hits="0" number="489"/> <line hits="0" number="490"/> - <line hits="0" number="491"/> + <line hits="0" number="492"/> <line hits="0" number="493"/> <line hits="0" number="494"/> - <line hits="0" number="495"/> - <line hits="0" number="496"/> - <line hits="0" number="500"/> - <line hits="0" number="502"/> - <line hits="0" number="503"/> - <line hits="0" number="504"/> <line hits="0" number="505"/> - <line hits="0" number="507"/> - <line hits="0" number="511"/> - <line hits="0" number="512"/> + <line hits="0" number="506"/> + <line hits="0" number="508"/> + <line hits="0" number="509"/> <line hits="0" number="517"/> - <line hits="0" number="538"/> - <line hits="0" number="539"/> - <line hits="0" number="542"/> - <line hits="0" number="554"/> - <line hits="0" number="555"/> - <line hits="0" number="556"/> - <line hits="0" number="559"/> - <line hits="0" number="560"/> - <line hits="0" number="561"/> - <line hits="0" number="565"/> - <line hits="0" number="569"/> - <line hits="0" number="573"/> - <line hits="0" number="576"/> - <line hits="0" number="581"/> - <line hits="0" number="586"/> + <line hits="0" number="520"/> + <line hits="0" number="521"/> + <line hits="0" number="524"/> + <line hits="1" number="530"/> + <line hits="0" number="550"/> + <line hits="0" number="551"/> + <line hits="0" number="553"/> + <line hits="1" number="565"/> + <line hits="0" number="583"/> + <line hits="0" number="584"/> <line hits="0" number="588"/> <line hits="0" number="589"/> + <line hits="0" number="591"/> <line hits="0" number="592"/> <line hits="0" number="593"/> - <line hits="0" number="595"/> <line hits="0" number="596"/> <line hits="0" number="597"/> <line hits="0" number="598"/> - <line hits="0" number="599"/> <line hits="0" number="600"/> - <line hits="0" number="602"/> + <line hits="0" number="603"/> <line hits="0" number="604"/> - <line hits="0" number="607"/> - <line hits="0" number="610"/> - <line hits="0" number="611"/> + <line hits="0" number="605"/> + <line hits="0" number="606"/> + <line hits="0" number="612"/> <line hits="0" number="613"/> - <line hits="0" number="615"/> + <line hits="0" number="614"/> <line hits="0" number="616"/> <line hits="0" number="617"/> <line hits="0" number="618"/> <line hits="0" number="620"/> + <line hits="0" number="622"/> + <line hits="0" number="623"/> + <line hits="0" number="624"/> + <line hits="0" number="625"/> <line hits="0" number="627"/> <line hits="0" number="629"/> - <line hits="0" number="631"/> - <line hits="0" number="635"/> - <line hits="0" number="638"/> - <line hits="0" number="639"/> - <line hits="0" number="642"/> - <line hits="0" number="643"/> - <line hits="0" number="646"/> - <line hits="0" number="649"/> - <line hits="0" number="652"/> - <line hits="0" number="653"/> + <line hits="0" number="630"/> + <line hits="1" number="635"/> <line hits="0" number="655"/> - <line hits="0" number="665"/> + <line hits="0" number="656"/> <line hits="0" number="668"/> <line hits="0" number="669"/> <line hits="0" number="670"/> <line hits="0" number="671"/> - <line hits="0" number="674"/> - <line hits="0" number="677"/> + <line hits="0" number="672"/> + <line hits="0" number="675"/> + <line hits="0" number="676"/> <line hits="0" number="678"/> - <line hits="0" number="679"/> <line hits="0" number="680"/> + <line hits="0" number="681"/> <line hits="0" number="683"/> - <line hits="0" number="685"/> - <line hits="0" number="686"/> <line hits="0" number="687"/> - <line hits="0" number="688"/> - <line hits="0" number="691"/> - <line hits="0" number="694"/> - <line hits="0" number="696"/> - <line hits="0" number="697"/> + <line hits="0" number="689"/> + <line hits="0" number="692"/> + <line hits="0" number="695"/> <line hits="0" number="698"/> + <line hits="0" number="700"/> <line hits="0" number="701"/> - <line hits="0" number="705"/> - <line hits="0" number="713"/> + <line hits="0" number="704"/> + <line hits="0" number="707"/> + <line hits="0" number="708"/> + <line hits="0" number="711"/> + <line hits="0" number="712"/> <line hits="0" number="714"/> - <line hits="0" number="715"/> <line hits="0" number="717"/> <line hits="0" number="718"/> - <line hits="0" number="724"/> + <line hits="0" number="720"/> + <line hits="0" number="721"/> + <line hits="0" number="722"/> + <line hits="0" number="723"/> <line hits="0" number="725"/> <line hits="0" number="727"/> - <line hits="0" number="728"/> <line hits="0" number="729"/> - <line hits="0" number="731"/> + <line hits="0" number="730"/> <line hits="0" number="732"/> - <line hits="0" number="733"/> <line hits="0" number="734"/> - <line hits="0" number="747"/> - <line hits="0" number="748"/> - <line hits="0" number="749"/> - <line hits="0" number="751"/> - <line hits="0" number="752"/> + <line hits="0" number="735"/> + <line hits="0" number="736"/> + <line hits="0" number="737"/> + <line hits="0" number="739"/> + <line hits="0" number="741"/> + <line hits="0" number="743"/> + <line hits="1" number="752"/> + <line hits="0" number="754"/> + <line hits="0" number="756"/> <line hits="0" number="758"/> - <line hits="0" number="759"/> - <line hits="0" number="761"/> <line hits="0" number="762"/> - <line hits="0" number="763"/> <line hits="0" number="765"/> <line hits="0" number="766"/> - <line hits="0" number="767"/> - <line hits="0" number="768"/> - <line hits="0" number="778"/> - <line hits="0" number="781"/> - <line hits="0" number="787"/> + <line hits="0" number="769"/> + <line hits="0" number="770"/> + <line hits="0" number="773"/> + <line hits="0" number="774"/> + <line hits="0" number="775"/> + <line hits="0" number="779"/> + <line hits="0" number="782"/> + <line hits="0" number="785"/> + <line hits="0" number="786"/> + <line hits="0" number="788"/> + <line hits="0" number="791"/> <line hits="0" number="794"/> + <line hits="0" number="795"/> <line hits="0" number="796"/> - <line hits="0" number="799"/> + <line hits="0" number="797"/> <line hits="0" number="800"/> - <line hits="0" number="801"/> - <line hits="0" number="802"/> <line hits="0" number="803"/> - <line hits="0" number="804"/> + <line hits="0" number="806"/> + <line hits="0" number="807"/> + <line hits="0" number="808"/> + <line hits="0" number="809"/> + <line hits="0" number="812"/> + <line hits="0" number="814"/> + <line hits="0" number="815"/> + <line hits="0" number="816"/> + <line hits="0" number="817"/> + <line hits="0" number="820"/> + <line hits="0" number="823"/> + <line hits="0" number="825"/> + <line hits="0" number="826"/> + <line hits="0" number="827"/> + <line hits="0" number="830"/> + <line hits="0" number="834"/> + <line hits="0" number="841"/> + <line hits="0" number="842"/> + <line hits="0" number="843"/> + <line hits="0" number="845"/> + <line hits="0" number="852"/> + <line hits="0" number="858"/> + <line hits="0" number="859"/> + <line hits="0" number="861"/> + <line hits="0" number="863"/> + <line hits="0" number="864"/> + <line hits="0" number="866"/> + <line hits="0" number="867"/> + <line hits="0" number="868"/> + <line hits="0" number="869"/> + <line hits="0" number="872"/> + <line hits="0" number="873"/> + <line hits="0" number="874"/> + <line hits="0" number="876"/> + <line hits="0" number="877"/> + <line hits="0" number="883"/> + <line hits="0" number="884"/> + <line hits="0" number="886"/> + <line hits="0" number="887"/> + <line hits="0" number="889"/> + <line hits="0" number="891"/> + <line hits="0" number="892"/> + <line hits="0" number="893"/> + <line hits="0" number="894"/> + <line hits="0" number="903"/> + <line hits="0" number="906"/> + <line hits="0" number="914"/> + <line hits="0" number="918"/> + <line hits="0" number="925"/> + <line hits="0" number="927"/> + <line hits="0" number="930"/> + <line hits="0" number="931"/> + <line hits="0" number="932"/> + <line hits="0" number="933"/> + <line hits="0" number="934"/> + <line hits="0" number="935"/> </lines> </class> </classes> </package> - <package branch-rate="0" complexity="0" line-rate="0.1466" name="mod"> + <package branch-rate="0" complexity="0" line-rate="0.7895" name="mod"> <classes> <class branch-rate="0" complexity="0" filename="mod/__init__.py" line-rate="1" name="__init__.py"> <methods/> @@ -350,343 +391,764 @@ <class branch-rate="0" complexity="0" filename="mod/trapd_exit.py" line-rate="1" name="trapd_exit.py"> <methods/> <lines> + <line hits="1" number="16"/> <line hits="1" number="21"/> + <line hits="1" number="23"/> + <line hits="1" number="24"/> + <line hits="1" number="25"/> + <line hits="1" number="26"/> + <line hits="1" number="28"/> + <line hits="1" number="36"/> + <line hits="1" number="56"/> + <line hits="1" number="57"/> + <line hits="1" number="58"/> + </lines> + </class> + <class branch-rate="0" complexity="0" filename="mod/trapd_get_cbs_config.py" line-rate="0.7937" name="trapd_get_cbs_config.py"> + <methods/> + <lines> + <line hits="1" number="16"/> + <line hits="1" number="22"/> + <line hits="1" number="24"/> + <line hits="1" number="25"/> <line hits="1" number="26"/> + <line hits="1" number="27"/> <line hits="1" number="28"/> <line hits="1" number="29"/> <line hits="1" number="30"/> - <line hits="1" number="31"/> + <line hits="1" number="32"/> <line hits="1" number="33"/> - <line hits="1" number="41"/> - <line hits="1" number="59"/> - <line hits="1" number="61"/> - <line hits="1" number="62"/> + <line hits="1" number="34"/> + <line hits="1" number="35"/> + <line hits="1" number="37"/> + <line hits="1" number="45"/> + <line hits="1" number="53"/> + <line hits="1" number="56"/> + <line hits="1" number="57"/> + <line hits="0" number="58"/> + <line hits="0" number="59"/> + <line hits="0" number="60"/> <line hits="1" number="63"/> + <line hits="1" number="64"/> + <line hits="1" number="65"/> + <line hits="1" number="67"/> + <line hits="1" number="68"/> + <line hits="0" number="69"/> + <line hits="0" number="70"/> + <line hits="0" number="71"/> + <line hits="0" number="72"/> + <line hits="1" number="74"/> + <line hits="1" number="75"/> + <line hits="1" number="76"/> + <line hits="1" number="77"/> + <line hits="1" number="79"/> + <line hits="1" number="81"/> + <line hits="1" number="82"/> + <line hits="1" number="83"/> + <line hits="1" number="84"/> + <line hits="1" number="86"/> + <line hits="1" number="87"/> + <line hits="1" number="88"/> + <line hits="1" number="90"/> + <line hits="1" number="91"/> + <line hits="1" number="94"/> + <line hits="1" number="95"/> + <line hits="1" number="98"/> + <line hits="1" number="99"/> + <line hits="1" number="100"/> + <line hits="1" number="101"/> + <line hits="1" number="104"/> + <line hits="1" number="105"/> + <line hits="0" number="106"/> + <line hits="0" number="107"/> + <line hits="1" number="110"/> + <line hits="1" number="111"/> + <line hits="0" number="112"/> + <line hits="0" number="113"/> + <line hits="1" number="115"/> + <line hits="1" number="116"/> + <line hits="0" number="117"/> + <line hits="0" number="118"/> + <line hits="1" number="120"/> </lines> </class> - <class branch-rate="0" complexity="0" filename="mod/trapd_file_utils.py" line-rate="0" name="trapd_file_utils.py"> + <class branch-rate="0" complexity="0" filename="mod/trapd_http_session.py" line-rate="0.6552" name="trapd_http_session.py"> <methods/> <lines> - <line hits="0" number="21"/> - <line hits="0" number="24"/> - <line hits="0" number="27"/> - <line hits="0" number="28"/> - <line hits="0" number="29"/> - <line hits="0" number="30"/> - <line hits="0" number="31"/> - <line hits="0" number="32"/> - <line hits="0" number="33"/> - <line hits="0" number="34"/> - <line hits="0" number="35"/> - <line hits="0" number="36"/> - <line hits="0" number="37"/> - <line hits="0" number="38"/> - <line hits="0" number="41"/> - <line hits="0" number="42"/> - <line hits="0" number="43"/> - <line hits="0" number="45"/> + <line hits="1" number="16"/> + <line hits="1" number="21"/> + <line hits="1" number="23"/> + <line hits="1" number="24"/> + <line hits="1" number="25"/> + <line hits="1" number="27"/> + <line hits="1" number="33"/> + <line hits="1" number="48"/> + <line hits="1" number="49"/> + <line hits="0" number="50"/> + <line hits="0" number="51"/> + <line hits="0" number="52"/> <line hits="0" number="53"/> + <line hits="0" number="54"/> + <line hits="1" number="56"/> + <line hits="1" number="62"/> + <line hits="1" number="78"/> + <line hits="1" number="79"/> + <line hits="1" number="80"/> + <line hits="1" number="81"/> + <line hits="0" number="82"/> + <line hits="0" number="83"/> + <line hits="0" number="84"/> + <line hits="0" number="86"/> + <line hits="0" number="87"/> + <line hits="1" number="93"/> + <line hits="1" number="110"/> + <line hits="1" number="113"/> + <line hits="1" number="114"/> + </lines> + </class> + <class branch-rate="0" complexity="0" filename="mod/trapd_io.py" line-rate="0.6599" name="trapd_io.py"> + <methods/> + <lines> + <line hits="1" number="16"/> + <line hits="1" number="19"/> + <line hits="1" number="22"/> + <line hits="1" number="23"/> + <line hits="1" number="24"/> + <line hits="1" number="25"/> + <line hits="1" number="26"/> + <line hits="1" number="27"/> + <line hits="1" number="28"/> + <line hits="1" number="29"/> + <line hits="1" number="30"/> + <line hits="1" number="31"/> + <line hits="1" number="32"/> + <line hits="1" number="33"/> + <line hits="1" number="36"/> + <line hits="1" number="37"/> + <line hits="1" number="39"/> + <line hits="1" number="47"/> + <line hits="1" number="55"/> + <line hits="1" number="57"/> + <line hits="1" number="59"/> <line hits="0" number="61"/> + <line hits="0" number="62"/> <line hits="0" number="63"/> - <line hits="0" number="65"/> - <line hits="0" number="67"/> - <line hits="0" number="68"/> - <line hits="0" number="69"/> - <line hits="0" number="70"/> + <line hits="0" number="64"/> + <line hits="1" number="66"/> + <line hits="1" number="67"/> + <line hits="1" number="68"/> + <line hits="1" number="69"/> + <line hits="0" number="71"/> <line hits="0" number="72"/> <line hits="0" number="73"/> <line hits="0" number="74"/> <line hits="0" number="75"/> - <line hits="0" number="77"/> <line hits="0" number="78"/> - <line hits="0" number="79"/> <line hits="0" number="80"/> <line hits="0" number="81"/> - <line hits="0" number="84"/> + <line hits="0" number="82"/> + <line hits="0" number="83"/> + <line hits="0" number="85"/> <line hits="0" number="86"/> - <line hits="0" number="87"/> - <line hits="0" number="88"/> <line hits="0" number="89"/> <line hits="0" number="91"/> <line hits="0" number="92"/> - <line hits="0" number="95"/> + <line hits="0" number="93"/> + <line hits="0" number="94"/> + <line hits="0" number="96"/> <line hits="0" number="97"/> - <line hits="0" number="98"/> - <line hits="0" number="99"/> - <line hits="0" number="100"/> - <line hits="0" number="102"/> - <line hits="0" number="103"/> - <line hits="0" number="112"/> - <line hits="0" number="117"/> - <line hits="0" number="120"/> - <line hits="0" number="122"/> - <line hits="0" number="124"/> - <line hits="0" number="125"/> - <line hits="0" number="126"/> - <line hits="0" number="127"/> + <line hits="1" number="106"/> + <line hits="1" number="111"/> + <line hits="1" number="114"/> + <line hits="1" number="116"/> + <line hits="1" number="118"/> + <line hits="1" number="119"/> + <line hits="1" number="120"/> + <line hits="1" number="121"/> + <line hits="1" number="123"/> + <line hits="1" number="124"/> + <line hits="1" number="126"/> + <line hits="0" number="128"/> <line hits="0" number="129"/> <line hits="0" number="130"/> - <line hits="0" number="132"/> - <line hits="0" number="134"/> - <line hits="0" number="135"/> - <line hits="0" number="136"/> + <line hits="0" number="131"/> + <line hits="1" number="133"/> + <line hits="1" number="134"/> + <line hits="1" number="136"/> <line hits="0" number="137"/> + <line hits="0" number="138"/> <line hits="0" number="139"/> <line hits="0" number="140"/> - <line hits="0" number="142"/> - <line hits="0" number="143"/> - <line hits="0" number="144"/> - <line hits="0" number="145"/> + <line hits="1" number="142"/> + <line hits="1" number="143"/> + <line hits="1" number="145"/> <line hits="0" number="146"/> + <line hits="0" number="147"/> <line hits="0" number="148"/> <line hits="0" number="149"/> - <line hits="0" number="151"/> - <line hits="0" number="152"/> - <line hits="0" number="153"/> - <line hits="0" number="154"/> - <line hits="0" number="155"/> - <line hits="0" number="157"/> - <line hits="0" number="164"/> - <line hits="0" number="169"/> + <line hits="1" number="151"/> + <line hits="1" number="158"/> + <line hits="1" number="163"/> + <line hits="1" number="167"/> + <line hits="1" number="170"/> + <line hits="0" number="171"/> + <line hits="0" number="172"/> <line hits="0" number="173"/> - <line hits="0" number="176"/> - <line hits="0" number="177"/> + <line hits="0" number="174"/> + <line hits="0" number="175"/> <line hits="0" number="178"/> - <line hits="0" number="179"/> <line hits="0" number="180"/> - <line hits="0" number="183"/> - <line hits="0" number="192"/> - <line hits="0" number="197"/> - <line hits="0" number="200"/> - <line hits="0" number="201"/> - <line hits="0" number="202"/> - <line hits="0" number="203"/> - <line hits="0" number="204"/> - <line hits="0" number="205"/> - <line hits="0" number="211"/> - <line hits="0" number="216"/> - <line hits="0" number="218"/> - <line hits="0" number="219"/> - <line hits="0" number="220"/> - <line hits="0" number="221"/> - <line hits="0" number="222"/> - <line hits="0" number="224"/> - <line hits="0" number="225"/> + <line hits="1" number="182"/> + <line hits="1" number="189"/> + <line hits="1" number="194"/> + <line hits="1" number="197"/> + <line hits="1" number="198"/> + <line hits="1" number="199"/> + <line hits="1" number="200"/> + <line hits="1" number="201"/> + <line hits="1" number="202"/> + <line hits="0" number="208"/> + <line hits="1" number="213"/> + <line hits="1" number="215"/> + <line hits="1" number="216"/> + <line hits="1" number="217"/> + <line hits="1" number="218"/> + <line hits="1" number="219"/> + <line hits="1" number="221"/> + <line hits="1" number="222"/> + <line hits="1" number="230"/> + <line hits="1" number="304"/> + <line hits="1" number="308"/> + <line hits="1" number="309"/> + <line hits="1" number="316"/> + <line hits="0" number="317"/> + <line hits="0" number="318"/> + <line hits="0" number="320"/> + <line hits="0" number="321"/> + <line hits="0" number="322"/> + <line hits="0" number="323"/> + <line hits="0" number="325"/> + <line hits="1" number="327"/> + <line hits="1" number="329"/> + <line hits="1" number="333"/> + <line hits="1" number="335"/> + <line hits="1" number="336"/> + <line hits="1" number="337"/> + <line hits="1" number="338"/> + <line hits="1" number="339"/> + <line hits="1" number="343"/> + <line hits="1" number="345"/> + <line hits="1" number="346"/> + <line hits="1" number="347"/> + <line hits="1" number="348"/> + <line hits="1" number="349"/> + <line hits="1" number="351"/> + <line hits="1" number="353"/> + <line hits="1" number="354"/> + <line hits="1" number="355"/> + <line hits="1" number="356"/> + <line hits="1" number="362"/> + <line hits="1" number="364"/> + <line hits="1" number="365"/> + <line hits="1" number="366"/> + <line hits="1" number="367"/> + <line hits="1" number="369"/> + <line hits="1" number="376"/> + <line hits="1" number="391"/> + <line hits="1" number="393"/> </lines> </class> - <class branch-rate="0" complexity="0" filename="mod/trapd_get_cbs_config.py" line-rate="0" name="trapd_get_cbs_config.py"> + <class branch-rate="0" complexity="0" filename="mod/trapd_runtime_pid.py" line-rate="0.8846" name="trapd_runtime_pid.py"> <methods/> <lines> - <line hits="0" number="21"/> - <line hits="0" number="27"/> - <line hits="0" number="29"/> - <line hits="0" number="30"/> - <line hits="0" number="31"/> - <line hits="0" number="32"/> - <line hits="0" number="33"/> - <line hits="0" number="34"/> - <line hits="0" number="35"/> - <line hits="0" number="37"/> - <line hits="0" number="38"/> - <line hits="0" number="39"/> - <line hits="0" number="40"/> - <line hits="0" number="42"/> - <line hits="0" number="50"/> - <line hits="0" number="58"/> - <line hits="0" number="61"/> - <line hits="0" number="62"/> - <line hits="0" number="63"/> - <line hits="0" number="64"/> - <line hits="0" number="65"/> - <line hits="0" number="68"/> - <line hits="0" number="69"/> - <line hits="0" number="70"/> - <line hits="0" number="72"/> - <line hits="0" number="73"/> - <line hits="0" number="74"/> - <line hits="0" number="75"/> - <line hits="0" number="76"/> - <line hits="0" number="77"/> - <line hits="0" number="79"/> - <line hits="0" number="80"/> - <line hits="0" number="81"/> - <line hits="0" number="82"/> - <line hits="0" number="84"/> - <line hits="0" number="86"/> + <line hits="1" number="16"/> + <line hits="1" number="21"/> + <line hits="1" number="23"/> + <line hits="1" number="24"/> + <line hits="1" number="25"/> + <line hits="1" number="26"/> + <line hits="1" number="27"/> + <line hits="1" number="29"/> + <line hits="1" number="35"/> + <line hits="1" number="49"/> + <line hits="1" number="50"/> + <line hits="1" number="51"/> + <line hits="1" number="52"/> + <line hits="1" number="53"/> + <line hits="1" number="54"/> + <line hits="1" number="55"/> + <line hits="1" number="61"/> + <line hits="1" number="67"/> + <line hits="1" number="80"/> + <line hits="1" number="81"/> + <line hits="1" number="82"/> + <line hits="1" number="83"/> + <line hits="1" number="85"/> <line hits="0" number="87"/> <line hits="0" number="88"/> <line hits="0" number="89"/> - <line hits="0" number="90"/> - <line hits="0" number="92"/> - <line hits="0" number="93"/> - <line hits="0" number="96"/> - <line hits="0" number="97"/> - <line hits="0" number="98"/> - <line hits="0" number="99"/> - <line hits="0" number="102"/> - <line hits="0" number="103"/> - <line hits="0" number="104"/> - <line hits="0" number="105"/> - <line hits="0" number="108"/> - <line hits="0" number="109"/> - <line hits="0" number="110"/> - <line hits="0" number="111"/> - <line hits="0" number="113"/> - <line hits="0" number="114"/> - <line hits="0" number="115"/> - <line hits="0" number="116"/> - <line hits="0" number="118"/> </lines> </class> - <class branch-rate="0" complexity="0" filename="mod/trapd_http_session.py" line-rate="0.8333" name="trapd_http_session.py"> + <class branch-rate="0" complexity="0" filename="mod/trapd_settings.py" line-rate="1" name="trapd_settings.py"> <methods/> <lines> - <line hits="1" number="21"/> + <line hits="1" number="16"/> + <line hits="1" number="19"/> + <line hits="1" number="22"/> + <line hits="1" number="27"/> + <line hits="1" number="38"/> + <line hits="1" number="40"/> + <line hits="1" number="45"/> + <line hits="1" number="47"/> + <line hits="1" number="50"/> + <line hits="1" number="52"/> + <line hits="1" number="55"/> + <line hits="1" number="57"/> + <line hits="1" number="60"/> + <line hits="1" number="62"/> + <line hits="1" number="65"/> + <line hits="1" number="67"/> + <line hits="1" number="69"/> + <line hits="1" number="74"/> + <line hits="1" number="76"/> + <line hits="1" number="78"/> + <line hits="1" number="80"/> + <line hits="1" number="82"/> + <line hits="1" number="84"/> + <line hits="1" number="86"/> + <line hits="1" number="91"/> + <line hits="1" number="93"/> + <line hits="1" number="95"/> + <line hits="1" number="97"/> + <line hits="1" number="99"/> + <line hits="1" number="101"/> + <line hits="1" number="103"/> + <line hits="1" number="105"/> + <line hits="1" number="110"/> + <line hits="1" number="115"/> + <line hits="1" number="117"/> + <line hits="1" number="122"/> + <line hits="1" number="124"/> + <line hits="1" number="129"/> + <line hits="1" number="133"/> + <line hits="1" number="136"/> + <line hits="1" number="147"/> + <line hits="1" number="148"/> + <line hits="1" number="149"/> + <line hits="1" number="150"/> + <line hits="1" number="151"/> + <line hits="1" number="152"/> + <line hits="1" number="161"/> + <line hits="1" number="162"/> + <line hits="1" number="163"/> + <line hits="1" number="164"/> + <line hits="1" number="165"/> + <line hits="1" number="166"/> + <line hits="1" number="167"/> + <line hits="1" number="170"/> + <line hits="1" number="173"/> + </lines> + </class> + <class branch-rate="0" complexity="0" filename="mod/trapd_snmpv3.py" line-rate="0.8519" name="trapd_snmpv3.py"> + <methods/> + <lines> + <line hits="1" number="16"/> + <line hits="1" number="23"/> + <line hits="1" number="25"/> <line hits="1" number="26"/> + <line hits="1" number="27"/> <line hits="1" number="28"/> <line hits="1" number="29"/> <line hits="1" number="30"/> + <line hits="1" number="31"/> <line hits="1" number="32"/> - <line hits="1" number="38"/> - <line hits="1" number="53"/> - <line hits="1" number="54"/> - <line hits="0" number="55"/> - <line hits="0" number="56"/> - <line hits="1" number="58"/> + <line hits="1" number="34"/> + <line hits="1" number="35"/> + <line hits="1" number="36"/> + <line hits="1" number="37"/> + <line hits="1" number="39"/> + <line hits="1" number="40"/> + <line hits="1" number="41"/> + <line hits="1" number="43"/> + <line hits="1" number="50"/> + <line hits="1" number="60"/> + <line hits="1" number="61"/> + <line hits="1" number="62"/> + <line hits="1" number="63"/> + <line hits="1" number="64"/> + <line hits="1" number="65"/> + <line hits="1" number="67"/> + <line hits="1" number="70"/> + <line hits="1" number="71"/> + <line hits="1" number="72"/> + <line hits="1" number="73"/> + <line hits="1" number="76"/> + <line hits="1" number="77"/> + <line hits="1" number="78"/> + <line hits="1" number="79"/> + <line hits="1" number="88"/> + <line hits="1" number="89"/> + <line hits="0" number="90"/> + <line hits="1" number="91"/> + <line hits="1" number="92"/> + <line hits="1" number="93"/> + <line hits="0" number="94"/> + <line hits="1" number="95"/> + <line hits="1" number="96"/> + <line hits="1" number="97"/> + <line hits="0" number="98"/> + <line hits="1" number="99"/> + <line hits="1" number="100"/> + <line hits="1" number="101"/> + <line hits="0" number="102"/> + <line hits="1" number="103"/> + <line hits="1" number="104"/> + <line hits="1" number="105"/> + <line hits="0" number="106"/> + <line hits="1" number="107"/> + <line hits="1" number="108"/> + <line hits="1" number="109"/> + <line hits="0" number="110"/> + <line hits="1" number="111"/> + <line hits="1" number="112"/> + <line hits="1" number="113"/> + <line hits="0" number="114"/> + <line hits="1" number="115"/> + <line hits="1" number="117"/> + <line hits="1" number="119"/> + <line hits="1" number="120"/> + <line hits="1" number="121"/> + <line hits="1" number="131"/> + <line hits="1" number="132"/> + <line hits="0" number="133"/> + <line hits="1" number="134"/> + <line hits="1" number="136"/> + <line hits="1" number="137"/> + <line hits="0" number="138"/> + <line hits="1" number="139"/> + <line hits="1" number="141"/> + <line hits="1" number="142"/> + <line hits="0" number="143"/> + <line hits="1" number="144"/> + <line hits="1" number="146"/> + <line hits="1" number="147"/> + <line hits="0" number="148"/> + <line hits="1" number="149"/> + <line hits="1" number="151"/> + <line hits="1" number="152"/> + <line hits="0" number="153"/> + <line hits="1" number="154"/> + <line hits="1" number="156"/> + <line hits="1" number="157"/> + <line hits="0" number="158"/> + <line hits="1" number="159"/> + <line hits="1" number="161"/> + <line hits="1" number="162"/> + <line hits="0" number="163"/> + <line hits="1" number="164"/> + <line hits="1" number="166"/> + <line hits="1" number="167"/> + <line hits="0" number="168"/> + <line hits="1" number="169"/> + <line hits="1" number="171"/> + <line hits="1" number="173"/> + <line hits="1" number="175"/> + <line hits="1" number="176"/> + <line hits="1" number="180"/> + <line hits="1" number="182"/> + <line hits="1" number="190"/> + <line hits="1" number="191"/> + <line hits="1" number="198"/> + <line hits="0" number="204"/> </lines> </class> - <class branch-rate="0" complexity="0" filename="mod/trapd_logging.py" line-rate="0" name="trapd_logging.py"> + <class branch-rate="0" complexity="0" filename="mod/trapd_stats_settings.py" line-rate="1" name="trapd_stats_settings.py"> <methods/> <lines> - <line hits="0" number="21"/> - <line hits="0" number="24"/> - <line hits="0" number="27"/> - <line hits="0" number="28"/> - <line hits="0" number="29"/> - <line hits="0" number="30"/> - <line hits="0" number="31"/> - <line hits="0" number="32"/> - <line hits="0" number="33"/> - <line hits="0" number="34"/> - <line hits="0" number="35"/> - <line hits="0" number="36"/> - <line hits="0" number="37"/> - <line hits="0" number="38"/> - <line hits="0" number="40"/> - <line hits="0" number="42"/> - <line hits="0" number="50"/> - <line hits="0" number="124"/> - <line hits="0" number="132"/> - <line hits="0" number="133"/> - <line hits="0" number="140"/> - <line hits="0" number="141"/> - <line hits="0" number="142"/> - <line hits="0" number="144"/> - <line hits="0" number="145"/> - <line hits="0" number="147"/> - <line hits="0" number="149"/> - <line hits="0" number="150"/> - <line hits="0" number="152"/> - <line hits="0" number="153"/> - <line hits="0" number="155"/> - <line hits="0" number="157"/> - <line hits="0" number="158"/> - <line hits="0" number="160"/> - <line hits="0" number="162"/> - <line hits="0" number="170"/> - <line hits="0" number="172"/> - <line hits="0" number="174"/> - <line hits="0" number="181"/> - <line hits="0" number="196"/> - <line hits="0" number="199"/> + <line hits="1" number="16"/> + <line hits="1" number="19"/> + <line hits="1" number="22"/> + <line hits="1" number="33"/> + <line hits="1" number="36"/> + <line hits="1" number="39"/> + <line hits="1" number="42"/> </lines> </class> - <class branch-rate="0" complexity="0" filename="mod/trapd_runtime_pid.py" line-rate="0.8846" name="trapd_runtime_pid.py"> + <class branch-rate="0" complexity="0" filename="mod/trapd_stormwatch.py" line-rate="0.7797" name="trapd_stormwatch.py"> <methods/> <lines> - <line hits="1" number="21"/> + <line hits="1" number="16"/> + <line hits="1" number="23"/> + <line hits="1" number="25"/> <line hits="1" number="26"/> + <line hits="1" number="27"/> <line hits="1" number="28"/> - <line hits="1" number="29"/> <line hits="1" number="30"/> <line hits="1" number="31"/> <line hits="1" number="32"/> + <line hits="1" number="33"/> <line hits="1" number="34"/> - <line hits="1" number="40"/> - <line hits="1" number="54"/> - <line hits="1" number="55"/> - <line hits="1" number="56"/> - <line hits="1" number="57"/> - <line hits="1" number="58"/> + <line hits="1" number="36"/> + <line hits="1" number="39"/> <line hits="1" number="59"/> <line hits="1" number="60"/> - <line hits="1" number="66"/> + <line hits="1" number="61"/> + <line hits="1" number="62"/> + <line hits="1" number="63"/> + <line hits="1" number="64"/> <line hits="1" number="72"/> + <line hits="1" number="82"/> + <line hits="1" number="83"/> + <line hits="1" number="84"/> <line hits="1" number="85"/> <line hits="1" number="86"/> <line hits="1" number="87"/> <line hits="1" number="88"/> + <line hits="1" number="89"/> <line hits="1" number="90"/> - <line hits="0" number="92"/> - <line hits="0" number="93"/> - <line hits="0" number="94"/> - </lines> - </class> - <class branch-rate="0" complexity="0" filename="mod/trapd_settings.py" line-rate="0" name="trapd_settings.py"> - <methods/> - <lines> - <line hits="0" number="21"/> - <line hits="0" number="24"/> - <line hits="0" number="27"/> - <line hits="0" number="32"/> - <line hits="0" number="43"/> - <line hits="0" number="45"/> - <line hits="0" number="50"/> - <line hits="0" number="52"/> - <line hits="0" number="55"/> - <line hits="0" number="57"/> - <line hits="0" number="60"/> - <line hits="0" number="62"/> - <line hits="0" number="65"/> - <line hits="0" number="67"/> - <line hits="0" number="70"/> - <line hits="0" number="72"/> - <line hits="0" number="74"/> - <line hits="0" number="79"/> - <line hits="0" number="81"/> - <line hits="0" number="83"/> - <line hits="0" number="85"/> - <line hits="0" number="87"/> - <line hits="0" number="89"/> - <line hits="0" number="94"/> - <line hits="0" number="96"/> - <line hits="0" number="98"/> - <line hits="0" number="100"/> - <line hits="0" number="102"/> - <line hits="0" number="104"/> - <line hits="0" number="106"/> - <line hits="0" number="108"/> - <line hits="0" number="113"/> - <line hits="0" number="118"/> - <line hits="0" number="120"/> - <line hits="0" number="125"/> + <line hits="1" number="91"/> + <line hits="1" number="92"/> + <line hits="1" number="93"/> + <line hits="1" number="94"/> + <line hits="1" number="95"/> + <line hits="1" number="96"/> + <line hits="1" number="97"/> + <line hits="1" number="98"/> + <line hits="1" number="99"/> + <line hits="1" number="100"/> + <line hits="1" number="101"/> + <line hits="1" number="103"/> + <line hits="1" number="104"/> + <line hits="1" number="112"/> + <line hits="1" number="121"/> + <line hits="1" number="122"/> + <line hits="1" number="123"/> + <line hits="1" number="124"/> + <line hits="1" number="125"/> + <line hits="0" number="126"/> <line hits="0" number="127"/> - <line hits="0" number="132"/> - <line hits="0" number="141"/> - <line hits="0" number="142"/> - <line hits="0" number="143"/> - <line hits="0" number="144"/> - <line hits="0" number="145"/> - <line hits="0" number="146"/> + <line hits="0" number="128"/> + <line hits="0" number="129"/> + <line hits="1" number="132"/> + <line hits="1" number="135"/> + <line hits="1" number="136"/> + <line hits="0" number="138"/> + <line hits="0" number="140"/> + <line hits="1" number="141"/> + <line hits="1" number="142"/> + <line hits="1" number="144"/> + <line hits="1" number="145"/> + <line hits="1" number="148"/> + <line hits="1" number="149"/> + <line hits="1" number="151"/> + <line hits="1" number="152"/> + <line hits="0" number="153"/> + <line hits="0" number="154"/> <line hits="0" number="155"/> <line hits="0" number="156"/> - <line hits="0" number="157"/> - <line hits="0" number="158"/> - <line hits="0" number="159"/> - <line hits="0" number="160"/> + <line hits="1" number="159"/> + <line hits="1" number="160"/> <line hits="0" number="161"/> + <line hits="0" number="162"/> + <line hits="0" number="163"/> <line hits="0" number="164"/> - <line hits="0" number="167"/> + <line hits="1" number="166"/> + <line hits="1" number="167"/> + <line hits="1" number="169"/> + <line hits="1" number="170"/> + <line hits="1" number="171"/> + <line hits="1" number="172"/> + <line hits="1" number="174"/> + <line hits="1" number="176"/> + <line hits="1" number="179"/> + <line hits="1" number="180"/> + <line hits="1" number="182"/> + <line hits="1" number="183"/> + <line hits="1" number="185"/> + <line hits="1" number="187"/> + <line hits="1" number="190"/> + <line hits="1" number="191"/> + <line hits="1" number="193"/> + <line hits="1" number="194"/> + <line hits="1" number="196"/> + <line hits="1" number="198"/> + <line hits="1" number="201"/> + <line hits="1" number="202"/> + <line hits="1" number="203"/> + <line hits="1" number="204"/> + <line hits="1" number="206"/> + <line hits="1" number="208"/> + <line hits="1" number="210"/> + <line hits="0" number="214"/> + <line hits="0" number="216"/> + <line hits="0" number="218"/> + <line hits="0" number="219"/> + <line hits="0" number="220"/> + <line hits="0" number="221"/> + <line hits="0" number="222"/> + <line hits="1" number="224"/> + <line hits="1" number="226"/> + <line hits="1" number="230"/> + <line hits="1" number="237"/> + <line hits="1" number="249"/> + <line hits="1" number="251"/> + <line hits="1" number="255"/> + <line hits="1" number="256"/> + <line hits="1" number="258"/> + <line hits="1" number="263"/> + <line hits="1" number="264"/> + <line hits="1" number="265"/> + <line hits="1" number="266"/> + <line hits="1" number="267"/> + <line hits="1" number="269"/> + <line hits="1" number="279"/> + <line hits="1" number="295"/> + <line hits="1" number="296"/> + <line hits="1" number="297"/> + <line hits="1" number="298"/> + <line hits="1" number="299"/> + <line hits="1" number="300"/> + <line hits="1" number="302"/> + <line hits="1" number="303"/> + <line hits="1" number="304"/> + <line hits="1" number="305"/> + <line hits="1" number="308"/> + <line hits="1" number="309"/> + <line hits="1" number="310"/> + <line hits="1" number="311"/> + <line hits="1" number="319"/> + <line hits="1" number="337"/> + <line hits="1" number="340"/> + <line hits="1" number="341"/> + <line hits="1" number="342"/> + <line hits="1" number="344"/> + <line hits="1" number="345"/> + <line hits="1" number="346"/> + <line hits="1" number="350"/> + <line hits="1" number="351"/> + <line hits="1" number="352"/> + <line hits="1" number="354"/> + <line hits="0" number="355"/> + <line hits="0" number="356"/> + <line hits="1" number="359"/> + <line hits="1" number="362"/> + <line hits="1" number="365"/> + <line hits="1" number="366"/> + <line hits="1" number="367"/> + <line hits="1" number="368"/> + <line hits="1" number="369"/> + <line hits="1" number="370"/> + <line hits="1" number="372"/> + <line hits="1" number="373"/> + <line hits="1" number="377"/> + <line hits="1" number="378"/> + <line hits="1" number="380"/> + <line hits="1" number="381"/> + <line hits="1" number="382"/> + <line hits="1" number="384"/> + <line hits="1" number="385"/> + <line hits="1" number="386"/> + <line hits="0" number="387"/> + <line hits="0" number="388"/> + <line hits="0" number="390"/> + <line hits="1" number="392"/> + <line hits="1" number="394"/> + <line hits="1" number="395"/> + <line hits="1" number="403"/> + <line hits="1" number="417"/> + <line hits="1" number="418"/> + <line hits="1" number="419"/> + <line hits="1" number="421"/> + <line hits="1" number="422"/> + <line hits="0" number="424"/> + <line hits="0" number="425"/> + <line hits="0" number="426"/> + <line hits="1" number="429"/> + <line hits="1" number="430"/> + <line hits="1" number="431"/> + <line hits="1" number="432"/> + <line hits="0" number="433"/> + <line hits="0" number="434"/> + <line hits="0" number="436"/> + <line hits="1" number="452"/> + <line hits="1" number="453"/> + <line hits="1" number="454"/> + <line hits="1" number="456"/> + <line hits="1" number="458"/> + <line hits="1" number="459"/> + <line hits="1" number="461"/> + <line hits="1" number="463"/> + <line hits="0" number="465"/> + <line hits="0" number="466"/> + <line hits="0" number="467"/> + <line hits="0" number="468"/> + <line hits="0" number="470"/> + <line hits="0" number="472"/> + <line hits="0" number="473"/> + <line hits="0" number="474"/> + <line hits="0" number="475"/> + <line hits="0" number="477"/> + <line hits="0" number="480"/> + <line hits="0" number="482"/> + <line hits="0" number="484"/> + <line hits="1" number="486"/> + <line hits="1" number="488"/> + <line hits="1" number="497"/> + <line hits="1" number="512"/> + <line hits="1" number="513"/> + <line hits="1" number="514"/> + <line hits="1" number="516"/> + <line hits="1" number="518"/> + <line hits="0" number="519"/> + <line hits="0" number="520"/> + <line hits="0" number="521"/> + <line hits="0" number="523"/> + <line hits="0" number="524"/> + </lines> + </class> + <class branch-rate="0" complexity="0" filename="mod/trapd_stormwatch_settings.py" line-rate="1" name="trapd_stormwatch_settings.py"> + <methods/> + <lines> + <line hits="1" number="16"/> + <line hits="1" number="19"/> + <line hits="1" number="22"/> + <line hits="1" number="43"/> + <line hits="1" number="46"/> + <line hits="1" number="49"/> + <line hits="1" number="51"/> + <line hits="1" number="53"/> + <line hits="1" number="55"/> + <line hits="1" number="58"/> + <line hits="1" number="60"/> + </lines> + </class> + <class branch-rate="0" complexity="0" filename="mod/trapd_vb_types.py" line-rate="0.7083" name="trapd_vb_types.py"> + <methods/> + <lines> + <line hits="1" number="16"/> + <line hits="1" number="23"/> + <line hits="1" number="25"/> + <line hits="1" number="26"/> + <line hits="1" number="27"/> + <line hits="1" number="28"/> + <line hits="1" number="29"/> + <line hits="1" number="30"/> + <line hits="1" number="31"/> + <line hits="1" number="32"/> + <line hits="1" number="34"/> + <line hits="1" number="35"/> + <line hits="1" number="36"/> + <line hits="1" number="38"/> + <line hits="1" number="44"/> + <line hits="1" number="59"/> + <line hits="1" number="62"/> + <line hits="0" number="75"/> + <line hits="0" number="76"/> + <line hits="0" number="77"/> + <line hits="0" number="78"/> + <line hits="0" number="80"/> + <line hits="0" number="82"/> + <line hits="0" number="83"/> </lines> </class> </classes> diff --git a/snmptrap/mod/trapd_stormwatch.py b/snmptrap/mod/trapd_stormwatch.py index 623fe39..9e41bd0 100644 --- a/snmptrap/mod/trapd_stormwatch.py +++ b/snmptrap/mod/trapd_stormwatch.py @@ -80,14 +80,22 @@ def sw_clear_dicts(): :Variables: """ try: - stats.oid_counter_dict.clear() - stats.agent_counter_dict.clear() - sws.sw_storm_active_dict.clear() - sws.sw_storm_counter_dict.clear() - sws.sw_config_oid_dict.clear() - sws.sw_config_low_water_in_interval_dict.clear() - sws.sw_config_high_water_in_interval_dict.clear() - sws.sw_config_category.clear() + if hasattr(stats, "oid_counter_dict"): + stats.oid_counter_dict.clear() + if hasattr(stats, "agent_counter_dict"): + stats.agent_counter_dict.clear() + if hasattr(sws, "sw_storm_active_dict"): + sws.sw_storm_active_dict.clear() + if hasattr(sws, "sw_storm_counter_dict"): + sws.sw_storm_counter_dict.clear() + if hasattr(sws, "sw_config_oid_dict"): + sws.sw_config_oid_dict.clear() + if hasattr(sws, "sw_config_low_water_in_interval_dict"): + sws.sw_config_low_water_in_interval_dict.clear() + if hasattr(sws, "sw_config_high_water_in_interval_dict"): + sws.sw_config_high_water_in_interval_dict.clear() + if hasattr(sws, "sw_config_category"): + sws.sw_config_category.clear() return True except Exception as e: msg = "unable to reset stormwatch dictionaries - results will be indeterminate: %s" % ( @@ -367,6 +375,8 @@ def sw_storm_active(_loc_agent, _loc_oid): # if we got this far, trap is in stormwatch configs, we've incremented # counter in sw_storm_counter_dict - figure out if we are over limit if sws.sw_storm_counter_dict[_dict_key] > _high_water_val: + print(f"sws.sw_storm_counter_dict[{_dict_key}]({sws.sw_storm_counter_dict[_dict_key]}) > _high_water_val ({_high_water_val})") + _loc_agent = _dict_key.split()[0] _loc_oid = _dict_key.split()[1] msg = "STORM ACTIVE: received %d events (%s) from %s (greater than high water threshold: %d)" % ( @@ -381,6 +391,7 @@ def sw_storm_active(_loc_agent, _loc_oid): tds.CODE_GENERAL, msg) return True else: + print(f"NOT sws.sw_storm_counter_dict[{_dict_key}]({sws.sw_storm_counter_dict[_dict_key]}) > _high_water_val ({_high_water_val})") return False # # # # # # # # # # # # # diff --git a/tests/test_trapd_stormwatch.py b/tests/test_trapd_stormwatch.py index 236157e..6463a0c 100644 --- a/tests/test_trapd_stormwatch.py +++ b/tests/test_trapd_stormwatch.py @@ -17,6 +17,7 @@ import pytest import unittest import trapd_exit +import time import trapd_stormwatch as sw import trapd_stormwatch_settings as sws @@ -48,6 +49,119 @@ class test_cleanup_and_exit(unittest.TestCase): self.assertEqual(result, True) + # try again, but with stats.total_notifications removed + delattr(stats, "total_notifications") + + try: + sw.stats_increment_counters("192.168.1.1", ".1.2.3.4.5.6") + result = True + except: + result = False + + self.assertEqual(result, True) + + def test_sw_clear_dicts(self): + """ + Test sw_clear_dicts + """ + sw.sw_init() + # initialize attributes not handled by sw_init() + sws.sw_storm_counter_dict = {} + stats.agent_counter_dict = {} + stats.oid_counter_dict = {} + sws.sw_config_category = {} + # provide a value that can tested for + sws.sw_storm_counter_dict["abc"] = "def" + + sw.sw_clear_dicts() + self.assertFalse("abc" in sws.sw_storm_counter_dict) + + # now make sure we get an exception + sws.sw_config_category = 3 + self.assertFalse(sw.sw_clear_dicts()) + + # clean up the attributes we added above + delattr(sws, "sw_storm_counter_dict") + delattr(stats, "agent_counter_dict") + delattr(stats, "oid_counter_dict") + delattr(sws, "sw_config_category") + + def test_sw_log_metrics(self): + """ + Test sw_clear_log_metrics + """ + sw.sw_init() + + stats.total_notifications = 3 + stats.total_notifications = 50 + sws.sw_interval_in_seconds = 30 + stats.agent_counter_dict = { "a": 3, "b": 40 } + stats.metric_log_notification_threshold_pct = 30 + sw.sw_log_metrics() + + # make sure we got this far + assert(True) + + def test_sw_storm_active(self): + """ + Test sw_storm_active() + """ + sw.sw_init() + # initialize attributes not handled by sw_init() + stats.oid_counter_dict = {} + + # initialize attributes for the test + loc_agent = "192.168.1.1" + loc_oid = ".1.2.3.4.5.6" + sws.sw_config_high_water_in_interval_dict[loc_oid] = 50 + sws.sw_storm_counter_dict = {} + dict_key = loc_agent + " " + loc_oid + + # Four cases to test. + + # #1 + # if sws.sw_storm_active_dict[dict_key] exists + # return True + # #2 + # else (sws.sw_storm_active_dict does not exist) + # if sws.sw_storm_counter_dict[dict_key] > sws.sw_config_high_water_in_interval_dict[loc_oid] + # create sws.sw_storm_active_dict[dict_key] + # return True + # #3 + # else + # return False + # #4 + # sws.sw_last_stormwatch_dict_analysis gets reset often. + # but if time.time() - sw_last_stormwatch_dict_analysis > than sw_interval_in_seconds, + # then sw_reset_counter_dict() is invoked. + + # start with sws.sw_storm_active_dict[dict_key] does not exist + # and sws.sw_storm_counter_dict[dict_key] < high_water_mark + sws.sw_storm_active_dict = {} + sws.sw_storm_counter_dict[dict_key] = 10 + # Should return False + self.assertFalse(sw.sw_storm_active(loc_agent, loc_oid)) + # self.assertFalse(hasattr(sws, "sw_storm_active_dict")) + + # now with sws.sw_storm_counter_dict[dict_key] > high_water_mark + sws.sw_storm_counter_dict[dict_key] = 60 + # should create sws.sw_storm_active_dict[dict_key] and return True + self.assertTrue(sw.sw_storm_active(loc_agent, loc_oid)) + self.assertTrue(sws.sw_storm_active_dict.get(dict_key) != None) + + # now that sws.sw_storm_active_dict[dict_key] exists + # should return True + self.assertTrue(sw.sw_storm_active(loc_agent, loc_oid)) + + # now force sws.sw_last_stormwatch_dict_analysis to an old value + sws.sw_last_stormwatch_dict_analysis = int(time.time()) - sws.sw_interval_in_seconds - 20 + # and make certain that stats.oid_counter_dict got cleared. + if not hasattr(stats, "oid_counter_dict"): + stats.oid_counter_dict = {} + stats.oid_counter_dict["abc"] = 5 + self.assertTrue(sw.sw_storm_active(loc_agent, loc_oid)) + self.assertTrue(not hasattr(sws,"oid_counter_dict")) + # .get("abc") != None) if __name__ == '__main__': # sws.init() |