[tor-bugs] #6950 [pyonionoo]: write tests for pyonionoo

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Dec 3 14:45:55 UTC 2012


#6950: write tests for pyonionoo
-----------------------+----------------------------------------------------
 Reporter:  gsathya    |          Owner:  gsathya 
     Type:  task       |         Status:  accepted
 Priority:  major      |      Milestone:          
Component:  pyonionoo  |        Version:          
 Keywords:             |         Parent:          
   Points:             |   Actualpoints:          
-----------------------+----------------------------------------------------

Comment(by karsten):

 Here's a start.

 1 Unparameterized Tests

  - 1.1 Request all summary documents ("GET summary") and make sure that
 the result matches all properties we can check: same number of
 relays/bridges as in the test data, relays_published and bridges_published
 as expected, all nicknames 1-19 alphanumerical characters and as in
 example data, all fingerprints and hashed fingerprints as in example data
 and 40 upper-case hex characters, all IP addresses correct with IPv6 hex
 characters being lower-case (TODO still needs to be specified!), running
 fields as in example data, no additional fields that are not specified.
 If there are unspecified fields in the response, that's not an error, but
 it means we should write tests for them, so it's okay to make the test
 fail in those cases.  This is going to be a long test case with a short
 request part and a long evaluation part.

  - 1.2 Request all detail documents ("GET details") and test the same
 things as in 1.1, but for all details fields.  Limit to details of a
 single relay and a single bridge.  This is going to be an even longer test
 case.

  - 1.3 Request all bandwidth documents ("GET bandwidth") and test the same
 things as in 1.2, but for bandwidth fields.  Limit to single relay and
 single bridge.

  - 1.4 Request all weights documents ("GET weights") and test the same
 things as in 1.3, but for weights fields.Limit to single relay and single
 bridge.

  - 1.5 Request a non-existant document type, e.g., "GET doesnotexist", and
 make sure to receive a 404 response code.

  - 1.6 Request all summary documents, but with header "Accept-Encoding:
 gzip".  The result may or may not be gzip-compressed; both cases are
 acceptable.  But make sure that the result is correct and the server does
 not fail because of setting this header.

  - 1.7 Request all summary documents, but with an unknown encoding header,
 e.g., "Accept-Encoding: doesnotexist".  Find out what the typical behavior
 is.  Probably an error response code?

  - 1.8 Request all summary documents with a "If-Modified-Since" header far
 in the past, e.g., in the mid 1980's.  The result should be the same as
 when this header is absent.  Only check something trivial, like number of
 contained relays.

  - 1.9 Request all summary documents with a "If-Modified-Since" header far
 in the future, e.g., in the mid 2030's.  The result should be an empty
 response.

  - 1.10 Request all summary documents, extract the "Last-Modified" header
 if present, and request summary documents again with "If-Modified-Since"
 set to that timestamp.  The second result should be empty.

  - 1.11 Request all summary documents, but write summary in upper-case:
 "GET SUMMARY".  Make sure to receive a 404 response code.

  - 1.12--1.xx Request an unknown document type with special characters in
 it, e.g., space, percent, etc.

 2 Filtering parameter tests

 [...]

 3 Ordering and limiting parameter tests

 [...]

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


More information about the tor-bugs mailing list