MCPcopy Create free account
hub / github.com/secdev/scapy / campaign_to_HTML

Function campaign_to_HTML

scapy/tools/UTscapy.py:706–751  ·  view source on GitHub ↗
(test_campaign)

Source from the content-addressed store, hash-verified

704
705
706def campaign_to_HTML(test_campaign):
707 output = """
708<h1>%(title)s</h1>
709
710<p>
711""" % test_campaign
712
713 if test_campaign.crc is not None and test_campaign.sha is not None:
714 output += "CRC=<span class=crc>%(crc)s</span> SHA=<span class=crc>%(sha)s</span><br>" % test_campaign
715 output += "<small><em>" + html_info_line(test_campaign) + "</em></small>"
716 output += "".join([
717 test_campaign.headcomments,
718 "\n<p>",
719 "PASSED=%(passed)i FAILED=%(failed)i" % test_campaign,
720 " <span class=warn_interrupted>INTERRUPTED!</span>" if test_campaign.interrupted else "",
721 "<p>\n\n",
722 ])
723
724 for testset in test_campaign:
725 output += "<h2>" % testset
726 if testset.crc is not None:
727 output += "<span class=crc>%(crc)s</span> " % testset
728 output += "%(name)s</h2>\n%(comments)s\n<ul>\n" % testset
729 for t in testset:
730 output += """<li class=%(result)s id="tst%(num)il">\n""" % t
731 if t.expand == 2:
732 output += """
733<span id="tst%(num)i+" class="button%(result)s" onClick="show('tst%(num)i')" style="POSITION: absolute; VISIBILITY: hidden;">+%(num)03i+</span>
734<span id="tst%(num)i-" class="button%(result)s" onClick="hide('tst%(num)i')">-%(num)03i-</span>
735""" % t
736 else:
737 output += """
738<span id="tst%(num)i+" class="button%(result)s" onClick="show('tst%(num)i')">+%(num)03i+</span>
739<span id="tst%(num)i-" class="button%(result)s" onClick="hide('tst%(num)i')" style="POSITION: absolute; VISIBILITY: hidden;">-%(num)03i-</span>
740""" % t
741 if t.crc is not None:
742 output += "<span class=crc>%(crc)s</span>\n" % t
743 output += """%(name)s\n<span class="comment %(result)s" id="tst%(num)i" """ % t # noqa: E501
744 if t.expand < 2:
745 output += """ style="POSITION: absolute; VISIBILITY: hidden;" """ # noqa: E501
746 output += """><br>%(comments)s
747<pre>
748%(output)s</pre></span>
749""" % t
750 output += "\n</ul>\n\n"
751 return output
752
753
754def pack_html_campaigns(runned_campaigns, data, local=False, title=None):

Callers 1

execute_campaignFunction · 0.85

Calls 2

html_info_lineFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…