commit 254c765bf37061d3b6a89a0a3f09f169ea465d9f Author: aagbsn aagbsn@extc.org Date: Fri Jan 25 19:42:37 2013 +0000
Add sent packets to report and use startSending instead of sendPackets
if sendPackets is called before startSending is called, ScapySender is not properly initialized --- ooni/templates/scapyt.py | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/ooni/templates/scapyt.py b/ooni/templates/scapyt.py index 5f6c7c8..df19684 100644 --- a/ooni/templates/scapyt.py +++ b/ooni/templates/scapyt.py @@ -135,10 +135,11 @@ class BaseScapyTest(NetTestCase): scapySender = ScapySender()
config.scapyFactory.registerProtocol(scapySender) - scapySender.sendPackets(packets) + scapySender.startSending(packets) + #scapySender.sendPackets(packets)
scapySender.stopSending() - for packet in packets: - self.reportSentPacket(packet) + for sent_packet in packets: + self.report['sent_packets'].append(sent_packet)
ScapyTest = BaseScapyTest