[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #26902 [Core Tor/Stem]: Download and parse bwauth files
#26902: Download and parse bwauth files
------------------------------------+------------------------
Reporter: atagar | Owner: atagar
Type: enhancement | Status: new
Priority: Medium | Milestone:
Component: Core Tor/Stem | Version:
Severity: Normal | Resolution:
Keywords: descriptor, tor-bwauth | Actual Points:
Parent ID: | Points:
Reviewer: | Sponsor:
------------------------------------+------------------------
Comment (by juga):
It should include a test that do something similar to:
{{{
>>>
... import stem.descriptor
... import stem.descriptor.remote
... import stem.directory
>>> downloader = stem.descriptor.remote.DescriptorDownloader(
... document_handler = stem.descriptor.DocumentHandler.DOCUMENT,
... )
>>> resource = '/tor/status-vote/next/bandwidth'
>>> query_args = {'endpoints': [('127.10.0.1', 2003)]}
>>> bw = downloader.query(resource, **query_args)
>>> bw.content
b'1544811454\nversion=1.2.0\nearliest_bandwidth=2018-12-12T15:02:35\nfile_created=2018-12-15T08:09:48\ngenerator_started=2018-12-15T08:06:50\nlatest_bandwidth=2018-12-14T18:17:34\nminimum_number_eligible_relays=3820\nminimum_percent_eligible_relays=60\nnumber_consensus_relays=6366\nnumber_eligible_relays=0\npercent_eligible_relays=0\nsoftware=sbws\nsoftware_version=1.0.3-dev0\n====='
>>> bw.compression
['identity']
>>> resource = '/tor/status-vote/next/bandwidth.z'
>>> bw = downloader.query(resource, **query_args)
>>> bw.content
b'1544811454\nversion=1.2.0\nearliest_bandwidth=2018-12-12T15:02:35\nfile_created=2018-12-15T08:09:48\ngenerator_started=2018-12-15T08:06:50\nlatest_bandwidth=2018-12-14T18:17:34\nminimum_number_eligible_relays=3820\nminimum_percent_eligible_relays=60\nnumber_consensus_relays=6366\nnumber_eligible_relays=0\npercent_eligible_relays=0\nsoftware=sbws\nsoftware_version=1.0.3-dev0\n====='
>>> bw.compression
['gzip']
}}}
As commented in comment:48:ticket:21377
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/26902#comment:6>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs