[tor-bugs] #7485 [Ooni]: ooni NestTestCases don't test inputs from files

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Nov 15 15:48:47 UTC 2012


#7485: ooni NestTestCases don't test inputs from files
--------------------------+-------------------------------------------------
    Reporter:  isis       |       Owner:  isis        
        Type:  defect     |      Status:  closed      
    Priority:  normal     |   Milestone:              
   Component:  Ooni       |     Version:              
  Resolution:  not a bug  |    Keywords:  ooni, inputs
      Parent:             |      Points:              
Actualpoints:             |  
--------------------------+-------------------------------------------------
Changes (by hellais):

  * status:  needs_information => closed
  * resolution:  => not a bug


Comment:

 Ah I did not see the attached file.

 So these are two issues that have not much to do with input processor.

 1) the echo test:

 You are calling inputProcessor with a file pointer, while it should be
 taking as input as filename. Also you must not be calling inputProcessor
 directly from your test as it acts transparently setting the self.input
 attribute at every iteration over the file.

 If you need to have some special parsing being done on your file then you
 should overwrite the inputProcessor method and provide your own
 inputprocessor directive that does what you are currently doing inside of
 inputParser().

 inputProcessor must be a generator that yields at every iteration what
 ends up being set on self.input.

 For more information read the docstring of inputProcessor:
 https://gitweb.torproject.org/ooni-
 probe.git/blob/HEAD:/ooni/nettest.py#l118

 The confusion there is because of a change between the the inputprocessor
 taking a previously a file object and now taking a filename.

 Also regarding your test I think that that functionality for selecting the
 interface and setting the scapy properties should go into the scapy test
 template.

 The goal of the ooniprobe test API is to make them as small and readable
 as possible, so everything that is not directly related to network
 measurements should be hidden.

 Also there is a very basic ICMP ping implementation in the examples:
 https://gitweb.torproject.org/ooni-
 probe.git/blob/HEAD:/nettests/examples/example_scapyt.py

 2) regaring daphn3,

 You seem to not have the backend component running. Daphn3 is a test that
 requires a special backend running. If it is not running it will not be
 able to run the test.

 I have not done extensive testing of daphn3 so it may have other bugs,
 though this is also not related to the use of inputProcessor.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/7485#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list