diff --git a/.travis.yml b/.travis.yml index 622760aacd18e12a7cc0b9e5920a275d521fc18c..8d842d1f3424f3df0f5aa8e3b0e4a8f93d3c53f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,4 @@ python: install: - pip install pycrypto -script: cd test/ && ./run_tests -F -t regression.uts -K netaccess -K automaton +script: cd test/; for f in *.uts; do ./run_tests -q -F -t $f -K netaccess -K automaton || exit $?; done; for f in ../scapy/contrib/*.uts ; do ./run_tests -q -F -t $f -K netaccess -K automaton -P "load_contrib('$(basename ${f/.uts})')" || exit $?; done diff --git a/scapy/contrib/HomePlugAV.uts b/scapy/contrib/HomePlugAV.uts index 62434eb1106a4ba4acca9a32ff659c40ab25c9e5..9b4059581e71b33ffc72bdb5aa6a924e2047c545 100644 --- a/scapy/contrib/HomePlugAV.uts +++ b/scapy/contrib/HomePlugAV.uts @@ -94,6 +94,7 @@ NetworkInfoConfirmationV10 in a or NetworkInfoConfirmationV11 in a _ == True = Reading local 0x400st octets of Software Image in Module Data blocks +~ netaccess HomePlugAV ReadModuleDataRequest pkt = Ether()/HomePlugAV()/ReadModuleDataRequest(ModuleID=0x1) a = srp1(pkt, iface="eth0") a diff --git a/scapy/tools/UTscapy.py b/scapy/tools/UTscapy.py index d4310eb5ebdfcf71916f14ef1e9dc96ed3ad7c6f..532d327bdfa88e6ca7a97fec00f303990ac91f58 100755 --- a/scapy/tools/UTscapy.py +++ b/scapy/tools/UTscapy.py @@ -319,6 +319,7 @@ def run_campaign(test_campaign, get_interactive_session, verb=2): if verb: print >>sys.stderr,"Campaign CRC=%(crc)s SHA=%(sha)s" % test_campaign print >>sys.stderr,"PASSED=%i FAILED=%i" % (passed, failed) + return failed #### INFO LINES #### @@ -346,10 +347,11 @@ def campaign_to_TEXT(test_campaign): output += "Passed=%(passed)i\nFailed=%(failed)i\n\n%(headcomments)s\n" % test_campaign for testset in test_campaign: - output += "######\n## %(name)s\n######\n%(comments)s\n\n" % testset - for t in testset: - if t.expand: - output += "###(%(num)03i)=[%(result)s] %(name)s\n%(comments)s\n%(output)s\n\n" % t + if any(t.expand for t in testset): + output += "######\n## %(name)s\n######\n%(comments)s\n\n" % testset + for t in testset: + if t.expand: + output += "###(%(num)03i)=[%(result)s] %(name)s\n%(comments)s\n%(output)s\n\n" % t return output @@ -359,10 +361,11 @@ def campaign_to_ANSI(test_campaign): output += "Passed=%(passed)i\nFailed=%(failed)i\n\n%(headcomments)s\n" % test_campaign for testset in test_campaign: - output += "######\n## %(name)s\n######\n%(comments)s\n\n" % testset - for t in testset: - if t.expand: - output += "###(%(num)03i)=[%(result)s] %(name)s\n%(comments)s\n%(output)s\n\n" % t + if any(t.expand for t in testset): + output += "######\n## %(name)s\n######\n%(comments)s\n\n" % testset + for t in testset: + if t.expand: + output += "###(%(num)03i)=[%(result)s] %(name)s\n%(comments)s\n%(output)s\n\n" % t return output @@ -635,7 +638,7 @@ def main(argv): # Run tests test_campaign.output_file = OUTPUTFILE - run_campaign(test_campaign, autorun_func[FORMAT], verb=VERB) + result = run_campaign(test_campaign, autorun_func[FORMAT], verb=VERB) # Shrink passed if ONLYFAILED: @@ -659,6 +662,7 @@ def main(argv): OUTPUTFILE.write(output) OUTPUTFILE.close() + return result if __name__ == "__main__": - main(sys.argv[1:]) + exit(main(sys.argv[1:])) diff --git a/test/edns0.uts b/test/edns0.uts index d7a448aa09629ff8c36836f8b5fcf7a773c269f2..b3eb6f14cfcde58b7d6c95baa37ada1357b14518 100644 --- a/test/edns0.uts +++ b/test/edns0.uts @@ -46,6 +46,8 @@ tlv = EDNS0TLV(optcode=5, optdata="\x00\x11\x22\x33") str(tlv) == '\x00\x05\x00\x04\x00\x11"3' = EDNS-PING - Live test +~ netaccess +* NB: 85.17.219.217 and www.edns-ping.org seem down r = sr1(IP(dst="85.17.219.217")/UDP()/DNS(qd=[DNSQR(qtype="A", qname="www.edns-ping.org.")], ar=[DNSRROPT(z=0, rdata=[EDNS0TLV(optcode="PING", optdata="\x00\x11\x22\x33")])]), timeout=1) len(r.ar) and r.ar.rdata[0].optcode == 4 # XXX: should be 5 @@ -56,5 +58,7 @@ tlv = EDNS0TLV(optcode=2, optdata="") str(tlv) == '\x00\x02\x00\x00' = NSID - Live test +~ netaccess +* NB: 85.17.219.217 and www.edns-ping.org seem down r = sr1(IP(dst="85.17.219.217")/UDP()/DNS(qd=[DNSQR(qtype="A", qname="www.edns-ping.org.")], ar=[DNSRROPT(z=0, rdata=[EDNS0TLV(optcode="NSID")])]), timeout=1) r.ar.rdata[0].optcode == 3 and r.ar.rdata[0].optdata == "dns01"