[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [stem/master] Speed up descriptor reader unit test
commit 776e2a39e929c4fafee75a7562df7e27bd9c4c66
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date: Tue Jan 31 19:04:48 2017 -0800
Speed up descriptor reader unit test
These tests were already quick but had a little more room to sweeze out some
time. Timeout change is a no-duh. Main benefit though came from making two of
our tests more targeted in what they parse.
When checking for unparseable content we don't need to read all the other
descriptor files (other tests already make assertions we can read them). As for
our test of get_processed_files() reading one file is just as good as reading
them all.
This drops the runtime on my netbook from 2.2s to 1.2s (45% faster).
---
...ached-microdesc-consensus_with_carriage_returns | 140 ---------------------
.../descriptor/data/extrainfo_nonascii_v3_reqs | 30 -----
test/unit/descriptor/data/new_metrics_type | 3 -
test/unit/descriptor/data/riddle | 20 ---
test/unit/descriptor/data/tiny.png | Bin 188 -> 0 bytes
...ached-microdesc-consensus_with_carriage_returns | 140 +++++++++++++++++++++
.../data/unparseable/extrainfo_nonascii_v3_reqs | 30 +++++
.../descriptor/data/unparseable/new_metrics_type | 3 +
test/unit/descriptor/data/unparseable/riddle | 20 +++
test/unit/descriptor/data/unparseable/tiny.png | Bin 0 -> 188 bytes
test/unit/descriptor/data/unparseable/vote | 100 +++++++++++++++
test/unit/descriptor/data/vote | 100 ---------------
test/unit/descriptor/reader.py | 21 ++--
13 files changed, 301 insertions(+), 306 deletions(-)
diff --git a/test/unit/descriptor/data/cached-microdesc-consensus_with_carriage_returns b/test/unit/descriptor/data/cached-microdesc-consensus_with_carriage_returns
deleted file mode 100644
index 7fd7d3f..0000000
--- a/test/unit/descriptor/data/cached-microdesc-consensus_with_carriage_returns
+++ /dev/null
@@ -1,140 +0,0 @@
-network-status-version 3 microdesc
-vote-status consensus
-consensus-method 20
-valid-after 2015-09-15 18:00:00
-fresh-until 2015-09-15 19:00:00
-valid-until 2015-09-15 21:00:00
-voting-delay 300 300
-client-versions 0.2.4.23,0.2.4.24,0.2.4.25,0.2.4.26,0.2.4.27,0.2.5.8-rc,0.2.5.9-rc,0.2.5.10,0.2.5.11,0.2.5.12,0.2.6.5-rc,0.2.6.6,0.2.6.7,0.2.6.8,0.2.6.9,0.2.6.10,0.2.7.1-alpha,0.2.7.2-alpha
-server-versions 0.2.4.23,0.2.4.24,0.2.4.25,0.2.4.26,0.2.4.27,0.2.5.8-rc,0.2.5.9-rc,0.2.5.10,0.2.5.11,0.2.5.12,0.2.6.5-rc,0.2.6.6,0.2.6.7,0.2.6.8,0.2.6.9,0.2.6.10,0.2.7.1-alpha,0.2.7.2-alpha
-known-flags Authority BadExit Exit Fast Guard HSDir Running Stable V2Dir Valid
-params CircuitPriorityHalflifeMsec=30000 NumDirectoryGuards=3 NumEntryGuards=1 NumNTorsPerTAP=100 Support022HiddenServices=0 UseNTorHandshake=1 UseOptimisticData=1 bwauthpid=1 cbttestfreq=1000 pb_disablepct=0 usecreatefast=0
-dir-source tor26 14C131DFC5C6F93646BE72FA1401C02A8DF2E8B4 86.59.21.38 86.59.21.38 80 443
-contact Peter Palfrader
-vote-digest 7DD2661BBBA3E600CB9D641CFFF27D14D77EDCCE
-dir-source longclaw 23D15D965BC35114467363C165C4F724B64B4F66 longclaw.riseup.net 199.254.238.52 80 443
-contact Riseup Networks <collective at riseup dot net> - 1nNzekuHGGzBYRzyjfjFEfeisNvxkn4RT
-vote-digest 2EBB0C5EFEFE51ECE8C630A45F607201491D7E09
-dir-source maatuska 49015F787433103580E3B66A1707A00E60F2D15B 171.25.193.9 171.25.193.9 443 80
-contact 4096R/23291265 Linus Nordberg <linus@xxxxxxxxxxx>
-vote-digest 7FC1487C8D7C810C6FA8037AE6EC81ACECC408B8
-dir-source dannenberg 585769C78764D58426B8B52B6651A5A71137189A dannenberg.torauth.de 193.23.244.244 80 443
-contact Andreas Lehner <ops@xxxxxxxxxx>
-vote-digest 32F82FE133ADAAED686A7360297C56B327994799
-dir-source urras 80550987E1D626E3EBA5E5E75A458DE0626D088C 208.83.223.34 208.83.223.34 443 80
-contact 4096R/D255D3F5C868227F Jacob Appelbaum <jacob@xxxxxxxxxxxxx>
-vote-digest 86348CCEC68457D5C1777978D1043B211FA44010
-dir-source moria1 D586D18309DED4CD6D57C18FDB97EFA96D330566 128.31.0.34 128.31.0.34 9131 9101
-contact 1024D/28988BF5 arma mit edu
-vote-digest 9D18B15C2C039CB0B18B51496F8ACBDA2836DE19
-dir-source dizum E8A9C45EDE6D711294FADF8E7951F4DE6CA56B58 194.109.206.212 194.109.206.212 80 443
-contact 1024R/8D56913D Alex de Joode <adejoode@xxxxxxxxxxxx>
-vote-digest 5473986DC071B8840F9E8C72AED3251B71A8244F
-dir-source gabelmoo ED03BB616EB2F60BEC80151114BB25CEF515B226 131.188.40.189 131.188.40.189 80 443
-contact 4096R/261C5FBE77285F88FB0C343266C8C2D7C5AA446D Sebastian Hahn <tor@xxxxxxxxxxxxxxxxx> - 12NbRAjAG5U3LLWETSF7fSTcdaz32Mu5CN
-vote-digest 6EF25161284DB1AD19411EBF52E96927DFD66F0C
-dir-source Faravahar EFCBE720AB3A82B99F9E953CD5BF50F7EEFC7B97 154.35.175.225 154.35.175.225 80 443
-contact 0x0B47D56D Sina Rabbani (inf0) <sina redteam net>
-vote-digest 76466BEF6525FCEE0B9FDDB205B527CBB89FAB17
-r PDrelay1 AAFJ5u9xAqrKlpDW6N0pMhJLlKs 2015-09-15 04:53:47 95.215.44.189 8080 0
-m iH2s4cVPTmThmmx1phnjDd6oGpHAEP7FDK38AFYRV74
-s Fast Running Stable Valid
-v Tor 0.2.7.2-alpha-dev
-w Bandwidth=456
-r seele AAoQ1DAR6kkoo19hBAX5K0QztNw 2015-09-15 04:43:45 73.15.150.172 9001 0
-m LqTE9J4jxtMVm2IPDxmUKYyrzajcjqwYqLkX6JNOEpY
-s Fast Running Stable Valid
-v Tor 0.2.6.10
-w Bandwidth=15
-r TorNinurtaName AA8YrCza5McQugiY3J4h5y4BF9g 2015-09-15 17:06:16 151.236.6.198 443 80
-m YxghdOEPO/uPv0N1GZV+6gCuYR5NZPaDseU45R/Yyns
-s Fast HSDir Running Stable V2Dir Valid
-v Tor 0.2.6.10
-w Bandwidth=1750
-r CalyxInstitute14 ABG9JIWtRdmE7EFZyI/AZuXjMA4 2015-09-15 16:12:03 162.247.72.201 443 80
-m 6PnpSoAVS1oaJCqs4uk8y706JSZ6rdN8uUM78Oohgo0
-s Exit Fast Guard HSDir Running Stable V2Dir Valid
-v Tor 0.2.6.10
-w Bandwidth=11400
-directory-footer
-bandwidth-weights Wbd=0 Wbe=0 Wbg=3944 Wbm=10000 Wdb=10000 Web=10000 Wed=10000 Wee=10000 Weg=10000 Wem=10000 Wgb=10000 Wgd=0 Wgg=6056 Wgm=6056 Wmb=10000 Wmd=0 Wme=0 Wmg=3944 Wmm=10000
-directory-signature sha256 14C131DFC5C6F93646BE72FA1401C02A8DF2E8B4 0B49FD2F55D02B630E7A500E34FD5B6F98FDA9D2
------BEGIN SIGNATURE-----
-OYThM95E2Pcj4RWZeND9+llOUlyHLwGtHqF+n92xKTsZdc7ogigEosdqVEB1GaeJ
-D/GWSESN9VLEiiw5VKBG4UVvZUaFVRUnZSJVS4gNgckH5LD0VUJb0C/tIeBHJ7ea
-cTOwsb0vHau/W8hkAciEWLfjmAtcWutdT6lljSJ65NWyZynDPHTmtKnsB65kKT+2
-p5W9GBxnMUH+Pnt2JkFqyKAsE8GgppMuk4O+AX+BtQgzK4K+pTcKFko6e/NmrBh3
-W6AV/fR9/PdSUNYb6+uH/LsUhVePFVbke44u6bBN39LkvxWErQdd3yA91lUdqwz8
-zR/uAngvj05Bt1zmH9eG1Kd02dgL4PqNmTI0VKZjWamf4k/xMmecU0xfrHLv52Rw
-/hync6FsEIrfI+B942sjIEGfv+T6UuIMNoMvkwrby6nw6WL7lAoJJq5pyBYLzlFj
-xLW6e567FFjqf4siHpGCzWCHoXUU+NmygDSakh0orgGoHdVW6JcKbs0QieUyUu+X
------END SIGNATURE-----
-directory-signature sha256 23D15D965BC35114467363C165C4F724B64B4F66 3C12B8EE0B3DC3AEDD8CD27CCB02C564281BE765
------BEGIN SIGNATURE-----
-doESbeqw4jQagxP8o0Yr6VVUdB2Hnmct4F5sH1pBntPYOqIeT3GbYuFT1TdYr9SG
-xSpI5+aRcbSQrKryvF+qSgOJS4131YuCmL7zlwhQrQcFtltyRS8UTopubrLbvAJ1
-njJt05lM8NWg6NN3uZ4Zy4L/qzn9qZB9l8WbxKZJnxott6+Rp1H19tsl77ENB4GJ
-Bfhc9C46LOKUfmV5IB0f+0nFOO3PDhbRFEcDw5EEGPx6xLk+EH9YHvP98VIY/YPi
-vtYN9G5G2PplvqG4hyIhGAYy/hm3ZTHf9eIsKvsBgHadBeFCupA/l6tf36nK94Ts
-d68QhqPo8QhrjM5FTddGOA==
------END SIGNATURE-----
-directory-signature sha256 49015F787433103580E3B66A1707A00E60F2D15B 2467B90267EEEDDD614694F16A523B0E6EBF6FAA
------BEGIN SIGNATURE-----
-NVXfCo512TGvfHr+9XB7nVTDMRurSlwrz/vHfXjSzmJ/6dbIK6PA98lBgvX3i83N
-2AZoUcIc5wasYjUleRrP4k2jn5sBArCr3g64FsZ4/RJMLg2pWxEw4xDY2DLjKpyZ
-BfndyOG5KSEtIszXw0szS0kkTyz7oI76L1vu016Mh35YjaeqK0Vu+P2gxJtKxNyt
-pLPZwTWVQfjqLAebtXD2Bi5Csty7TSAhsNe9KE5pUB7+DyzvbamuJzyhUFbuOgii
-Y1nguoknHVgHnrlVGNaF1T3x2QFb3SR5Q4v8p2u1j0zqktkYTZ693gHYzkjWuyGk
-W/MyhtG1cE7knxu/no+HBw==
------END SIGNATURE-----
-directory-signature sha256 585769C78764D58426B8B52B6651A5A71137189A 02958C9BE542EEA43130E54FE6634B6E874B196D
------BEGIN SIGNATURE-----
-XAZPIaIQSTj+8QWZm5dAtiQz2CnEeuM7WMcJikol7CL53n1ewG6k6vYgtFPCJ5uh
-EDGTM4eojUB0VXNpc+jeOv207Y5z2r6tjAknr1eMxPX65z2BT4WkeBZLnc68RRrM
-LUAe2IbOVeaqTnQmPAtSejO8xxIkJhfZAssrxdLtvagCpkcBYwAbHiVtYWv/G+r0
-pyqVzvxIaEoEFShe77bJqfjOnlLOgcTsxdmU3qcDad/5k8ewXfLVcqR8YsjoNF9D
-9xbHyqkBZs0EfcNoDhqWsbuq184zMjlSH0Q3QElK/0ZoQQ1y6vlSicKM9rl8vxmf
-hRx2hnKyx+yhBT4fpL22ew==
------END SIGNATURE-----
-directory-signature sha256 80550987E1D626E3EBA5E5E75A458DE0626D088C 7C5D0700D9C266B7D3F93E7C904A62FEC6B30A60
------BEGIN SIGNATURE-----
-WwrdpjcjuzxmV+E1ULuuFo98nMiN0iMw6MLAs7+kuOdjbW+ayKzizZvnDPjlMv1p
-2cJM7qAwnD6aSxzn1wpc0ecdaVae1cMYqEnP3BxFFY9Xh4dxu8JdlNhB7W3rlIva
-lptekvZQnRBb2J4ULws4455AP6oNTCO9x3UpGNd5tbc=
------END SIGNATURE-----
-directory-signature sha256 D586D18309DED4CD6D57C18FDB97EFA96D330566 F1E67374A96F51A0BB4C8C24748200885EFF8645
------BEGIN SIGNATURE-----
-fgn1RZSa2xtYrOiG9YUtQdPl9RMZ8YQsxImg7D53AoXrctC8Ul48CNnIz/JWdIts
-qcczwUtSSixuEDD5gqBcFn0Fi7S1E2F8VcmCUAh7AMBtVSn5vUKkmaQcSy+zG0N+
-ospb0wQYbJ2DcsVTqL9z4TLpNB09BLN0kOzS64MJAqH9thE/1GHGNeXRFHupYgTO
-PERdyFvFEAmS9XnSxSRitgf6ptG5sAlFbzQrueKmnlrVe51gJBTEZNgVb1wFTjEw
-7nHTvTz9c0AQfgW5if1nIh2RdQ9AeOo3FxCbFMeT53QzHiEZWSDsCZebE/EHf/lz
-od6P497tWLK6TIxctbWAXw==
------END SIGNATURE-----
-directory-signature sha256 E8A9C45EDE6D711294FADF8E7951F4DE6CA56B58 292252D59020B903943C025D96134575E1245ADF
------BEGIN SIGNATURE-----
-LzZynAMcx4EWSAqaXRaL2iHCET9T+T8e15kDiPyefxTc5U00Ko6ASKJPpmaHHHAI
-SsYQm54TauFX7AOb7Q+9Fx8ujxA0AR85DglLXftAicM27L48E4d9E3qFtzi+0ZHs
-At0Wp9odW7ZeFcBNHWFGB/KfqOwHYkukRvqR3vBlKG8nvQ7cC+9o9aXhl4CLoA8X
-ViigiEINXCC1BFibg/XA/XZqDB7uxoeazririKp0qZTTZPp8sLSQBnrSvA3OL1I5
-c0m4xogooiG+YhGBC7N+MR+hDA9nyV+njVABpy/89/6Zy+y4iydqqO0qSRWXio9W
-3T36ECUvEQ9l+FONnfk0cQ==
------END SIGNATURE-----
-directory-signature sha256 ED03BB616EB2F60BEC80151114BB25CEF515B226 5E04DFE1E5E0852F56E524B7C81D1E5FAFDBA650
------BEGIN SIGNATURE-----
-UtcSi7Qb7CijqBhpMsFeqlhRxMTOGqldmdiDCp8ZLJFOCQGIHA9m9c62mlTIleDH
-iz/LdCn7RdGm7VoX7+jd3FfU86dajnyREDcwvvTHZ8eIUx6Bz+Q7zmv6yRBctmNL
-hqYcK0WHxmELYxwICljLPeu6QOaRE+4Ku1YbNoEFL/YJ4GmgAPODxxy35N+t3uRr
-MzWK7N+Ssdo0cRvz47cMBZqRQOKzn3a5/KMnRcBmZbhmJbhi5O9C3tZVA+XFa3fF
-jRGbtUir/OE23WmykdXKGmsymXX3b/io+w6UQjBUVzGHQtJLszMTKNE24eUnVOFD
-9Yc8aj5LgGkmJbNxyiF0mQ==
------END SIGNATURE-----
-directory-signature sha256 EFCBE720AB3A82B99F9E953CD5BF50F7EEFC7B97 F22B7C6FB4E6DA30A3C63D265A1D4AB374CB34E3
------BEGIN SIGNATURE-----
-uh/7AVwA+T8EWm9GgQxYzPPBibvb2/FP5Ny6p9x95oJRWjWeKEM77hnojJ540N6u
-IyyIJTUB5JgUrsN2BXEnyUqZu0+OWB9hYxFIzVjwUxtuL2uaPeBfXqv5iJNEqG9w
-Gl1ubnFUbVZXM83e61ClgwaswhvVPzfgirqpmD+L9m/DaZj+EmzZtoquqaBNtv1g
-qU/yZgFG4AFApjvSaP6kkttZ8EYTVtGMq6muIxLeBDlVRP2dmC+R5FwGmsbj92is
-uxaCO4raz5BM6yyDS44vzJwFePOyQhiYNV52g8dod/xtrhZOlWQtCbX3jXxv4ofV
-nfX9MJA9VJ5WbLSpwU1p/w==
------END SIGNATURE-----
diff --git a/test/unit/descriptor/data/extrainfo_nonascii_v3_reqs b/test/unit/descriptor/data/extrainfo_nonascii_v3_reqs
deleted file mode 100644
index c69d59e..0000000
--- a/test/unit/descriptor/data/extrainfo_nonascii_v3_reqs
+++ /dev/null
@@ -1,30 +0,0 @@
-extra-info newton C871C91489886D5E2E94C13EA1A5FDC4B6DC5204
-identity-ed25519
------BEGIN ED25519 CERT-----
-AQQABjBoAS6cmIIt3t0HjlInkuk+asDf7yAuTXhg20Gdy4uesKH3AQAgBAC6lLwz
-7+yzoMFGDKic6l7kOjyGlV3H01GWtErUWy0PIquP5kMVHnrvdhsBwX0zwSA19Bo+
-tdKPIKrMV+89QBGX2KSa7RRXqIdnGBnGdodglrvMFPGgO/LYHOb9YogFJgA=
------END ED25519 CERT-----
-published 2016-03-26 07:47:53
-write-history 2016-03-26 05:42:08 (14400 s) 682447872,1737454592,1207077888,1278699520,1157439488,635725824
-read-history 2016-03-26 05:42:08 (14400 s) 672482304,1680056320,1198174208,1233503232,1105783808,620540928
-dirreq-write-history 2016-03-26 05:42:08 (14400 s) 1960960,46080,2144256,218112,737280,3273728
-dirreq-read-history 2016-03-26 05:42:08 (14400 s) 322560,13312,323584,8192,46080,440320
-geoip-db-digest 6346E26E2BC96F8511588CE2695E9B0339A75D32
-geoip6-db-digest 43CCB43DBC653D8CC16396A882C5F116A6004F0C
-dirreq-stats-end 2016-03-25 19:53:29 (86400 s)
-dirreq-v3-ips us=8
-dirreq-v3-reqs Sÿ=4026597208,Sÿ=4026597208,Sÿ=4026597208,Sÿ=4026597208,Sÿ=4026597208,Sÿ=4026597208,¥þ=4026591624,6=4026537520,6=4026537520,6=4026537520,us=8
-dirreq-v3-resp ok=8,not-enough-sigs=0,unavailable=0,not-found=0,not-modified=0,busy=0
-dirreq-v3-direct-dl complete=0,timeout=0,running=0
-dirreq-v3-tunneled-dl complete=8,timeout=4,running=0
-hidserv-stats-end 2016-03-25 19:53:29 (86400 s)
-hidserv-rend-relayed-cells 5238 delta_f=2048 epsilon=0.30 bin_size=1024
-hidserv-dir-onions-seen -21 delta_f=8 epsilon=0.30 bin_size=8
-router-sig-ed25519 TeDQDiRfI/k31H+fxciE8q02/ddm/qIi4H7wpQ9A8wRwWBoFUBdwrjZu+pACiglomOuc/I2uSt0++/pmZulZDg
-router-signature
------BEGIN SIGNATURE-----
-OVkz0CKUwWSXjhUMEsYATzcfT+D24QR8w6IjUtb6Mcz5P5CMggqmSFhL6SzUFXWS
-JwipCWcd2/1NsJ7/JLyXKcG0Ak6FPNP3arweah8EwWkVo7rvscagI+u+Uq2FqtO/
-OTNjnriDWTZdSA9FOcQueBZi7Qf7xwA0LEjtadtCjUI=
------END SIGNATURE-----
diff --git a/test/unit/descriptor/data/new_metrics_type b/test/unit/descriptor/data/new_metrics_type
deleted file mode 100644
index 95bd669..0000000
--- a/test/unit/descriptor/data/new_metrics_type
+++ /dev/null
@@ -1,3 +0,0 @@
-@type non-existant-type 1.0
-valid metrics header, but a type we shouldn't recognize
-
diff --git a/test/unit/descriptor/data/riddle b/test/unit/descriptor/data/riddle
deleted file mode 100644
index ac08f36..0000000
--- a/test/unit/descriptor/data/riddle
+++ /dev/null
@@ -1,20 +0,0 @@
-Riddle by Damian Johnson (May, 2009)
-
-Curtains raise, they take the stage,
- mute actors that never age.
-The clouds are cotton, the floor is pine,
- the souls bound up in fine twine.
-
-Crowds will cheer, the players dance,
- flowing scene to scene as in a trance.
-The world is perfect, they never whine,
- for there's not a single will, save mine.
-
-The play has ended, we take a bow,
- but the viewers are the actors now.
-When freed from decision, of thought and blame,
- we'll walk to another drum just the same.
-
-answer:
-http://www.atagar.com/riddles/answer10.php
-
diff --git a/test/unit/descriptor/data/tiny.png b/test/unit/descriptor/data/tiny.png
deleted file mode 100644
index e86715f..0000000
Binary files a/test/unit/descriptor/data/tiny.png and /dev/null differ
diff --git a/test/unit/descriptor/data/unparseable/cached-microdesc-consensus_with_carriage_returns b/test/unit/descriptor/data/unparseable/cached-microdesc-consensus_with_carriage_returns
new file mode 100644
index 0000000..7fd7d3f
--- /dev/null
+++ b/test/unit/descriptor/data/unparseable/cached-microdesc-consensus_with_carriage_returns
@@ -0,0 +1,140 @@
+network-status-version 3 microdesc
+vote-status consensus
+consensus-method 20
+valid-after 2015-09-15 18:00:00
+fresh-until 2015-09-15 19:00:00
+valid-until 2015-09-15 21:00:00
+voting-delay 300 300
+client-versions 0.2.4.23,0.2.4.24,0.2.4.25,0.2.4.26,0.2.4.27,0.2.5.8-rc,0.2.5.9-rc,0.2.5.10,0.2.5.11,0.2.5.12,0.2.6.5-rc,0.2.6.6,0.2.6.7,0.2.6.8,0.2.6.9,0.2.6.10,0.2.7.1-alpha,0.2.7.2-alpha
+server-versions 0.2.4.23,0.2.4.24,0.2.4.25,0.2.4.26,0.2.4.27,0.2.5.8-rc,0.2.5.9-rc,0.2.5.10,0.2.5.11,0.2.5.12,0.2.6.5-rc,0.2.6.6,0.2.6.7,0.2.6.8,0.2.6.9,0.2.6.10,0.2.7.1-alpha,0.2.7.2-alpha
+known-flags Authority BadExit Exit Fast Guard HSDir Running Stable V2Dir Valid
+params CircuitPriorityHalflifeMsec=30000 NumDirectoryGuards=3 NumEntryGuards=1 NumNTorsPerTAP=100 Support022HiddenServices=0 UseNTorHandshake=1 UseOptimisticData=1 bwauthpid=1 cbttestfreq=1000 pb_disablepct=0 usecreatefast=0
+dir-source tor26 14C131DFC5C6F93646BE72FA1401C02A8DF2E8B4 86.59.21.38 86.59.21.38 80 443
+contact Peter Palfrader
+vote-digest 7DD2661BBBA3E600CB9D641CFFF27D14D77EDCCE
+dir-source longclaw 23D15D965BC35114467363C165C4F724B64B4F66 longclaw.riseup.net 199.254.238.52 80 443
+contact Riseup Networks <collective at riseup dot net> - 1nNzekuHGGzBYRzyjfjFEfeisNvxkn4RT
+vote-digest 2EBB0C5EFEFE51ECE8C630A45F607201491D7E09
+dir-source maatuska 49015F787433103580E3B66A1707A00E60F2D15B 171.25.193.9 171.25.193.9 443 80
+contact 4096R/23291265 Linus Nordberg <linus@xxxxxxxxxxx>
+vote-digest 7FC1487C8D7C810C6FA8037AE6EC81ACECC408B8
+dir-source dannenberg 585769C78764D58426B8B52B6651A5A71137189A dannenberg.torauth.de 193.23.244.244 80 443
+contact Andreas Lehner <ops@xxxxxxxxxx>
+vote-digest 32F82FE133ADAAED686A7360297C56B327994799
+dir-source urras 80550987E1D626E3EBA5E5E75A458DE0626D088C 208.83.223.34 208.83.223.34 443 80
+contact 4096R/D255D3F5C868227F Jacob Appelbaum <jacob@xxxxxxxxxxxxx>
+vote-digest 86348CCEC68457D5C1777978D1043B211FA44010
+dir-source moria1 D586D18309DED4CD6D57C18FDB97EFA96D330566 128.31.0.34 128.31.0.34 9131 9101
+contact 1024D/28988BF5 arma mit edu
+vote-digest 9D18B15C2C039CB0B18B51496F8ACBDA2836DE19
+dir-source dizum E8A9C45EDE6D711294FADF8E7951F4DE6CA56B58 194.109.206.212 194.109.206.212 80 443
+contact 1024R/8D56913D Alex de Joode <adejoode@xxxxxxxxxxxx>
+vote-digest 5473986DC071B8840F9E8C72AED3251B71A8244F
+dir-source gabelmoo ED03BB616EB2F60BEC80151114BB25CEF515B226 131.188.40.189 131.188.40.189 80 443
+contact 4096R/261C5FBE77285F88FB0C343266C8C2D7C5AA446D Sebastian Hahn <tor@xxxxxxxxxxxxxxxxx> - 12NbRAjAG5U3LLWETSF7fSTcdaz32Mu5CN
+vote-digest 6EF25161284DB1AD19411EBF52E96927DFD66F0C
+dir-source Faravahar EFCBE720AB3A82B99F9E953CD5BF50F7EEFC7B97 154.35.175.225 154.35.175.225 80 443
+contact 0x0B47D56D Sina Rabbani (inf0) <sina redteam net>
+vote-digest 76466BEF6525FCEE0B9FDDB205B527CBB89FAB17
+r PDrelay1 AAFJ5u9xAqrKlpDW6N0pMhJLlKs 2015-09-15 04:53:47 95.215.44.189 8080 0
+m iH2s4cVPTmThmmx1phnjDd6oGpHAEP7FDK38AFYRV74
+s Fast Running Stable Valid
+v Tor 0.2.7.2-alpha-dev
+w Bandwidth=456
+r seele AAoQ1DAR6kkoo19hBAX5K0QztNw 2015-09-15 04:43:45 73.15.150.172 9001 0
+m LqTE9J4jxtMVm2IPDxmUKYyrzajcjqwYqLkX6JNOEpY
+s Fast Running Stable Valid
+v Tor 0.2.6.10
+w Bandwidth=15
+r TorNinurtaName AA8YrCza5McQugiY3J4h5y4BF9g 2015-09-15 17:06:16 151.236.6.198 443 80
+m YxghdOEPO/uPv0N1GZV+6gCuYR5NZPaDseU45R/Yyns
+s Fast HSDir Running Stable V2Dir Valid
+v Tor 0.2.6.10
+w Bandwidth=1750
+r CalyxInstitute14 ABG9JIWtRdmE7EFZyI/AZuXjMA4 2015-09-15 16:12:03 162.247.72.201 443 80
+m 6PnpSoAVS1oaJCqs4uk8y706JSZ6rdN8uUM78Oohgo0
+s Exit Fast Guard HSDir Running Stable V2Dir Valid
+v Tor 0.2.6.10
+w Bandwidth=11400
+directory-footer
+bandwidth-weights Wbd=0 Wbe=0 Wbg=3944 Wbm=10000 Wdb=10000 Web=10000 Wed=10000 Wee=10000 Weg=10000 Wem=10000 Wgb=10000 Wgd=0 Wgg=6056 Wgm=6056 Wmb=10000 Wmd=0 Wme=0 Wmg=3944 Wmm=10000
+directory-signature sha256 14C131DFC5C6F93646BE72FA1401C02A8DF2E8B4 0B49FD2F55D02B630E7A500E34FD5B6F98FDA9D2
+-----BEGIN SIGNATURE-----
+OYThM95E2Pcj4RWZeND9+llOUlyHLwGtHqF+n92xKTsZdc7ogigEosdqVEB1GaeJ
+D/GWSESN9VLEiiw5VKBG4UVvZUaFVRUnZSJVS4gNgckH5LD0VUJb0C/tIeBHJ7ea
+cTOwsb0vHau/W8hkAciEWLfjmAtcWutdT6lljSJ65NWyZynDPHTmtKnsB65kKT+2
+p5W9GBxnMUH+Pnt2JkFqyKAsE8GgppMuk4O+AX+BtQgzK4K+pTcKFko6e/NmrBh3
+W6AV/fR9/PdSUNYb6+uH/LsUhVePFVbke44u6bBN39LkvxWErQdd3yA91lUdqwz8
+zR/uAngvj05Bt1zmH9eG1Kd02dgL4PqNmTI0VKZjWamf4k/xMmecU0xfrHLv52Rw
+/hync6FsEIrfI+B942sjIEGfv+T6UuIMNoMvkwrby6nw6WL7lAoJJq5pyBYLzlFj
+xLW6e567FFjqf4siHpGCzWCHoXUU+NmygDSakh0orgGoHdVW6JcKbs0QieUyUu+X
+-----END SIGNATURE-----
+directory-signature sha256 23D15D965BC35114467363C165C4F724B64B4F66 3C12B8EE0B3DC3AEDD8CD27CCB02C564281BE765
+-----BEGIN SIGNATURE-----
+doESbeqw4jQagxP8o0Yr6VVUdB2Hnmct4F5sH1pBntPYOqIeT3GbYuFT1TdYr9SG
+xSpI5+aRcbSQrKryvF+qSgOJS4131YuCmL7zlwhQrQcFtltyRS8UTopubrLbvAJ1
+njJt05lM8NWg6NN3uZ4Zy4L/qzn9qZB9l8WbxKZJnxott6+Rp1H19tsl77ENB4GJ
+Bfhc9C46LOKUfmV5IB0f+0nFOO3PDhbRFEcDw5EEGPx6xLk+EH9YHvP98VIY/YPi
+vtYN9G5G2PplvqG4hyIhGAYy/hm3ZTHf9eIsKvsBgHadBeFCupA/l6tf36nK94Ts
+d68QhqPo8QhrjM5FTddGOA==
+-----END SIGNATURE-----
+directory-signature sha256 49015F787433103580E3B66A1707A00E60F2D15B 2467B90267EEEDDD614694F16A523B0E6EBF6FAA
+-----BEGIN SIGNATURE-----
+NVXfCo512TGvfHr+9XB7nVTDMRurSlwrz/vHfXjSzmJ/6dbIK6PA98lBgvX3i83N
+2AZoUcIc5wasYjUleRrP4k2jn5sBArCr3g64FsZ4/RJMLg2pWxEw4xDY2DLjKpyZ
+BfndyOG5KSEtIszXw0szS0kkTyz7oI76L1vu016Mh35YjaeqK0Vu+P2gxJtKxNyt
+pLPZwTWVQfjqLAebtXD2Bi5Csty7TSAhsNe9KE5pUB7+DyzvbamuJzyhUFbuOgii
+Y1nguoknHVgHnrlVGNaF1T3x2QFb3SR5Q4v8p2u1j0zqktkYTZ693gHYzkjWuyGk
+W/MyhtG1cE7knxu/no+HBw==
+-----END SIGNATURE-----
+directory-signature sha256 585769C78764D58426B8B52B6651A5A71137189A 02958C9BE542EEA43130E54FE6634B6E874B196D
+-----BEGIN SIGNATURE-----
+XAZPIaIQSTj+8QWZm5dAtiQz2CnEeuM7WMcJikol7CL53n1ewG6k6vYgtFPCJ5uh
+EDGTM4eojUB0VXNpc+jeOv207Y5z2r6tjAknr1eMxPX65z2BT4WkeBZLnc68RRrM
+LUAe2IbOVeaqTnQmPAtSejO8xxIkJhfZAssrxdLtvagCpkcBYwAbHiVtYWv/G+r0
+pyqVzvxIaEoEFShe77bJqfjOnlLOgcTsxdmU3qcDad/5k8ewXfLVcqR8YsjoNF9D
+9xbHyqkBZs0EfcNoDhqWsbuq184zMjlSH0Q3QElK/0ZoQQ1y6vlSicKM9rl8vxmf
+hRx2hnKyx+yhBT4fpL22ew==
+-----END SIGNATURE-----
+directory-signature sha256 80550987E1D626E3EBA5E5E75A458DE0626D088C 7C5D0700D9C266B7D3F93E7C904A62FEC6B30A60
+-----BEGIN SIGNATURE-----
+WwrdpjcjuzxmV+E1ULuuFo98nMiN0iMw6MLAs7+kuOdjbW+ayKzizZvnDPjlMv1p
+2cJM7qAwnD6aSxzn1wpc0ecdaVae1cMYqEnP3BxFFY9Xh4dxu8JdlNhB7W3rlIva
+lptekvZQnRBb2J4ULws4455AP6oNTCO9x3UpGNd5tbc=
+-----END SIGNATURE-----
+directory-signature sha256 D586D18309DED4CD6D57C18FDB97EFA96D330566 F1E67374A96F51A0BB4C8C24748200885EFF8645
+-----BEGIN SIGNATURE-----
+fgn1RZSa2xtYrOiG9YUtQdPl9RMZ8YQsxImg7D53AoXrctC8Ul48CNnIz/JWdIts
+qcczwUtSSixuEDD5gqBcFn0Fi7S1E2F8VcmCUAh7AMBtVSn5vUKkmaQcSy+zG0N+
+ospb0wQYbJ2DcsVTqL9z4TLpNB09BLN0kOzS64MJAqH9thE/1GHGNeXRFHupYgTO
+PERdyFvFEAmS9XnSxSRitgf6ptG5sAlFbzQrueKmnlrVe51gJBTEZNgVb1wFTjEw
+7nHTvTz9c0AQfgW5if1nIh2RdQ9AeOo3FxCbFMeT53QzHiEZWSDsCZebE/EHf/lz
+od6P497tWLK6TIxctbWAXw==
+-----END SIGNATURE-----
+directory-signature sha256 E8A9C45EDE6D711294FADF8E7951F4DE6CA56B58 292252D59020B903943C025D96134575E1245ADF
+-----BEGIN SIGNATURE-----
+LzZynAMcx4EWSAqaXRaL2iHCET9T+T8e15kDiPyefxTc5U00Ko6ASKJPpmaHHHAI
+SsYQm54TauFX7AOb7Q+9Fx8ujxA0AR85DglLXftAicM27L48E4d9E3qFtzi+0ZHs
+At0Wp9odW7ZeFcBNHWFGB/KfqOwHYkukRvqR3vBlKG8nvQ7cC+9o9aXhl4CLoA8X
+ViigiEINXCC1BFibg/XA/XZqDB7uxoeazririKp0qZTTZPp8sLSQBnrSvA3OL1I5
+c0m4xogooiG+YhGBC7N+MR+hDA9nyV+njVABpy/89/6Zy+y4iydqqO0qSRWXio9W
+3T36ECUvEQ9l+FONnfk0cQ==
+-----END SIGNATURE-----
+directory-signature sha256 ED03BB616EB2F60BEC80151114BB25CEF515B226 5E04DFE1E5E0852F56E524B7C81D1E5FAFDBA650
+-----BEGIN SIGNATURE-----
+UtcSi7Qb7CijqBhpMsFeqlhRxMTOGqldmdiDCp8ZLJFOCQGIHA9m9c62mlTIleDH
+iz/LdCn7RdGm7VoX7+jd3FfU86dajnyREDcwvvTHZ8eIUx6Bz+Q7zmv6yRBctmNL
+hqYcK0WHxmELYxwICljLPeu6QOaRE+4Ku1YbNoEFL/YJ4GmgAPODxxy35N+t3uRr
+MzWK7N+Ssdo0cRvz47cMBZqRQOKzn3a5/KMnRcBmZbhmJbhi5O9C3tZVA+XFa3fF
+jRGbtUir/OE23WmykdXKGmsymXX3b/io+w6UQjBUVzGHQtJLszMTKNE24eUnVOFD
+9Yc8aj5LgGkmJbNxyiF0mQ==
+-----END SIGNATURE-----
+directory-signature sha256 EFCBE720AB3A82B99F9E953CD5BF50F7EEFC7B97 F22B7C6FB4E6DA30A3C63D265A1D4AB374CB34E3
+-----BEGIN SIGNATURE-----
+uh/7AVwA+T8EWm9GgQxYzPPBibvb2/FP5Ny6p9x95oJRWjWeKEM77hnojJ540N6u
+IyyIJTUB5JgUrsN2BXEnyUqZu0+OWB9hYxFIzVjwUxtuL2uaPeBfXqv5iJNEqG9w
+Gl1ubnFUbVZXM83e61ClgwaswhvVPzfgirqpmD+L9m/DaZj+EmzZtoquqaBNtv1g
+qU/yZgFG4AFApjvSaP6kkttZ8EYTVtGMq6muIxLeBDlVRP2dmC+R5FwGmsbj92is
+uxaCO4raz5BM6yyDS44vzJwFePOyQhiYNV52g8dod/xtrhZOlWQtCbX3jXxv4ofV
+nfX9MJA9VJ5WbLSpwU1p/w==
+-----END SIGNATURE-----
diff --git a/test/unit/descriptor/data/unparseable/extrainfo_nonascii_v3_reqs b/test/unit/descriptor/data/unparseable/extrainfo_nonascii_v3_reqs
new file mode 100644
index 0000000..c69d59e
--- /dev/null
+++ b/test/unit/descriptor/data/unparseable/extrainfo_nonascii_v3_reqs
@@ -0,0 +1,30 @@
+extra-info newton C871C91489886D5E2E94C13EA1A5FDC4B6DC5204
+identity-ed25519
+-----BEGIN ED25519 CERT-----
+AQQABjBoAS6cmIIt3t0HjlInkuk+asDf7yAuTXhg20Gdy4uesKH3AQAgBAC6lLwz
+7+yzoMFGDKic6l7kOjyGlV3H01GWtErUWy0PIquP5kMVHnrvdhsBwX0zwSA19Bo+
+tdKPIKrMV+89QBGX2KSa7RRXqIdnGBnGdodglrvMFPGgO/LYHOb9YogFJgA=
+-----END ED25519 CERT-----
+published 2016-03-26 07:47:53
+write-history 2016-03-26 05:42:08 (14400 s) 682447872,1737454592,1207077888,1278699520,1157439488,635725824
+read-history 2016-03-26 05:42:08 (14400 s) 672482304,1680056320,1198174208,1233503232,1105783808,620540928
+dirreq-write-history 2016-03-26 05:42:08 (14400 s) 1960960,46080,2144256,218112,737280,3273728
+dirreq-read-history 2016-03-26 05:42:08 (14400 s) 322560,13312,323584,8192,46080,440320
+geoip-db-digest 6346E26E2BC96F8511588CE2695E9B0339A75D32
+geoip6-db-digest 43CCB43DBC653D8CC16396A882C5F116A6004F0C
+dirreq-stats-end 2016-03-25 19:53:29 (86400 s)
+dirreq-v3-ips us=8
+dirreq-v3-reqs Sÿ=4026597208,Sÿ=4026597208,Sÿ=4026597208,Sÿ=4026597208,Sÿ=4026597208,Sÿ=4026597208,¥þ=4026591624,6=4026537520,6=4026537520,6=4026537520,us=8
+dirreq-v3-resp ok=8,not-enough-sigs=0,unavailable=0,not-found=0,not-modified=0,busy=0
+dirreq-v3-direct-dl complete=0,timeout=0,running=0
+dirreq-v3-tunneled-dl complete=8,timeout=4,running=0
+hidserv-stats-end 2016-03-25 19:53:29 (86400 s)
+hidserv-rend-relayed-cells 5238 delta_f=2048 epsilon=0.30 bin_size=1024
+hidserv-dir-onions-seen -21 delta_f=8 epsilon=0.30 bin_size=8
+router-sig-ed25519 TeDQDiRfI/k31H+fxciE8q02/ddm/qIi4H7wpQ9A8wRwWBoFUBdwrjZu+pACiglomOuc/I2uSt0++/pmZulZDg
+router-signature
+-----BEGIN SIGNATURE-----
+OVkz0CKUwWSXjhUMEsYATzcfT+D24QR8w6IjUtb6Mcz5P5CMggqmSFhL6SzUFXWS
+JwipCWcd2/1NsJ7/JLyXKcG0Ak6FPNP3arweah8EwWkVo7rvscagI+u+Uq2FqtO/
+OTNjnriDWTZdSA9FOcQueBZi7Qf7xwA0LEjtadtCjUI=
+-----END SIGNATURE-----
diff --git a/test/unit/descriptor/data/unparseable/new_metrics_type b/test/unit/descriptor/data/unparseable/new_metrics_type
new file mode 100644
index 0000000..95bd669
--- /dev/null
+++ b/test/unit/descriptor/data/unparseable/new_metrics_type
@@ -0,0 +1,3 @@
+@type non-existant-type 1.0
+valid metrics header, but a type we shouldn't recognize
+
diff --git a/test/unit/descriptor/data/unparseable/riddle b/test/unit/descriptor/data/unparseable/riddle
new file mode 100644
index 0000000..ac08f36
--- /dev/null
+++ b/test/unit/descriptor/data/unparseable/riddle
@@ -0,0 +1,20 @@
+Riddle by Damian Johnson (May, 2009)
+
+Curtains raise, they take the stage,
+ mute actors that never age.
+The clouds are cotton, the floor is pine,
+ the souls bound up in fine twine.
+
+Crowds will cheer, the players dance,
+ flowing scene to scene as in a trance.
+The world is perfect, they never whine,
+ for there's not a single will, save mine.
+
+The play has ended, we take a bow,
+ but the viewers are the actors now.
+When freed from decision, of thought and blame,
+ we'll walk to another drum just the same.
+
+answer:
+http://www.atagar.com/riddles/answer10.php
+
diff --git a/test/unit/descriptor/data/unparseable/tiny.png b/test/unit/descriptor/data/unparseable/tiny.png
new file mode 100644
index 0000000..e86715f
Binary files /dev/null and b/test/unit/descriptor/data/unparseable/tiny.png differ
diff --git a/test/unit/descriptor/data/unparseable/vote b/test/unit/descriptor/data/unparseable/vote
new file mode 100644
index 0000000..ac2a6fc
--- /dev/null
+++ b/test/unit/descriptor/data/unparseable/vote
@@ -0,0 +1,100 @@
+network-status-version 3
+vote-status vote
+consensus-methods 1 2 3 4 5 6 7 8 9 10 11 12
+published 2012-07-11 23:50:01
+valid-after 2012-07-12 00:00:00
+fresh-until 2012-07-12 01:00:00
+valid-until 2012-07-12 03:00:00
+voting-delay 300 300
+known-flags Authority BadExit Exit Fast Guard HSDir Running Stable V2Dir Valid
+params CircuitPriorityHalflifeMsec=30000 bwauthpid=1
+dir-source turtles 27B6B5996C426270A5C95488AA5BCEB6BCC86956 76.73.17.194 76.73.17.194 9030 9090
+contact Mike Perry <email>
+dir-key-certificate-version 3
+fingerprint 27B6B5996C426270A5C95488AA5BCEB6BCC86956
+dir-key-published 2011-11-28 21:51:04
+dir-key-expires 2012-11-28 21:51:04
+dir-identity-key
+-----BEGIN RSA PUBLIC KEY-----
+MIIBigKCAYEA6uSmsoxj2MiJ3qyZq0qYXlRoG8o82SNqg+22m+t1c7MlQOZWPJYn
+XeMcBCt8xrTeIt2ZI+Q/Kt2QJSeD9WZRevTKk/kn5Tg2+xXPogalUU47y5tUohGz
++Q8+CxtRSXpDxBHL2P8rLHvGrI69wbNHGoQkce/7gJy9vw5Ie2qzbyXk1NG6V8Fb
+pr6A885vHo6TbhUnolz2Wqt/kN+UorjLkN2H3fV+iGcQFv42SyHYGDLa0WwL3PJJ
+r/veu36S3VaHBrfhutfioi+d3d4Ya0bKwiWi5Lm2CHuuRTgMpHLU9vlci8Hunuxq
+HsULe2oMsr4VEic7sW5SPC5Obpx6hStHdNv1GxoSEm3/vIuPM8pINpU5ZYAyH9yO
+Ef22ZHeiVMMKmpV9TtFyiFqvlI6GpQn3mNbsQqF1y3XCA3Q4vlRAkpgJVUSvTxFP
+2bNDobOyVCpCM/rwxU1+RCNY5MFJ/+oktUY+0ydvTen3gFdZdgNqCYjKPLfBNm9m
+RGL7jZunMUNvAgMBAAE=
+-----END RSA PUBLIC KEY-----
+dir-signing-key
+-----BEGIN RSA PUBLIC KEY-----
+MIGJAoGBAJ5itcJRYNEM3Qf1OVWLRkwjqf84oXPc2ZusaJ5zOe7TVvBMra9GNyc0
+NM9y6zVkHCAePAjr4KbW/8P1olA6FUE2LV9bozaU1jFf6K8B2OELKs5FUEW+n+ic
+GM0x6MhngyXonWOcKt5Gj+mAu5lrno9tpNbPkz2Utr/Pi0nsDhWlAgMBAAE=
+-----END RSA PUBLIC KEY-----
+dir-key-crosscert
+-----BEGIN ID SIGNATURE-----
+RHYImGTwg36wmEdAn7qaRg2sAfql7ZCtPIL/O3lU5OIdXXp0tNn/K00Bamqohjk+
+Tz4FKsKXGDlbGv67PQcZPOK6NF0GRkNh4pk89prrDO4XwtEn7rkHHdBH6/qQ7IRG
+GdDZHtZ1a69oFZvPWD3hUaB50xeIe7GoKdKIfdNNJ+8=
+-----END ID SIGNATURE-----
+dir-key-certification
+-----BEGIN SIGNATURE-----
+fasWOGyUZ3iMCYpDfJ+0JcMiTH25sXPWzvlHorEOyOMbaMqRYpZU4GHzt1jLgdl6
+AAoR6KdamsLg5VE8xzst48a4UFuzHFlklZ5O8om2rcvDd5DhSnWWYZnYJecqB+bo
+dNisPmaIVSAWb29U8BpNRj4GMC9KAgGYUj8aE/KtutAeEekFfFEHTfWZ2fFp4j3m
+9rY8FWraqyiF+Emq1T8pAAgMQ+79R3oZxq0TXS42Z4Anhms735ccauKhI3pDKjbl
+tD5vAzIHOyjAOXj7a6jY/GrnaBNuJ4qe/4Hf9UmzK/jKKwG95BPJtPTT4LoFwEB0
+KG2OUeQUNoCck4nDpsZwFqPlrWCHcHfTV2iDYFV1HQWDTtZz/qf+GtB8NXsq+I1w
+brADmvReM2BD6p/13h0QURCI5hq7ZYlIKcKrBa0jn1d9cduULl7vgKsRCJDls/ID
+emBZ6pUxMpBmV0v+PrA3v9w4DlE7GHAq61FF/zju2kpqj6MInbEvI/E+e438sWsL
+-----END SIGNATURE-----
+r sumkledi ABPSI4nNUNC3hKPkBhyzHozozrU B5n4BiALAF8B5AqafxohyYiuj7E 2012-07-11 04:22:53 178.218.213.229 80 0
+s Exit Valid
+opt v Tor 0.2.2.35
+w Bandwidth=51 Measured=36
+p accept 80,443
+m 8,9,10,11,12 sha256=g1vx9si329muxV3tquWIXXySNOIwRGMeAESKs/v4DWs
+r Unnamed AEXri4INxBAZeyi0wvJZoC58nZs csTseFzwBV0RLsEdlyxDw6jTZ1o 2012-07-11 10:47:26 79.139.135.90 443 22
+s Fast HSDir Running V2Dir Valid
+opt v Tor 0.2.2.37
+w Bandwidth=92 Measured=15
+p reject 1-65535
+m 8,9,10,11,12 sha256=iZfmvEGdBG/qc9KYZUh4JsWEHbn9Bw2jy5i0AtCoRB0
+r default AFU4pMWKyq+eTPuBO0D9W179kQQ OZzEaq9N5+VX5yxzi051zqyEcPk 2012-07-11 08:17:21 2.90.115.167 443 9030
+s V2Dir Valid
+opt v Tor 0.2.3.15-alpha
+w Bandwidth=53
+p reject 1-65535
+m 8,9,10,11,12 sha256=m/RouK3TqoaYBBHCxgmzMPuGGCIEr0ufSTB1i85zicM
+r satoshi11 AFzRyEo3Ibdko7vl4rReoU3BDfM rWaYhhU9Kym4sXAVe+uE99VGpJs 2012-07-11 08:10:01 80.218.153.44 443 9030
+s V2Dir Valid
+opt v Tor 0.2.2.35
+w Bandwidth=196 Measured=113
+p reject 1-65535
+m 8,9,10,11,12 sha256=yxuOPz7IraIzzmU/qeZRJHOJrutNmvPwDwj2AmsHZSI
+r JapanAnon AGw/p8P246zRPQ3ZsQx9+pM8I3s FpQ4fP9FE2j4AnpZTcPiUbaIjwQ 2012-07-11 15:55:42 220.0.231.71 443 9030
+s Exit V2Dir Valid
+opt v Tor 0.2.2.37
+w Bandwidth=41 Measured=5
+p accept 110,143,443,706,993,995,1863,5050,5190,5222-5223,6660-6669,6697,7000-7001,8300,8888
+m 8,9,10,11,12 sha256=fdV6McsFl7ZaX8YJjRCchKa7B7ImTr6++AE3e7zCkK8
+r ANONIONROUTER AHhuQ8zFQJdT8l42Axxc6m6kNwI UUUhUJVXZ5b+8Lizh1ghVkUTGo0 2012-07-11 20:13:16 93.128.114.184 24051 24052
+s Fast Running V2Dir Valid
+opt v Tor 0.2.2.37
+w Bandwidth=196 Measured=100
+p reject 1-65535
+m 8,9,10,11,12 sha256=ooi27oMS4TBXes4FY4JyULgZYZcFzAyvB1JicaQ8zxs
+r pornosteffi AJrkZLNAIMRi7J3Q5os1iBJTM38 tV2vC76eZNwVpSFO8+r9lCqJSVw 2012-07-11 11:00:29 88.78.83.210 443 0
+s Fast Running Valid
+opt v Tor 0.2.2.35
+w Bandwidth=32 Measured=14
+p reject 1-65535
+m 8,9,10,11,12 sha256=JiARdiiTbey4aLkt4x1DUgEU3oaD2oDB2dtP7SGl3EU
+directory-footer
+directory-signature 27B6B5996C426270A5C95488AA5BCEB6BCC86956 D5C30C15BB3F1DA27669C2D88439939E8F418FCF
+-----BEGIN SIGNATURE-----
+fskXN84wB3mXfo+yKGSt0AcDaaPuU3NwMR3ROxWgLN0KjAaVi2eV9PkPCsQkcgw3
+JZ/1HL9sHyZfo6bwaC6YSM9PNiiY6L7rnGpS7UkHiFI+M96VCMorvjm5YPs3FioJ
+DnN5aFtYKiTc19qIC7Nmo+afPdDEf0MlJvEOP5EWl3w=
+-----END SIGNATURE-----
diff --git a/test/unit/descriptor/data/vote b/test/unit/descriptor/data/vote
deleted file mode 100644
index ac2a6fc..0000000
--- a/test/unit/descriptor/data/vote
+++ /dev/null
@@ -1,100 +0,0 @@
-network-status-version 3
-vote-status vote
-consensus-methods 1 2 3 4 5 6 7 8 9 10 11 12
-published 2012-07-11 23:50:01
-valid-after 2012-07-12 00:00:00
-fresh-until 2012-07-12 01:00:00
-valid-until 2012-07-12 03:00:00
-voting-delay 300 300
-known-flags Authority BadExit Exit Fast Guard HSDir Running Stable V2Dir Valid
-params CircuitPriorityHalflifeMsec=30000 bwauthpid=1
-dir-source turtles 27B6B5996C426270A5C95488AA5BCEB6BCC86956 76.73.17.194 76.73.17.194 9030 9090
-contact Mike Perry <email>
-dir-key-certificate-version 3
-fingerprint 27B6B5996C426270A5C95488AA5BCEB6BCC86956
-dir-key-published 2011-11-28 21:51:04
-dir-key-expires 2012-11-28 21:51:04
-dir-identity-key
------BEGIN RSA PUBLIC KEY-----
-MIIBigKCAYEA6uSmsoxj2MiJ3qyZq0qYXlRoG8o82SNqg+22m+t1c7MlQOZWPJYn
-XeMcBCt8xrTeIt2ZI+Q/Kt2QJSeD9WZRevTKk/kn5Tg2+xXPogalUU47y5tUohGz
-+Q8+CxtRSXpDxBHL2P8rLHvGrI69wbNHGoQkce/7gJy9vw5Ie2qzbyXk1NG6V8Fb
-pr6A885vHo6TbhUnolz2Wqt/kN+UorjLkN2H3fV+iGcQFv42SyHYGDLa0WwL3PJJ
-r/veu36S3VaHBrfhutfioi+d3d4Ya0bKwiWi5Lm2CHuuRTgMpHLU9vlci8Hunuxq
-HsULe2oMsr4VEic7sW5SPC5Obpx6hStHdNv1GxoSEm3/vIuPM8pINpU5ZYAyH9yO
-Ef22ZHeiVMMKmpV9TtFyiFqvlI6GpQn3mNbsQqF1y3XCA3Q4vlRAkpgJVUSvTxFP
-2bNDobOyVCpCM/rwxU1+RCNY5MFJ/+oktUY+0ydvTen3gFdZdgNqCYjKPLfBNm9m
-RGL7jZunMUNvAgMBAAE=
------END RSA PUBLIC KEY-----
-dir-signing-key
------BEGIN RSA PUBLIC KEY-----
-MIGJAoGBAJ5itcJRYNEM3Qf1OVWLRkwjqf84oXPc2ZusaJ5zOe7TVvBMra9GNyc0
-NM9y6zVkHCAePAjr4KbW/8P1olA6FUE2LV9bozaU1jFf6K8B2OELKs5FUEW+n+ic
-GM0x6MhngyXonWOcKt5Gj+mAu5lrno9tpNbPkz2Utr/Pi0nsDhWlAgMBAAE=
------END RSA PUBLIC KEY-----
-dir-key-crosscert
------BEGIN ID SIGNATURE-----
-RHYImGTwg36wmEdAn7qaRg2sAfql7ZCtPIL/O3lU5OIdXXp0tNn/K00Bamqohjk+
-Tz4FKsKXGDlbGv67PQcZPOK6NF0GRkNh4pk89prrDO4XwtEn7rkHHdBH6/qQ7IRG
-GdDZHtZ1a69oFZvPWD3hUaB50xeIe7GoKdKIfdNNJ+8=
------END ID SIGNATURE-----
-dir-key-certification
------BEGIN SIGNATURE-----
-fasWOGyUZ3iMCYpDfJ+0JcMiTH25sXPWzvlHorEOyOMbaMqRYpZU4GHzt1jLgdl6
-AAoR6KdamsLg5VE8xzst48a4UFuzHFlklZ5O8om2rcvDd5DhSnWWYZnYJecqB+bo
-dNisPmaIVSAWb29U8BpNRj4GMC9KAgGYUj8aE/KtutAeEekFfFEHTfWZ2fFp4j3m
-9rY8FWraqyiF+Emq1T8pAAgMQ+79R3oZxq0TXS42Z4Anhms735ccauKhI3pDKjbl
-tD5vAzIHOyjAOXj7a6jY/GrnaBNuJ4qe/4Hf9UmzK/jKKwG95BPJtPTT4LoFwEB0
-KG2OUeQUNoCck4nDpsZwFqPlrWCHcHfTV2iDYFV1HQWDTtZz/qf+GtB8NXsq+I1w
-brADmvReM2BD6p/13h0QURCI5hq7ZYlIKcKrBa0jn1d9cduULl7vgKsRCJDls/ID
-emBZ6pUxMpBmV0v+PrA3v9w4DlE7GHAq61FF/zju2kpqj6MInbEvI/E+e438sWsL
------END SIGNATURE-----
-r sumkledi ABPSI4nNUNC3hKPkBhyzHozozrU B5n4BiALAF8B5AqafxohyYiuj7E 2012-07-11 04:22:53 178.218.213.229 80 0
-s Exit Valid
-opt v Tor 0.2.2.35
-w Bandwidth=51 Measured=36
-p accept 80,443
-m 8,9,10,11,12 sha256=g1vx9si329muxV3tquWIXXySNOIwRGMeAESKs/v4DWs
-r Unnamed AEXri4INxBAZeyi0wvJZoC58nZs csTseFzwBV0RLsEdlyxDw6jTZ1o 2012-07-11 10:47:26 79.139.135.90 443 22
-s Fast HSDir Running V2Dir Valid
-opt v Tor 0.2.2.37
-w Bandwidth=92 Measured=15
-p reject 1-65535
-m 8,9,10,11,12 sha256=iZfmvEGdBG/qc9KYZUh4JsWEHbn9Bw2jy5i0AtCoRB0
-r default AFU4pMWKyq+eTPuBO0D9W179kQQ OZzEaq9N5+VX5yxzi051zqyEcPk 2012-07-11 08:17:21 2.90.115.167 443 9030
-s V2Dir Valid
-opt v Tor 0.2.3.15-alpha
-w Bandwidth=53
-p reject 1-65535
-m 8,9,10,11,12 sha256=m/RouK3TqoaYBBHCxgmzMPuGGCIEr0ufSTB1i85zicM
-r satoshi11 AFzRyEo3Ibdko7vl4rReoU3BDfM rWaYhhU9Kym4sXAVe+uE99VGpJs 2012-07-11 08:10:01 80.218.153.44 443 9030
-s V2Dir Valid
-opt v Tor 0.2.2.35
-w Bandwidth=196 Measured=113
-p reject 1-65535
-m 8,9,10,11,12 sha256=yxuOPz7IraIzzmU/qeZRJHOJrutNmvPwDwj2AmsHZSI
-r JapanAnon AGw/p8P246zRPQ3ZsQx9+pM8I3s FpQ4fP9FE2j4AnpZTcPiUbaIjwQ 2012-07-11 15:55:42 220.0.231.71 443 9030
-s Exit V2Dir Valid
-opt v Tor 0.2.2.37
-w Bandwidth=41 Measured=5
-p accept 110,143,443,706,993,995,1863,5050,5190,5222-5223,6660-6669,6697,7000-7001,8300,8888
-m 8,9,10,11,12 sha256=fdV6McsFl7ZaX8YJjRCchKa7B7ImTr6++AE3e7zCkK8
-r ANONIONROUTER AHhuQ8zFQJdT8l42Axxc6m6kNwI UUUhUJVXZ5b+8Lizh1ghVkUTGo0 2012-07-11 20:13:16 93.128.114.184 24051 24052
-s Fast Running V2Dir Valid
-opt v Tor 0.2.2.37
-w Bandwidth=196 Measured=100
-p reject 1-65535
-m 8,9,10,11,12 sha256=ooi27oMS4TBXes4FY4JyULgZYZcFzAyvB1JicaQ8zxs
-r pornosteffi AJrkZLNAIMRi7J3Q5os1iBJTM38 tV2vC76eZNwVpSFO8+r9lCqJSVw 2012-07-11 11:00:29 88.78.83.210 443 0
-s Fast Running Valid
-opt v Tor 0.2.2.35
-w Bandwidth=32 Measured=14
-p reject 1-65535
-m 8,9,10,11,12 sha256=JiARdiiTbey4aLkt4x1DUgEU3oaD2oDB2dtP7SGl3EU
-directory-footer
-directory-signature 27B6B5996C426270A5C95488AA5BCEB6BCC86956 D5C30C15BB3F1DA27669C2D88439939E8F418FCF
------BEGIN SIGNATURE-----
-fskXN84wB3mXfo+yKGSt0AcDaaPuU3NwMR3ROxWgLN0KjAaVi2eV9PkPCsQkcgw3
-JZ/1HL9sHyZfo6bwaC6YSM9PNiiY6L7rnGpS7UkHiFI+M96VCMorvjm5YPs3FioJ
-DnN5aFtYKiTc19qIC7Nmo+afPdDEf0MlJvEOP5EWl3w=
------END SIGNATURE-----
diff --git a/test/unit/descriptor/reader.py b/test/unit/descriptor/reader.py
index fe9c9e7..51043e2 100644
--- a/test/unit/descriptor/reader.py
+++ b/test/unit/descriptor/reader.py
@@ -315,7 +315,7 @@ class TestDescriptorReader(unittest.TestCase):
with reader:
self.assertTrue(reader.get_buffered_descriptor_count() <= 2)
- time.sleep(0.01)
+ time.sleep(0.001)
self.assertTrue(reader.get_buffered_descriptor_count() <= 2)
def test_persistence_path(self):
@@ -430,7 +430,7 @@ class TestDescriptorReader(unittest.TestCase):
signal.alarm(2)
reader.start()
- time.sleep(0.1)
+ time.sleep(0.001)
reader.stop()
is_test_running = False
@@ -440,20 +440,15 @@ class TestDescriptorReader(unittest.TestCase):
iterating over our test data.
"""
- expected_results = {}
+ desc_path = os.path.join(DESCRIPTOR_TEST_DATA, 'example_descriptor')
+ last_modified = int(os.stat(desc_path).st_mtime)
- for root, _, files in os.walk(DESCRIPTOR_TEST_DATA):
- for filename in files:
- path = os.path.join(root, filename)
- last_modified = int(os.stat(path).st_mtime)
- expected_results[path] = last_modified
-
- reader = stem.descriptor.reader.DescriptorReader(DESCRIPTOR_TEST_DATA)
+ reader = stem.descriptor.reader.DescriptorReader(desc_path)
with reader:
list(reader) # iterates over all of the descriptors
- self.assertEqual(expected_results, reader.get_processed_files())
+ self.assertEqual({desc_path: last_modified}, reader.get_processed_files())
def test_skip_nondescriptor_contents(self):
"""
@@ -462,7 +457,7 @@ class TestDescriptorReader(unittest.TestCase):
"""
skip_listener = SkipListener()
- reader = stem.descriptor.reader.DescriptorReader(DESCRIPTOR_TEST_DATA)
+ reader = stem.descriptor.reader.DescriptorReader(os.path.join(DESCRIPTOR_TEST_DATA, 'unparseable'))
reader.register_skip_listener(skip_listener.listener)
expected_skip_files = ('riddle', 'tiny.png', 'vote', 'new_metrics_type', 'cached-microdesc-consensus_with_carriage_returns', 'extrainfo_nonascii_v3_reqs')
@@ -612,7 +607,7 @@ class TestDescriptorReader(unittest.TestCase):
Parses a file that has a valid metrics header, but an unrecognized type.
"""
- test_path = test.unit.descriptor.get_resource('new_metrics_type')
+ test_path = test.unit.descriptor.get_resource('unparseable/new_metrics_type')
skip_listener = SkipListener()
reader = stem.descriptor.reader.DescriptorReader(test_path)
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits