tor-commits
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 1 participants
- 216095 discussions
[translation/vidalia_help] Update translations for vidalia_help
by translation@torproject.org 20 Nov '11
by translation@torproject.org 20 Nov '11
20 Nov '11
commit 13d331e4a13fbf10c0280d229b6d52d965fdce4b
Author: Translation commit bot <translation(a)torproject.org>
Date: Sat Nov 19 21:15:26 2011 +0000
Update translations for vidalia_help
---
nl/netview.po | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/nl/netview.po b/nl/netview.po
index 31340cd..40f2b40 100644
--- a/nl/netview.po
+++ b/nl/netview.po
@@ -6,7 +6,7 @@ msgstr ""
"Project-Id-Version: The Tor Project\n"
"Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n"
"POT-Creation-Date: 2010-06-26 17:00+0200\n"
-"PO-Revision-Date: 2011-11-19 20:36+0000\n"
+"PO-Revision-Date: 2011-11-19 20:57+0000\n"
"Last-Translator: Shondoit <shondoit+transifex(a)gmail.com>\n"
"Language-Team: LANGUAGE <LL(a)li.org>\n"
"MIME-Version: 1.0\n"
@@ -97,6 +97,9 @@ msgid ""
"address of the relay in a GeoIP database, created by MaxMind and located at "
"geoip.vidalia-project.net."
msgstr ""
+"De geografische locatie van een Tor relay word bepaald door het IP-adres van"
+" de relay op te zoeken in een GeoIP database, gemaakt door MaxMind en "
+"bevindt zich op geoip.vidalia-project.net."
#. type: Content of: <html><body><p>
#: en/netview.html:55
@@ -110,6 +113,15 @@ msgid ""
" not revealed to the GeoIP relay. The results of the lookups will be cached "
"locally in order to reduce load on Vidalia's GeoIP relays."
msgstr ""
+"In het midden van het dialoogvenster, onder de netwerkmap, zie je een lijst "
+"van je huidige circuits, evenals enig applicatieverkeer momenteel op deze "
+"circuits. Wanneer de netwerkmap voor de eerste keer laadt, zal je "
+"waarschijnlijk een verbinding zien naar geoip.vidalia-project.net, wat "
+"voorkomt wanneer Vidalia geografische informatie voor de lijst met Tor "
+"relays opzoekt. Het is belangrijk om op te merken dat dit verzoek via Tor "
+"gedaan wordt, dus je locatie wordt niet openbaart naar de GeoIP relay. De "
+"resultaten van de zoekactie worden lokaal gecachet om de belasting op "
+"Vidalia's GeoIP relay te verminderen."
#. type: Content of: <html><body>
#: en/netview.html:66
@@ -128,6 +140,10 @@ msgid ""
"Tor network. Next to each relay is an icon indicating that relay's status. "
"The following table summarizes the possible relay status icons:"
msgstr ""
+"Aan de linkerkant van het netwerkoverzicht zie je een lijst met relays in "
+"het tor netwerk. Naast elke relay is een pictogram dat de status van de "
+"relay aangeeft. De volgende tabel somt de mogelijke relay status "
+"pictogrammen op:"
#. type: Content of: <html><body><p><table><tr><td>
#: en/netview.html:78
@@ -194,6 +210,11 @@ msgid ""
" in the list of your current circuits and streams, this panel will show you "
"details about each relay through which your traffic is currently being sent."
msgstr ""
+"De relay detailpanel aan de rechterkant van het scherm geeft je details over"
+" de relay of relays die momenteel in de <a href=\"#relaylist\">relay-"
+"lijst</a> geselecteerd zijn. Als je een circuit of stream geselecteerd hebt "
+"in de lijst met huidige circuits en streams zal dit panel je details geven "
+"over elke relay via welke je verkeer momenteel verstuurd wordt."
#. type: Content of: <html><body><p>
#: en/netview.html:132
1
0
[translation/vidalia_help] Update translations for vidalia_help
by translation@torproject.org 20 Nov '11
by translation@torproject.org 20 Nov '11
20 Nov '11
commit 251cecd77e36204e5a58a41594a488acb18282df
Author: Translation commit bot <translation(a)torproject.org>
Date: Sat Nov 19 20:45:21 2011 +0000
Update translations for vidalia_help
---
nl/netview.po | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/nl/netview.po b/nl/netview.po
index 20e195e..31340cd 100644
--- a/nl/netview.po
+++ b/nl/netview.po
@@ -6,7 +6,7 @@ msgstr ""
"Project-Id-Version: The Tor Project\n"
"Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n"
"POT-Creation-Date: 2010-06-26 17:00+0200\n"
-"PO-Revision-Date: 2011-11-19 19:59+0000\n"
+"PO-Revision-Date: 2011-11-19 20:36+0000\n"
"Last-Translator: Shondoit <shondoit+transifex(a)gmail.com>\n"
"Language-Team: LANGUAGE <LL(a)li.org>\n"
"MIME-Version: 1.0\n"
@@ -48,6 +48,11 @@ msgid ""
"then sent as a <i>stream</i> through that circuit. For efficiency, multiple "
"streams may share the same circuit."
msgstr ""
+"Wanneer je anoniem wilt communiceren via Tor (bijv. verbinden met een "
+"website), creëert Tor een tunnel, of <i>circuit</i>, van versleutelde "
+"verbindingen via een serie van relays in het netwerk. Het verkeer van je "
+"applicatie wordt dan als een <i>stream</i> verstuurd via dat circuit. Voor "
+"efficiëntie kunnen meerdere streams hetzelfde circuit gebruiken."
#. type: Content of: <html><body>
#: en/netview.html:35
@@ -67,6 +72,10 @@ msgid ""
" are drawn between relays to indicate the path of circuits that your Tor "
"client has created through the Tor network."
msgstr ""
+"De netwerkmap bestaat uit een map van de wereld met rode markeringen die de "
+"geografische locaties van de relays in het Tor netwerk aangeven. Groene "
+"lijnen worden getekend tussen de relays om de paden van circuits die je Tor "
+"client gemaakt heeft via het Tor netwerk aan te geven."
#. type: Content of: <html><body><p>
#: en/netview.html:44
@@ -76,6 +85,10 @@ msgid ""
"map by clicking on the map and then dragging it in whatever direction you "
"would like to move the map."
msgstr ""
+"Je kan inzoomen op locaties op de map door op de <b>Zoom in</b> en <b>Zoom "
+"uit</b> knoppen in de werkbalk te klikken. Je kan ook rondscrollen op de map"
+" door op de map te klikken en dan te slepen in de richting waarin je de map "
+"wilt bewegen."
#. type: Content of: <html><body><p>
#: en/netview.html:50
1
0
[translation/vidalia_help] Update translations for vidalia_help
by translation@torproject.org 20 Nov '11
by translation@torproject.org 20 Nov '11
20 Nov '11
commit 3b766d4e7017d7de1f81eba42f7cb7e406679e26
Author: Translation commit bot <translation(a)torproject.org>
Date: Sat Nov 19 20:15:27 2011 +0000
Update translations for vidalia_help
---
nl/netview.po | 67 +++++++++++++++++++++++++++++++++++---------------------
1 files changed, 42 insertions(+), 25 deletions(-)
diff --git a/nl/netview.po b/nl/netview.po
index dba881c..20e195e 100644
--- a/nl/netview.po
+++ b/nl/netview.po
@@ -1,12 +1,13 @@
#
# Translators:
+# Shondoit Walker <shondoit+transifex(a)gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: The Tor Project\n"
"Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n"
"POT-Creation-Date: 2010-06-26 17:00+0200\n"
-"PO-Revision-Date: 2010-11-30 05:03+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"PO-Revision-Date: 2011-11-19 19:59+0000\n"
+"Last-Translator: Shondoit <shondoit+transifex(a)gmail.com>\n"
"Language-Team: LANGUAGE <LL(a)li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -17,7 +18,7 @@ msgstr ""
#. type: Content of: <html><body><h1>
#: en/netview.html:16
msgid "Network Viewer"
-msgstr ""
+msgstr "Netwerkviewer"
#. type: Content of: <html><body><p>
#: en/netview.html:20
@@ -25,16 +26,18 @@ msgid ""
"The network viewer lets you see relays in the Tor network and where your "
"traffic is going."
msgstr ""
+"De netwerkviewer laat je relays zien in het Tor netwerk en waar je verkeer "
+"naar toe gaat."
#. type: Content of: <html><body>
#: en/netview.html:25
msgid "<a name=\"overview\"/>"
-msgstr ""
+msgstr "<a name=\"overview\"/>"
#. type: Content of: <html><body><h3>
#: en/netview.html:26
msgid "Overview"
-msgstr ""
+msgstr "Overzicht"
#. type: Content of: <html><body><p>
#: en/netview.html:28
@@ -49,12 +52,12 @@ msgstr ""
#. type: Content of: <html><body>
#: en/netview.html:35
msgid "<a name=\"netmap\"/>"
-msgstr ""
+msgstr "<a name=\"netmap\"/>"
#. type: Content of: <html><body><h3>
#: en/netview.html:36
msgid "Network Map"
-msgstr ""
+msgstr "Netwerkmap"
#. type: Content of: <html><body><p>
#: en/netview.html:38
@@ -98,12 +101,12 @@ msgstr ""
#. type: Content of: <html><body>
#: en/netview.html:66
msgid "<a name=\"relaylist\"/>"
-msgstr ""
+msgstr "<a name=\"relaylist\"/>"
#. type: Content of: <html><body><h3>
#: en/netview.html:67
msgid "Relay Status"
-msgstr ""
+msgstr "Relaystatus"
#. type: Content of: <html><body><p>
#: en/netview.html:69
@@ -116,7 +119,7 @@ msgstr ""
#. type: Content of: <html><body><p><table><tr><td>
#: en/netview.html:78
msgid "The relay is offline or simply not responding."
-msgstr ""
+msgstr "De relay is offline of reageert niet."
#. type: Content of: <html><body><p><table><tr><td>
#: en/netview.html:84
@@ -124,26 +127,29 @@ msgid ""
"The relay is <i>hibernating</i>, meaning it is online, but has used up as "
"much bandwidth as the operator is willing to allow for a given time period."
msgstr ""
+"De relay is aan het </i>sluimeren</i>, wat inhoudt dat het online is, maar "
+"heeft zoveel bandbreedte gebruikt dat de operator bereidt is toe te staan "
+"voor een bepaalde periode."
#. type: Content of: <html><body><p><table><tr><td>
#: en/netview.html:92
msgid "The relay is online, but has shown only minimal throughput."
-msgstr ""
+msgstr "De relay is online, maar heeft maar minimale doorvoer."
#. type: Content of: <html><body><p><table><tr><td>
#: en/netview.html:98
msgid "The relay is online and has shown a throughput >= 20 KB/s."
-msgstr ""
+msgstr "De relay is online en heeft doorvoer laten zien van >= 20KB/s"
#. type: Content of: <html><body><p><table><tr><td>
#: en/netview.html:104
msgid "The relay is online and has shown a throughput >= 60 KB/s."
-msgstr ""
+msgstr "De relay is online en heeft doorvoer laten zien van >= 60KB/s"
#. type: Content of: <html><body><p><table><tr><td>
#: en/netview.html:110
msgid "The relay is online and has shown a throughput >= 400 KB/s."
-msgstr ""
+msgstr "De relay is online en heeft doorvoer laten zien van >= 400KB/s"
#. type: Content of: <html><body><p>
#: en/netview.html:116
@@ -152,16 +158,19 @@ msgid ""
"maximum bandwidth sustained input or output over any ten second period in "
"the past day."
msgstr ""
+"Alle bandbreedte waardes zijn schattingen gebaseerd op het minimum van de "
+"maximum volgehouden invoer of uitvoer bandbreedte over enig tien-seconden "
+"periode tijdens de afgelopen dag."
#. type: Content of: <html><body>
#: en/netview.html:122
msgid "<a name=\"details\"/>"
-msgstr ""
+msgstr "<a name=\"details\"/>"
#. type: Content of: <html><body><h3>
#: en/netview.html:123
msgid "Relay Details"
-msgstr ""
+msgstr "Relaydetails"
#. type: Content of: <html><body><p>
#: en/netview.html:125
@@ -179,31 +188,33 @@ msgid ""
"The fields that you may see in the panel are as follows (<i>Note</i>: not "
"all of these fields will always be present):"
msgstr ""
+"De velden die je kunt zien in de panels zijn als volgt (<i>Let op</i>: niet "
+"alle velden zullen altijd zichtbaar zijn):"
#. type: Content of: <html><body><p><table><tr><td>
#: en/netview.html:138
msgid "<b>Location</b>"
-msgstr ""
+msgstr "<b>Locatie</b>"
#. type: Content of: <html><body><p><table><tr><td>
#: en/netview.html:139
msgid "The geographic location of this Tor relay."
-msgstr ""
+msgstr "De geografische locatie van de Tor relay."
#. type: Content of: <html><body><p><table><tr><td>
#: en/netview.html:142
msgid "<b>IP Address</b>"
-msgstr ""
+msgstr "<b>IP-adres</b>"
#. type: Content of: <html><body><p><table><tr><td>
#: en/netview.html:143
msgid "IP address at which this Tor relay can be reached."
-msgstr ""
+msgstr "IP-adres waar de Tor relay bereikbaar is."
#. type: Content of: <html><body><p><table><tr><td>
#: en/netview.html:146
msgid "<b>Platform</b>"
-msgstr ""
+msgstr "<b>Platform</b>"
#. type: Content of: <html><body><p><table><tr><td>
#: en/netview.html:148
@@ -211,11 +222,13 @@ msgid ""
"Operating system information and Tor version on which this relay is "
"currently running."
msgstr ""
+"Besturingssysteeminformatie and Tor versie waar deze relay momenteel mee "
+"draait."
#. type: Content of: <html><body><p><table><tr><td>
#: en/netview.html:153
msgid "<b>Bandwidth</b>"
-msgstr ""
+msgstr "<b>Bandbreedte</b>"
#. type: Content of: <html><body><p><table><tr><td>
#: en/netview.html:155
@@ -223,11 +236,13 @@ msgid ""
"Estimated maximum amount of bandwidth that the directory relays have seen "
"this relay handle recently."
msgstr ""
+"Geschatte maximale hoeveelheid bandbreedte dat de directory relays deze "
+"relay recentelijke hebben zien behandelen."
#. type: Content of: <html><body><p><table><tr><td>
#: en/netview.html:160
msgid "<b>Uptime</b>"
-msgstr ""
+msgstr "<b>Uptime</b>"
#. type: Content of: <html><body><p><table><tr><td>
#: en/netview.html:162
@@ -235,15 +250,17 @@ msgid ""
"Length of time this relay has been available, which can be used to help "
"estimate this relay's stability."
msgstr ""
+"Hoeveelheid tijd dat deze relay beschikbaar is geweest, wat gebruikt kan "
+"worden om de relay's stabiliteit in te schatten."
#. type: Content of: <html><body><p><table><tr><td>
#: en/netview.html:167
msgid "<b>Last Updated</b>"
-msgstr ""
+msgstr "<b>Laatst bijgewerkt</b>"
#. type: Content of: <html><body><p><table><tr><td>
#: en/netview.html:168
msgid "Date this relay's information was last updated."
-msgstr ""
+msgstr "Datum dat deze relay-informatie het laatst is bijgewerkt."
1
0
[translation/vidalia_help] Update translations for vidalia_help
by translation@torproject.org 20 Nov '11
by translation@torproject.org 20 Nov '11
20 Nov '11
commit a76c698c856ea5cab515fb51c07e4650ee60b0bd
Author: Translation commit bot <translation(a)torproject.org>
Date: Sat Nov 19 19:45:26 2011 +0000
Update translations for vidalia_help
---
nl/bridges.po | 20 +++++++++++-
nl/server.po | 91 ++++++++++++++++++++++++++++++++++++--------------------
2 files changed, 76 insertions(+), 35 deletions(-)
diff --git a/nl/bridges.po b/nl/bridges.po
index baf5279..8f4a5ac 100644
--- a/nl/bridges.po
+++ b/nl/bridges.po
@@ -6,7 +6,7 @@ msgstr ""
"Project-Id-Version: The Tor Project\n"
"Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n"
"POT-Creation-Date: 2010-06-26 16:58+0200\n"
-"PO-Revision-Date: 2011-11-19 19:14+0000\n"
+"PO-Revision-Date: 2011-11-19 19:24+0000\n"
"Last-Translator: Shondoit <shondoit+transifex(a)gmail.com>\n"
"Language-Team: LANGUAGE <LL(a)li.org>\n"
"MIME-Version: 1.0\n"
@@ -64,7 +64,7 @@ msgstr "Hoe vind ik een bridge relay?"
#. type: Content of: <html><body><p>
#: en/bridges.html:34
msgid "There are two main ways to learn about a bridge address:"
-msgstr "Er zijn twee manieren om een bridge adres te krijgen:"
+msgstr "Er zijn twee manieren om een bridge-adres te krijgen:"
#. type: Content of: <html><body><p><ol><li>
#: en/bridges.html:36
@@ -87,6 +87,13 @@ msgid ""
"just passes data to and from the Tor network, so it shouldn't expose the "
"operator to any abuse complaints."
msgstr ""
+"Om privé bridges te gebruiken, vraag een vriend om Vidalia en Tor te draaien"
+" in een ongecensureerd gebied van het internet en klik dan op <i>Help "
+"gecensureerde gebruikers</i> in Vidalia's <a href=\"server.html\">Relay "
+"instellingen pagina</a>. Hierna moeten ze jou het <i>Bridge-adres</i> te "
+"sturen, onderaan hun Relay pagina. In tegenstelling tot een exit relay zal "
+"een bridge relay alleen data van en naar het Tor netwerk versturen. Het zal "
+"de operator dus niet blootstellen aan misbruikklachten."
#. type: Content of: <html><body><p>
#: en/bridges.html:52
@@ -100,6 +107,15 @@ msgid ""
"attacker to learn lots of bridge addresses, you must send this request from "
"a Gmail account."
msgstr ""
+"Je kunt openbare bridge-adressen vinden door naar "
+"<b>https://bridges.torproject.org</b> te gaan. De antwoorden die je daar "
+"krijgt veranderen elke paar dagen, dus zorg er voor dat je geregeld "
+"terugkomt als je meer bridge-adressen nodig hebt. Een andere manier om "
+"openbare bridge-adressen te krijgen is door een e-mail te sturen naar "
+"<b>bridges(a)torproject.org</b> met alleen de regel <b>get bridges</b> in de "
+"body van de mail. Echter, om het moeilijker te maken voor aanvallers om een "
+"heleboel bridge-adressen te achterhalen moet je dit verzoek versturen vanaf "
+"een Gmail account."
#. type: Content of: <html><body><p>
#: en/bridges.html:63
diff --git a/nl/server.po b/nl/server.po
index 4132a85..27138ae 100644
--- a/nl/server.po
+++ b/nl/server.po
@@ -1,12 +1,13 @@
#
# Translators:
+# Shondoit Walker <shondoit+transifex(a)gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: The Tor Project\n"
"Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n"
"POT-Creation-Date: 2010-06-26 17:00+0200\n"
-"PO-Revision-Date: 2010-11-30 05:03+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"PO-Revision-Date: 2011-11-19 19:43+0000\n"
+"Last-Translator: Shondoit <shondoit+transifex(a)gmail.com>\n"
"Language-Team: LANGUAGE <LL(a)li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -17,7 +18,7 @@ msgstr ""
#. type: Content of: <html><body><h1>
#: en/server.html:16
msgid "Setting Up a Tor Relay"
-msgstr ""
+msgstr "Een Tor relay opzetten"
#. type: Content of: <html><body>
#: en/server.html:19
@@ -26,11 +27,15 @@ msgid ""
"of their spare bandwidth by running a Tor relay. Vidalia helps you do your "
"part by making it easy to set up a relay of your own. <a name=\"basic\"/>"
msgstr ""
+"Het Tor netwerk bestaat uit vrijwilligers over de hele wereld die een beetje"
+" van hun extra bandbreedte doneren door een Tor relay te draaien. Vidalia "
+"helpt je om jouw aandeel te doen door het makkelijk te maken om een eigen "
+"relay op te zetten. <a name=\"basic\"/>"
#. type: Content of: <html><body><h3>
#: en/server.html:24
msgid "Basic Settings"
-msgstr ""
+msgstr "Basis instellingen"
#. type: Content of: <html><body><p>
#: en/server.html:26
@@ -38,6 +43,8 @@ msgid ""
"If you decide you want to help the Tor network grow by running a relay, you "
"can follow these steps to get started:"
msgstr ""
+" Als je er voor kiest om het Tor netwerk te helpen door een relay te "
+"draaien, kan je de deze stappen volgen om te beginnen:"
#. type: Content of: <html><body><ol><li>
#: en/server.html:31
@@ -46,11 +53,14 @@ msgid ""
"tray menu or <i>Preferences</i> from your system menubar on Macintosh "
"systems."
msgstr ""
+"Open het <i>Configuratie dialoogvenster</i> door </i>Instellingen</i> te "
+"kiezen in het systeemvakmenu of <i>Voorkeuren</i> in het systeem menubalk op"
+" Macintosh systemen."
#. type: Content of: <html><body><ol><li>
#: en/server.html:35
msgid "Select the <i>Relay</i> configuration page."
-msgstr ""
+msgstr "Kies de <i>Relay</i> configuratiepagina"
#. type: Content of: <html><body><ol><li>
#: en/server.html:37
@@ -62,11 +72,17 @@ msgid ""
"relay or <i>Help censored users reach the Tor network</i> if you want to run"
" a bridge relay."
msgstr ""
+"Kies of je een normale Tor relay of een <i>bridge</i> relay wilt draaien. "
+"(Tor 0.2.0.8-alpha of nieuwer). Bridge relays helpen gecensureerde Tor "
+"gebruikers die geblokkeerd zijn om het Tor netwerk direct te benaderen. Vink"
+" het vakje genaamd <i>Relay verkeer voor het Tor netwerk</i> als je een "
+"normale Tor relay wilt draaien of <i>Help gecensureerde gebruiker het Tor "
+"netwerk te bereiken</i> als je een bridge relay wilt draaien."
#. type: Content of: <html><body><ol><li>
#: en/server.html:44
msgid "Enter the following information:"
-msgstr ""
+msgstr "Voer de volgende informatie in:"
#. type: Content of: <html><body><ol><ul><li>
#: en/server.html:46
@@ -74,6 +90,8 @@ msgid ""
"<b>Nickname</b>: The name which your relay will be known as on the Tor "
"network. An example of a relay nickname is \"MyVidaliaRelay\"."
msgstr ""
+"<b>Bijnaam</b>: De naam die je relay gebruikt in het Tor netwerk. Een "
+"voorbeeld van een relay bijnaam is \"MijnVidaliaRelay\"."
#. type: Content of: <html><body><ol><ul><li>
#: en/server.html:50
@@ -83,6 +101,10 @@ msgid ""
"goes wrong with your relay. You might also include your PGP or GPG key ID "
"and fingerprint."
msgstr ""
+"<b>Contactinformatie</b>: Je e-mailadres. Dit adres wordt alleen gebruikt om"
+" contact op te nemen al er een belangrijke Tor beveiligingsupdate "
+"beschikbaar is of als er iets mis gaat met je relay. Je mag ook je PGP of "
+"GPG key ID en fingerpring bijvoegen."
#. type: Content of: <html><body><ol><ul><li>
#: en/server.html:56
@@ -90,6 +112,8 @@ msgid ""
"<b>Relay Port</b>: The port on which your relay will listen for traffic from"
" clients or other Tor relays."
msgstr ""
+"<b>Relay poort</b>: De poort waarop je relay zal luisteren voor verkeer van "
+"clients of andere Tor relays."
#. type: Content of: <html><body><ol><li>
#: en/server.html:62
@@ -105,12 +129,12 @@ msgstr ""
#. type: Content of: <html><body>
#: en/server.html:71
msgid "<a name=\"bandwidth\"/>"
-msgstr ""
+msgstr "<a name=\"bandwith\"/>"
#. type: Content of: <html><body><h3>
#: en/server.html:72
msgid "Bandwidth Limits"
-msgstr ""
+msgstr "Bandbreedte limieten"
#. type: Content of: <html><body><p>
#: en/server.html:74
@@ -132,7 +156,7 @@ msgstr ""
#. type: Content of: <html><body><h4>
#: en/server.html:84
msgid "Custom Limits"
-msgstr ""
+msgstr "Aangepaste limieten"
#. type: Content of: <html><body><p>
#: en/server.html:86
@@ -171,12 +195,12 @@ msgstr ""
#. type: Content of: <html><body>
#: en/server.html:111
msgid "<a name=\"exitpolicy\"/>"
-msgstr ""
+msgstr "<a name=\"exitpolicy\"/>"
#. type: Content of: <html><body><h3>
#: en/server.html:112
msgid "Exit Policies"
-msgstr ""
+msgstr "Exit beleid"
#. type: Content of: <html><body><p>
#: en/server.html:114
@@ -211,108 +235,109 @@ msgstr ""
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:138
msgid "<b>Checkbox</b>"
-msgstr ""
+msgstr "<b>Selectievak</b>"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:139
msgid "<b>Ports</b>"
-msgstr ""
+msgstr "<b>Poorten</b>"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:140
msgid "<b>Description</b>"
-msgstr ""
+msgstr "<b>Beschrijving</b>"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:143
msgid "Websites"
-msgstr ""
+msgstr "Websites"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:144
msgid "80"
-msgstr ""
+msgstr "80"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:145
msgid "Normal, unencrypted Web browsing"
-msgstr ""
+msgstr "Normale, onbeveiligd web browsen"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:148
msgid "Secure Websites (SSL)"
-msgstr ""
+msgstr "Beveiligde websites (SSL)"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:149
msgid "443"
-msgstr ""
+msgstr "443"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:150
msgid "Encrypted Web browsing"
-msgstr ""
+msgstr "Beveiligd web browsen"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:153
msgid "Retrieve Mail (POP, IMAP)"
-msgstr ""
+msgstr "E-mail ophalen (POP, IMAP)"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:154
msgid "110, 143, 993, 995"
-msgstr ""
+msgstr "110, 143, 993, 995"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:155
msgid "Downloading email (does not permit sending email)"
-msgstr ""
+msgstr "E-mail downloaden (staat e-mail versturen niet toe)"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:158
msgid "Instant Messaging (IM)"
-msgstr ""
+msgstr "Instant Messaging (IM)"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:159
msgid "703, 1863, 5050, 5190, 5222, 5223, 8300, 8888"
-msgstr ""
+msgstr "703, 1863, 5050, 5190, 5222, 5223, 8300, 8888"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:160
msgid ""
"Instant messaging applications like MSN Messenger, AIM, ICQ, and Jabber"
-msgstr ""
+msgstr "Instant Messaging programma's zoals MSN Messenger, AIM, ICQ en Jabber"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:163
msgid "Internet Relay Chat (IRC)"
-msgstr ""
+msgstr "Internet Relay Chat (IRC)"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:164
msgid "6660-6669, 6697, 7000-7001"
-msgstr ""
+msgstr "6660-6669, 6697, 7000-7001"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:165
msgid "IRC clients and servers"
-msgstr ""
+msgstr "IRC clients en servers"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:168
msgid "Misc. Other Services"
-msgstr ""
+msgstr "Verscheidene andere services"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:169
msgid "*"
-msgstr ""
+msgstr "*"
#. type: Content of: <html><body><table><tr><td>
#: en/server.html:170
msgid "All other applications that aren't covered by the previous checkboxes"
msgstr ""
+"Alle andere applicaties die niet gedekt worden door de vorige selectievakjes"
#. type: Content of: <html><body><p>
#: en/server.html:175
@@ -335,12 +360,12 @@ msgstr ""
#. type: Content of: <html><body>
#: en/server.html:188
msgid "<a name=\"upnp\"/>"
-msgstr ""
+msgstr "<a name=\"upnp\"/>"
#. type: Content of: <html><body><h3>
#: en/server.html:189
msgid "Port Forwarding"
-msgstr ""
+msgstr "Poort forwarding"
#. type: Content of: <html><body><p>
#: en/server.html:191
1
0
[translation/vidalia_help] Update translations for vidalia_help
by translation@torproject.org 20 Nov '11
by translation@torproject.org 20 Nov '11
20 Nov '11
commit 99e92cb35ec3098846eab548dcc466c52c982b9f
Author: Translation commit bot <translation(a)torproject.org>
Date: Sat Nov 19 19:15:26 2011 +0000
Update translations for vidalia_help
---
nl/bridges.po | 31 +++++++++++++++++++++----------
1 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/nl/bridges.po b/nl/bridges.po
index 2fcfd11..baf5279 100644
--- a/nl/bridges.po
+++ b/nl/bridges.po
@@ -1,12 +1,13 @@
#
# Translators:
+# Shondoit Walker <shondoit+transifex(a)gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: The Tor Project\n"
"Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n"
"POT-Creation-Date: 2010-06-26 16:58+0200\n"
-"PO-Revision-Date: 2010-11-30 05:02+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"PO-Revision-Date: 2011-11-19 19:14+0000\n"
+"Last-Translator: Shondoit <shondoit+transifex(a)gmail.com>\n"
"Language-Team: LANGUAGE <LL(a)li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -17,17 +18,17 @@ msgstr ""
#. type: Content of: <html><body><h1>
#: en/bridges.html:16
msgid "Bridge Relays"
-msgstr ""
+msgstr "Bridge Relays"
#. type: Content of: <html><body>
#: en/bridges.html:19
msgid "<a name=\"about\"/>"
-msgstr ""
+msgstr "<a name=\"about\"/>"
#. type: Content of: <html><body><h3>
#: en/bridges.html:20
msgid "What are bridge relays?"
-msgstr ""
+msgstr "Wat zijn bridge relays?"
#. type: Content of: <html><body><p>
#: en/bridges.html:22
@@ -41,31 +42,39 @@ msgid ""
"to all the known Tor relays, they probably won't be able to block all the "
"bridges."
msgstr ""
+"Sommige Internet Service Providers (ISP's) proberen gebruikers er van te "
+"weerhouden om te verbinden met Tor door bekende Tor relays te blokkeren. "
+"Bridge relays (of <i>bridges</i> in het kort) zijn relays die helpen "
+"gecensureerde gebruikers toegang te geven tot het Tor netwerk. In "
+"tegenstelling tot Tor relays worden bridges niet vermeldt in dezelfde "
+"openbare directory-lijst als normale relays. Omdat er geen complete openbare"
+" lijst van ze is, zelfs als je ISP verbindingen filtert naar bekende relays "
+"kunnen ze waarschijnlijk niet alle bridges blokkeren."
#. type: Content of: <html><body>
#: en/bridges.html:31
msgid "<a name=\"finding\"/>"
-msgstr ""
+msgstr "<a name=\"finding\"/>"
#. type: Content of: <html><body><h3>
#: en/bridges.html:32
msgid "How do I find a bridge relay?"
-msgstr ""
+msgstr "Hoe vind ik een bridge relay?"
#. type: Content of: <html><body><p>
#: en/bridges.html:34
msgid "There are two main ways to learn about a bridge address:"
-msgstr ""
+msgstr "Er zijn twee manieren om een bridge adres te krijgen:"
#. type: Content of: <html><body><p><ol><li>
#: en/bridges.html:36
msgid "Get some friends to run private bridges for you"
-msgstr ""
+msgstr "Laat een vriend een privé bridge voor je draaien."
#. type: Content of: <html><body><p><ol><li>
#: en/bridges.html:37
msgid "Use some of the public bridges"
-msgstr ""
+msgstr "Gebruik een openbare bridge."
#. type: Content of: <html><body><p>
#: en/bridges.html:42
@@ -98,5 +107,7 @@ msgid ""
"Configuring more than one bridge address will make your Tor connection more "
"stable, in case some of the bridges become unreachable."
msgstr ""
+"Meer dan één bridge adres instellen zorgt er voor dat je Tor verbinding "
+"stabieler wordt, in het geval dat sommige bridges onbereikbaar zijn."
1
0
r25231: {website} Short user manual available in Chinese (website/trunk/docs/en)
by Runa Sandvik 19 Nov '11
by Runa Sandvik 19 Nov '11
19 Nov '11
Author: runa
Date: 2011-11-19 18:20:48 +0000 (Sat, 19 Nov 2011)
New Revision: 25231
Modified:
website/trunk/docs/en/short-user-manual.wml
Log:
Short user manual available in Chinese
Modified: website/trunk/docs/en/short-user-manual.wml
===================================================================
--- website/trunk/docs/en/short-user-manual.wml 2011-11-18 21:36:25 UTC (rev 25230)
+++ website/trunk/docs/en/short-user-manual.wml 2011-11-19 18:20:48 UTC (rev 25231)
@@ -21,6 +21,7 @@
<p>The user manual is available in the following languages:</p>
<ul>
+ <li><a href="https://www.torproject.org/dist/manual/short-user-manual_zh.xhtml">Chinese</a></li>
<li><a href="https://www.torproject.org/dist/manual/short-user-manual_cs.xhtml">Czech</a></li>
<li><a href="https://www.torproject.org/dist/manual/short-user-manual_nl.xhtml">Dutch</a></li>
<li><a href="https://torproject.org/dist/manual/short-user-manual_en.xhtml">English</a></li>
1
0
19 Nov '11
commit 9e7314e85d6a702fe2697840e6f47e1ad5fc622f
Author: Translation commit bot <translation(a)torproject.org>
Date: Sat Nov 19 12:45:03 2011 +0000
Update translations for orbot
---
values-de/strings.xml | 44 ++++++++++++++++++++++----------------------
1 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/values-de/strings.xml b/values-de/strings.xml
index 208d076..505785a 100644
--- a/values-de/strings.xml
+++ b/values-de/strings.xml
@@ -130,16 +130,16 @@ Besuchen Sie https://guardianproject.info/apps/orbot oder senden Sie eine E-Mail
<string name="pref_proxy_port_title">Proxy Port</string>
<string name="pref_proxy_port_summary">Proxy Server Port</string>
<string name="pref_proxy_port_dialog">Proxy Port eingeben</string>
- <string name="status"></string>
+ <string name="status">Status</string>
<string name="setting_up_full_transparent_proxying_"></string>
<string name="setting_up_app_based_transparent_proxying_"></string>
- <string name="transparent_proxying_enabled"></string>
- <string name="transproxy_enabled_for_tethering_"></string>
- <string name="warning_error_starting_transparent_proxying_"></string>
- <string name="transproxy_rules_cleared"></string>
- <string name="couldn_t_start_tor_process_"></string>
- <string name="privoxy_is_running_on_port_"></string>
- <string name="setting_up_port_based_transparent_proxying_"></string>
+ <string name="transparent_proxying_enabled">Transparentes Proxying aktiviert</string>
+ <string name="transproxy_enabled_for_tethering_">TransProxy für Tethering aktiviert!</string>
+ <string name="warning_error_starting_transparent_proxying_">WARNUNG: Fehler beim Starten von transparentem Proxying!</string>
+ <string name="transproxy_rules_cleared">TransProxy Regeln gelöscht</string>
+ <string name="couldn_t_start_tor_process_">Konnte Tor Prozess nicht starten:</string>
+ <string name="privoxy_is_running_on_port_">Privoxy läuft auf Port:</string>
+ <string name="setting_up_port_based_transparent_proxying_">Richte Port-basiertes transparentes Proxiying ein...</string>
<string name="bridge_error"></string>
<string name="bridge_requires_ip"></string>
<string name="send_email_for_bridges"></string>
@@ -168,9 +168,9 @@ Besuchen Sie https://guardianproject.info/apps/orbot oder senden Sie eine E-Mail
<string name="relay_nickname"></string>
<string name="the_nickname_for_your_tor_relay"></string>
<string name="enter_a_custom_relay_nickname"></string>
- <string name="reachable_addresses"></string>
+ <string name="reachable_addresses">Erreichbare Adressen</string>
<string name="run_as_a_client_behind_a_firewall_with_restrictive_policies"></string>
- <string name="reachable_ports"></string>
+ <string name="reachable_ports">Erreichbare Ports</string>
<string name="ports_reachable_behind_a_restrictive_firewall"></string>
<string name="enter_ports"></string>
<string name="enable_hidden_services"></string>
@@ -178,20 +178,20 @@ Besuchen Sie https://guardianproject.info/apps/orbot oder senden Sie eine E-Mail
<string name="enter_localhost_ports_for_hidden_services"></string>
<string name="hidden_service_ports"></string>
<string name="the_addressable_name_for_your_hidden_service_generated_automatically_"></string>
- <string name="enable_debug_log_to_output_must_use_adb_or_alogcat_to_view_"></string>
+ <string name="enable_debug_log_to_output_must_use_adb_or_alogcat_to_view_">Aktiviere Debug Log Ausgabe (benötigt adb oder alogcat zur Ansicht)</string>
<string name="project_home"></string>
- <string name="project_urls"></string>
- <string name="the_tor_license"></string>
- <string name="https_torproject_org"></string>
- <string name="third_party_software"></string>
- <string name="tor_version"></string>
- <string name="libevent_version"></string>
- <string name="privoxy_version"></string>
- <string name="iptables_version"></string>
+ <string name="project_urls">https://www.torproject.org/docs/android\nhttps://guardianproject.info/apps/…</string>
+ <string name="the_tor_license">Die Tor Lizenz</string>
+ <string name="https_torproject_org">https://torproject.org</string>
+ <string name="third_party_software">Drittanbieter-Software:</string>
+ <string name="tor_version">Tor v0.2.3.7-alpha: https://www.torproject.org</string>
+ <string name="libevent_version">LibEvent v1.4.13: http://www.monkey.org/~provos/libevent/</string>
+ <string name="privoxy_version">Privoxy v3.0.12: http://www.privoxy.org</string>
+ <string name="iptables_version">Iptables v1.4.7: http://www.netfilter.org</string>
<string name="hidden_service_request"></string>
- <string name="found_existing_tor_process"></string>
- <string name="something_bad_happened"></string>
+ <string name="found_existing_tor_process">existierender Tor Prozess gefunden...</string>
+ <string name="something_bad_happened">Etwasist schief gelaufen. Bitte Log prüfen</string>
<string name="hidden_service_on"></string>
<string name="unable_to_read_hidden_service_name"></string>
- <string name="unable_to_start_tor"></string>
+ <string name="unable_to_start_tor">Kann Tor nicht starten:</string>
</resources>
1
0
19 Nov '11
commit c2753d89fa42081fb2713d0609735dab7eab7fb8
Author: Translation commit bot <translation(a)torproject.org>
Date: Sat Nov 19 10:45:02 2011 +0000
Update translations for gettor
---
cs/gettor.po | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/cs/gettor.po b/cs/gettor.po
index 0a43e1c..931ea98 100644
--- a/cs/gettor.po
+++ b/cs/gettor.po
@@ -10,7 +10,7 @@ msgstr ""
"Project-Id-Version: The Tor Project\n"
"Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n"
"POT-Creation-Date: 2011-11-13 22:01+0100\n"
-"PO-Revision-Date: 2011-11-18 13:03+0000\n"
+"PO-Revision-Date: 2011-11-19 10:28+0000\n"
"Last-Translator: Sanky <gsanky+transifex(a)gmail.com>\n"
"Language-Team: LANGUAGE <LL(a)li.org>\n"
"MIME-Version: 1.0\n"
@@ -287,6 +287,8 @@ msgid ""
"It is also possible to fetch bridges with a web browser at the following\n"
"url: https://bridges.torproject.org/"
msgstr ""
+"Také si lze vyžádat mosty pomocí webového prohlížeče na adrese: "
+"https://bridges.torproject.org/"
#: lib/gettor/i18n.py:170
msgid ""
@@ -296,12 +298,16 @@ msgid ""
"into the same directory and unpack them by double-clicking the\n"
"first file."
msgstr ""
+"DŮLEŽITÁ POZNÁMKA:\n"
+"Jelikož je toto část rozdělené žádosti, musíte počkat až vám přijdou všechny části a poté je můžete uložit do jednoho adresáře a rozbalit dvojklikem na první soubor."
#: lib/gettor/i18n.py:176
msgid ""
"Packages might arrive out of order! Please make sure you received\n"
"all packages before you attempt to unpack them!"
msgstr ""
+"Balíčky mohou přijít mimo pořadí! Ujistěte se, prosím, že vám přišly všechny"
+" balíčky než se je pokusíte rozbalit."
#: lib/gettor/i18n.py:179
#, python-format
@@ -321,6 +327,8 @@ msgid ""
"Unfortunately we are currently experiencing problems and we can't fulfill\n"
"your request right now. Please be patient as we try to resolve this issue."
msgstr ""
+"Bohužel máme právě potíže a zrovna nemůžeme splnit vaši žádost. Prosím buďte"
+" trpěliví než se problém pokusíme vyřešit."
#: lib/gettor/i18n.py:188
msgid ""
1
0
19 Nov '11
commit f6560b1210a20bdee7ccb68567b44b7f877a3e38
Author: Damian Johnson <atagar(a)torproject.org>
Date: Fri Nov 18 23:23:28 2011 -0800
Rewrite and testing for system utilities
Spent most of this week improving the implementation, api, documentation, and
most importantly testing for the system functions. They now have almost
complete code coverage by both unit and integ tests. Besides the obvious, this
will help cross-platform compatability in the future since I'll have a sampling
of input for platforms I don't have.
Generated real output for all commands except sockstat (I only have access to
linux and mac, not free/openbsd). I'll probably contact Fabian for help with
this one.
---
run_tests.py | 2 +
stem/util/system.py | 536 +++++++++++++++++++++++++++----------------
test/integ/util/__init__.py | 2 +-
test/integ/util/conf.py | 4 +
test/integ/util/system.py | 193 +++++++++++++++-
test/unit/util/__init__.py | 2 +-
test/unit/util/system.py | 290 +++++++++++++++++++++++
7 files changed, 824 insertions(+), 205 deletions(-)
diff --git a/run_tests.py b/run_tests.py
index 774c130..41df4bf 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -17,6 +17,7 @@ import test.unit.types.control_line
import test.unit.types.version
import test.unit.connection.protocolinfo_response
import test.unit.util.enum
+import test.unit.util.system
import test.integ.types.control_message
import test.integ.util.conf
import test.integ.util.system
@@ -34,6 +35,7 @@ UNIT_TESTS = (("stem.types.ControlMessage", test.unit.types.control_message.Test
("stem.types.Version", test.unit.types.version.TestVerion),
("stem.connection.ProtocolInfoResponse", test.unit.connection.protocolinfo_response.TestProtocolInfoResponse),
("stem.util.enum", test.unit.util.enum.TestEnum),
+ ("stem.util.system", test.unit.util.system.TestSystem),
)
INTEG_TESTS = (("stem.types.ControlMessage", test.integ.types.control_message.TestControlMessage),
diff --git a/stem/util/system.py b/stem/util/system.py
index e5ba367..659d3ca 100644
--- a/stem/util/system.py
+++ b/stem/util/system.py
@@ -1,10 +1,14 @@
"""
Helper functions for working with the underlying system. These are mostly os
-dependent, only working on linux, osx, and bsd.
+dependent, only working on linux, osx, and bsd. In almost all cases they're
+best-effort, providing None if the lookup fails.
+is_bsd - checks if we're running on the bsd family of operating systems
is_available - determines if a command is availabe on this system
is_running - determines if a given process is running
-get_pid - provides the process id a given process is running under
+get_pid_by_name - gets the pid for a process by the given name
+get_pid_by_port - gets the pid for a process listening to a given port
+get_pid_by_open_file - gets the pid for the process with an open file
get_cwd - provides the current working directory for a given process
get_bsd_jail_id - provides the BSD jail id a given process is running within
is_relative_path - checks if a given path can be expanded by expand_path
@@ -12,7 +16,6 @@ expand_path - expands relative paths and ~ entries
call - runs the given system command and provides back the results
"""
-import re
import os
import time
import logging
@@ -22,11 +25,48 @@ import stem.util.proc
LOGGER = logging.getLogger("stem")
+# Functor for mocking the call function, which should either return a string
+# (or None) to emulate responses, or a boolean to indicate if we should filter
+# the call. Also, when set...
+# - we don't check that commands exist before calling them
+# - the use of proc functions is disabled
+#
+# This is intended for testing purposes only.
+
+CALL_MOCKING = None
+
# Mapping of commands to if they're available or not. This isn't always
# reliable, failing for some special commands. For these the cache is
# prepopulated to skip lookups.
+
CMD_AVAILABLE_CACHE = {"ulimit": True}
+IS_RUNNING_PS_LINUX = "ps -A co command"
+IS_RUNNING_PS_BSD = "ps -ao ucomm="
+GET_PID_BY_NAME_PGREP = "pgrep -x %s"
+GET_PID_BY_NAME_PIDOF = "pidof %s"
+GET_PID_BY_NAME_PS_LINUX = "ps -o pid -C %s"
+GET_PID_BY_NAME_PS_BSD = "ps axc"
+GET_PID_BY_NAME_LSOF = "lsof -tc %s"
+GET_PID_BY_PORT_NETSTAT = "netstat -npltu"
+GET_PID_BY_PORT_SOCKSTAT = "sockstat -4l -P tcp -p %s"
+GET_PID_BY_PORT_LSOF = "lsof -wnP -iTCP -sTCP:LISTEN"
+GET_PID_BY_FILE_LSOF = "lsof -tw %s"
+GET_CWD_PWDX = "pwdx %s"
+GET_CWD_LSOF = "lsof -a -p %s -d cwd -Fn"
+GET_BSD_JAIL_ID_PS = "ps -p %s -o jid"
+
+def is_bsd():
+ """
+ Checks if we are within the BSD family of operating systems. This presently
+ recognizes Macs, FreeBSD, and OpenBSD but may be expanded later.
+
+ Returns:
+ bool to indicate if we're a BSD OS
+ """
+
+ return os.uname()[0] in ("Darwin", "FreeBSD", "OpenBSD")
+
def is_available(command, cached=True):
"""
Checks the current PATH to see if a command is available or not. If more
@@ -58,288 +98,365 @@ def is_available(command, cached=True):
CMD_AVAILABLE_CACHE[command] = cmd_exists
return cmd_exists
-def is_running(command, suppress_exc = True):
+def is_running(command):
"""
Checks for if a process with a given name is running or not.
Arguments:
- command (str) - process name to be checked
- suppress_exc (bool) - if True then None is returned on failure, otherwise
- this raises the exception
+ command (str) - process name to be checked
Returns:
- True if the process is running, False otherwise
-
- Raises:
- OSError if this can't be determined and suppress_exc is False
+ True if the process is running, False if it's not among ps results, and
+ None if ps can't be queried
"""
# Linux and the BSD families have different variants of ps. Guess based on
- # os.uname() results which to try first, then fall back to the other.
+ # the is_bsd() check which to try first, then fall back to the other.
#
# Linux
- # -A - Select all processes. Identical to -e.
+ # -A - Select all processes.
# -co command - Shows just the base command.
#
# Mac / BSD
# -a - Display information about other users' processes as well as
- # your own.
+ # our own.
# -o ucomm= - Shows just the ucomm attribute ("name to be used for
# accounting")
- primary_resolver, secondary_resolver = "ps -A co command", "ps -ao ucomm="
-
- if os.uname()[0] in ("Darwin", "FreeBSD", "OpenBSD"):
- primary_resolver, secondary_resolver = secondary_resolver, primary_resolver
-
- command_listing = call(primary_resolver)
- if not command_listing:
- command_listing = call(secondary_resolver)
+ if CALL_MOCKING or is_available("ps"):
+ if is_bsd():
+ primary_resolver = IS_RUNNING_PS_BSD
+ secondary_resolver = IS_RUNNING_PS_LINUX
+ else:
+ primary_resolver = IS_RUNNING_PS_LINUX
+ secondary_resolver = IS_RUNNING_PS_BSD
+
+ command_listing = call(primary_resolver)
+ if not command_listing:
+ command_listing = call(secondary_resolver)
+
+ if command_listing:
+ return command in command_listing
- if command_listing:
- return command in command_listing
- else:
- if suppress_exc: return None
- else: raise OSError("Unable to check via 'ps -A co command'")
+ return None
-def get_pid(process_name, process_port = None, suppress_exc = True):
+def get_pid_by_name(process_name):
"""
- Attempts to determine the process id for a running process, using the
- following:
+ Attempts to determine the process id for a running process, using...
- 1. "pgrep -x <name>"
- 2. "pidof <name>"
- 3. "netstat -npl | grep 127.0.0.1:<port>"
- 4. "ps -o pid -C <name>"
- 5. "sockstat -4l -P tcp -p <port> | grep <name>"
- 6. "ps axc | egrep \" <name>$\""
- 7. "lsof -wnPi | egrep \"^<name>.*:<port>\""
+ 1. pgrep -x <name>
+ 2. pidof <name>
+ 3. ps -o pid -C <name> (linux)
+ ps axc | egrep " <name>$" (bsd)
+ 4. lsof -tc <name>
- If pidof or ps provide multiple instance of the process then their results
- are discarded (since only netstat can differentiate using a bound port).
+ Results with multiple instances of the process are discarded.
Arguments:
- process_name (str) - process name for which to fetch the pid
- process_port (int) - port that the process we're interested in is bound
- to, this is used to disambiguate if there's multiple
- instances running
- suppress_exc (bool) - if True then None is returned on failure, otherwise
- this raises the exception
+ process_name (str) - process name for which to fetch the pid
Returns:
- int with the process id, None if it can't be determined and suppress_exc is
- True
-
- Raises:
- IOError if either no running process exists or it can't be determined and
- suppress_exc is True
+ int with the process id, None if it can't be determined
"""
# attempts to resolve using pgrep, failing if:
- # - the process is running under a different name
- # - there are multiple instances
+ # - we're running on bsd (command unavailable)
+ #
+ # example output:
+ # atagar@morrigan:~$ pgrep -x vim
+ # 3283
+ # 3392
- try:
- results = call("pgrep -x %s" % process_name)
+ if CALL_MOCKING or is_available("pgrep"):
+ results = call(GET_PID_BY_NAME_PGREP % process_name)
- if results and len(results) == 1 and len(results[0].split()) == 1:
+ if results and len(results) == 1:
pid = results[0].strip()
if pid.isdigit(): return int(pid)
- except IOError: pass
# attempts to resolve using pidof, failing if:
- # - the process is running under a different name
- # - there are multiple instances
+ # - we're running on bsd (command unavailable)
+ #
+ # example output:
+ # atagar@morrigan:~$ pidof vim
+ # 3392 3283
- try:
- results = call("pidof %s" % process_name)
+ if CALL_MOCKING or is_available("pidof"):
+ results = call(GET_PID_BY_NAME_PIDOF % process_name)
if results and len(results) == 1 and len(results[0].split()) == 1:
pid = results[0].strip()
if pid.isdigit(): return int(pid)
- except IOError: pass
- # attempts to resolve using netstat, failing if:
- # - the process being run as a different user due to permissions
-
- if process_port:
- try:
- results = call("netstat -npl")
+ # attempts to resolve using ps, failing if:
+ # - system's ps variant doesn't handle these flags (none known at the moment)
+ #
+ # example output:
+ # atagar@morrigan:~/Desktop/stem$ ps -o pid -C vim
+ # PID
+ # 3283
+ # 3392
+ #
+ # atagar$ ps axc
+ # PID TT STAT TIME COMMAND
+ # 1 ?? Ss 9:00.22 launchd
+ # 10 ?? Ss 0:09.97 kextd
+ # 11 ?? Ss 5:47.36 DirectoryService
+ # 12 ?? Ss 3:01.44 notifyd
+
+ if CALL_MOCKING or is_available("ps"):
+ if CALL_MOCKING or not is_bsd():
+ # linux variant of ps
+ results = call(GET_PID_BY_NAME_PS_LINUX % process_name)
+
+ if results and len(results) == 2:
+ pid = results[1].strip()
+ if pid.isdigit(): return int(pid)
+
+ if CALL_MOCKING or is_bsd():
+ # bsd variant of ps
+ results = call(GET_PID_BY_NAME_PS_BSD)
- # filters to results with our port (same as "grep 127.0.0.1:<port>")
if results:
- results = [r for r in results if "127.0.0.1:%i" % process_port in r]
+ # filters results to those with our process name
+ results = [r for r in results if r.endswith(" %s" % process_name)]
- if len(results) == 1:
- results = results[0].split()[6] # process field (ex. "7184/tor")
- pid = results[:results.find("/")]
+ if len(results) == 1 and len(results[0].split()) > 0:
+ pid = results[0].split()[0]
if pid.isdigit(): return int(pid)
- except IOError: pass
- # attempts to resolve using ps, failing if:
- # - the process is running under a different name
- # - there are multiple instances
+ # resolves using lsof which works on both Linux and BSD, only failing if:
+ # - lsof is unavailable (not included by default on OpenBSD)
+ # - the process being run as a different user due to permissions
+ # - the process doesn't have any open files to be reported by lsof?
+ #
+ # flags:
+ # t - only show pids
+ # c - restrict results to that command
+ #
+ # example output:
+ # atagar@morrigan:~$ lsof -t -c vim
+ # 2470
+ # 2561
- try:
- results = call("ps -o pid -C %s" % process_name)
+ if CALL_MOCKING or is_available("lsof"):
+ results = call(GET_PID_BY_NAME_LSOF % process_name)
- if results and len(results) == 2:
- pid = results[1].strip()
+ if results and len(results) == 1:
+ pid = results[0].strip()
if pid.isdigit(): return int(pid)
- except IOError: pass
- # attempts to resolve using sockstat, failing if:
- # - sockstat doesn't accept the -4 flag (BSD only)
- # - the process is running under a different name
- # - there are multiple instances using the same port on different addresses
- #
- # TODO: The later two issues could be solved by filtering for an expected IP
- # address instead of the process name.
+ LOGGER.debug("failed to resolve a pid for %s" % process_name)
+ return None
+
+def get_pid_by_port(port):
+ """
+ Attempts to determine the process id for a process with the given port,
+ using...
- if process_port:
- try:
- results = call("sockstat -4l -P tcp -p %i" % process_port)
-
- # filters to results with our port (same as "grep <name>")
- if results:
- results = [r for r in results if process_name in r]
-
- if len(results) == 1 and len(results[0].split()) == 7:
- pid = results[0].split()[2]
- if pid.isdigit(): return int(pid)
- except IOError: pass
+ 1. netstat -npltu | grep 127.0.0.1:<port>
+ 2. sockstat -4l -P tcp -p <port>
+ 3. lsof -wnP -iTCP -sTCP:LISTEN | grep ":<port>"
- # attempts to resolve via a ps command that works on mac/bsd (this and lsof
- # are the only resolvers to work on that platform). This fails if:
- # - the process is running under a different name
- # - there are multiple instances
+ Most queries limit results to listening TCP connections.
- try:
- results = call("ps axc")
+ Arguments:
+ port (int) - port where the process we're looking for is listening
+
+ Returns:
+ int with the process id, None if it can't be determined
+ """
+
+ # attempts to resolve using netstat, failing if:
+ # - netstat doesn't accept these flags (Linux only)
+ # - the process being run as a different user due to permissions
+ #
+ # flags:
+ # n - numeric (disables hostname lookups)
+ # p - program (include pids)
+ # l - listening (include listening sockets)
+ # tu - show tcp and udp sockets, and nothing else
+ #
+ # example output:
+ # atagar@morrigan:~$ netstat -npltu
+ # Active Internet connections (only servers)
+ # Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
+ # tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
+ # tcp 0 0 127.0.0.1:9051 0.0.0.0:* LISTEN 1641/tor
+ # tcp6 0 0 ::1:631 :::* LISTEN -
+ # udp 0 0 0.0.0.0:5353 0.0.0.0:* -
+ # udp6 0 0 fe80::7ae4:ff:fe2f::123 :::* -
+
+ if CALL_MOCKING or is_available("netstat"):
+ results = call(GET_PID_BY_PORT_NETSTAT)
- # filters to results with our port (same as "egrep ' <name>$'")
if results:
- results = [r for r in results if r.endswith(" %s" % process_name)]
+ # filters to results with our port
+ results = [r for r in results if "127.0.0.1:%s" % port in r]
- if len(results) == 1 and len(results[0].split()) > 0:
- pid = results[0].split()[0]
+ if len(results) == 1 and len(results[0].split()) == 7:
+ results = results[0].split()[6] # process field (ex. "7184/tor")
+ pid = results[:results.find("/")]
if pid.isdigit(): return int(pid)
- except IOError: pass
- # attempts to resolve via lsof, this should work on linux, mac, and bsd
- # and only fail if:
- # - the process is running under a different name
- # - the process being run as a different user due to permissions
+ # attempts to resolve using sockstat, failing if:
+ # - sockstat doesn't accept the -4 flag (BSD only)
# - there are multiple instances using the same port on different addresses
-
- try:
- results = call("lsof -wnPi")
+ #
+ # flags:
+ # 4 - only show IPv4 sockets
+ # l - listening sockets
+ # P tcp - only show tcp connections
+ # p - only includes results if the local or foreign port match this
+ #
+ # example output:
+ # # TODO: We need an example for the actual command we're using. I'm
+ # # suspecting that replacing the grep with checking the local port works,
+ # # but should double check.
+ #
+ # # sockstat -4 | grep tor
+ # _tor tor 4397 7 tcp4 51.64.7.84:9050 *:*
+ # _tor tor 4397 8 udp4 51.64.7.84:53 *:*
+ # _tor tor 4397 12 tcp4 51.64.7.84:54011 80.3.121.7:9001
+ # _tor tor 4397 15 tcp4 51.64.7.84:59374 7.42.1.102:9001
+ # _tor tor 4397 20 tcp4 51.64.7.84:51946 32.83.7.104:443
+
+ if CALL_MOCKING or is_available("sockstat"):
+ results = call(GET_PID_BY_PORT_SOCKSTAT % port)
- # filters to results with our port (same as "egrep '^<name>.*:<port>'")
if results:
- port_comp = str(process_port) if process_port else ""
- results = [r for r in results if re.match("^%s.*:%s" % (process_name, port_comp), r)]
-
- # This can result in multiple entries with the same pid (from the query
- # itself). Checking all lines to see if they're in agreement about the pid.
+ # filters to results where this is the local port
+ results = [r for r in results if (len(r.split()) == 7 and (":%s" % port) in r.split()[5])]
+
+ if len(results) == 1:
+ pid = results[0].split()[2]
+ if pid.isdigit(): return int(pid)
+
+ # resolves using lsof which works on both Linux and BSD, only failing if:
+ # - lsof is unavailable (not included by default on OpenBSD)
+ # - the process being run as a different user due to permissions
+ # - there are multiple instances using the same port on different addresses
+ #
+ # flags:
+ # w - disables warning messages
+ # n - numeric addresses (disables hostname lookups)
+ # P - numeric ports (disables replacement of ports with their protocol)
+ # iTCP - only show tcp connections
+ # sTCP:LISTEN - listening sockets
+ #
+ # example output:
+ # atagar@morrigan:~$ lsof -wnP -iTCP -sTCP:LISTEN
+ # COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
+ # tor 1745 atagar 6u IPv4 14229 0t0 TCP 127.0.0.1:9051 (LISTEN)
+
+ if CALL_MOCKING or is_available("lsof"):
+ results = call(GET_PID_BY_PORT_LSOF)
if results:
- pid = ""
-
- for line in results:
- line_comp = line.split()
-
- if len(line_comp) >= 2 and (not pid or line_comp[1] == pid):
- pid = line_comp[1]
- else: raise IOError
+ # filters to results with our port
+ results = [r for r in results if (len(r.split()) == 10 and (":%s" % port) in r.split()[8])]
- if pid.isdigit(): return int(pid)
- except IOError: pass
+ if len(results) == 1:
+ pid = results[0].split()[1]
+ if pid.isdigit(): return int(pid)
- exc_msg = "failed to resolve a pid for %s" % process_name
+ return None # all queries failed
+
+def get_pid_by_open_file(path):
+ """
+ Attempts to determine the process id for a process with the given open file,
+ using...
- if suppress_exc:
- LOGGER.debug(exc_msg)
- return None
- else:
- raise IOError(exc_msg)
+ lsof -w <path>
+
+ Arguments:
+ path (str) - location of the socket file to query against
+
+ Returns:
+ int with the process id, None if it can't be determined
+ """
+
+ # resolves using lsof which works on both Linux and BSD, only failing if:
+ # - lsof is unavailable (not included by default on OpenBSD)
+ # - the file can't be read due to permissions
+ #
+ # flags:
+ # t - only show pids
+ # w - disables warning messages
+ #
+ # example output:
+ # atagar@morrigan:~$ lsof -tw /tmp/foo
+ # 4762
+
+ if CALL_MOCKING or is_available("lsof"):
+ results = call(GET_PID_BY_FILE_LSOF % path)
+
+ if results and len(results) == 1:
+ pid = results[0].strip()
+ if pid.isdigit(): return int(pid)
+
+ return None # all queries failed
-def get_cwd(pid, suppress_exc = True):
+def get_cwd(pid):
"""
Provices the working directory of the given process.
Arguments:
- pid (int) - process id of the process to be queried
- suppress_exc (bool) - if True then None is returned on failure, otherwise
- this raises the exception
+ pid (int) - process id of the process to be queried
Returns:
str with the absolute path for the process' present working directory, None
- if it can't be determined and suppress_exc is True
-
- Raises:
- IOError if this fails and suppress_exc is False
+ if it can't be determined
"""
# try fetching via the proc contents if it's available
- if stem.util.proc.is_available():
+ if stem.util.proc.is_available() and not CALL_MOCKING:
try: return stem.util.proc.get_cwd(pid)
except IOError: pass
- # Fall back to a pwdx query. This isn't available on BSD. If we attempt this
- # lookup then it trumps lsof when logging isssues at the end since it's the
- # better lookup method for this information.
-
- exc_msg = None
+ # Fall back to a pwdx query. This isn't available on BSD.
+ logging_prefix = "get_cwd(%s):" % pid
- if is_available("pwdx"):
+ if CALL_MOCKING or is_available("pwdx"):
# pwdx results are of the form:
# 3799: /home/atagar
# 5839: No such process
- try:
- results = call("pwdx %s" % pid)
-
- if not results:
- exc_msg = "pwdx didn't return any results"
- elif results[0].endswith("No such process"):
- exc_msg = "pwdx reported no process for pid %s" % pid
- elif len(results) != 1 or results[0].count(" ") != 1:
- exc_msg = "we got unexpected output from pwdx: %s" % results
- else:
- return results[0].split(" ", 1)[1].strip()
- except OSError, exc:
- exc_msg = "pwdx query for %s failed: %s" % (pid, exc)
+ results = call(GET_CWD_PWDX % pid)
+
+ if not results:
+ LOGGER.debug("%s pwdx didn't return any results" % logging_prefix)
+ elif results[0].endswith("No such process"):
+ LOGGER.debug("%s pwdx processes reported for this pid" % logging_prefix)
+ elif len(results) != 1 or results[0].count(" ") != 1 or not results[0].startswith("%s: " % pid):
+ LOGGER.debug("%s we got unexpected output from pwdx: %s" % (logging_prefix, results))
+ else:
+ return results[0].split(" ", 1)[1].strip()
# Use lsof as the final fallback. This is available on both Linux and is the
# only lookup method here that works for BSD...
# https://trac.torproject.org/projects/tor/ticket/4236
#
- # ~$ lsof -a -p 75717 -d cwd -Fn
- # p75717
- # n/Users/atagar/tor/src/or
+ # flags:
+ # a - presents the intersection of the following arguments
+ # p - limits results to this pid
+ # d cwd - limits results to just the cwd rather than all open files
+ # Fn - short listing in a single column, with just the pid and cwd
+ #
+ # example output:
+ # ~$ lsof -a -p 75717 -d cwd -Fn
+ # p75717
+ # n/Users/atagar/tor/src/or
- try:
- results = call("lsof -a -p %s -d cwd -Fn" % pid)
+ if CALL_MOCKING or is_available("lsof"):
+ results = call(GET_CWD_LSOF % pid)
if results and len(results) == 2 and results[1].startswith("n/"):
return results[1][1:].strip()
- elif not exc_msg:
- exc_msg = "we got unexpected output from lsof: %s" % results
- except OSError, exc:
- if not exc_msg:
- exc_msg = "lsof query for the cwd of %s failed: %s" % (pid, exc)
+ else:
+ LOGGER.debug("%s we got unexpected output from lsof: %s" % (logging_prefix, results))
- if not exc_msg:
- # shouldn't happen, somehow we never registered a failure...
- exc_msg = "unable to query pwdx or lsof for the cwd of %s" % pid
-
- # we failed all lookups, either raise or log the issue and return None
- if suppress_exc:
- LOGGER.debug(exc_msg)
- return None
- else:
- raise IOError(exc_msg)
+ return None # all queries failed
def get_bsd_jail_id(pid):
"""
@@ -360,9 +477,9 @@ def get_bsd_jail_id(pid):
# JID
# 1
- ps_output = call("ps -p %s -o jid" % pid)
+ ps_output = call(GET_BSD_JAIL_ID_PS % pid)
- if len(ps_output) == 2 and len(ps_output[1].split()) == 1:
+ if ps_output and len(ps_output) == 2 and len(ps_output[1].split()) == 1:
jid = ps_output[1].strip()
if jid.isdigit(): return int(jid)
@@ -383,7 +500,8 @@ def is_relative_path(path):
def expand_path(path, cwd = None):
"""
Provides an absolute path, expanding tildas with the user's home and
- appending a current working directory if the path was relative.
+ appending a current working directory if the path was relative. This is
+ unix-specific and paths never have an ending slash.
Arguments:
path (str) - path to be expanded
@@ -394,12 +512,14 @@ def expand_path(path, cwd = None):
str of the path expanded to be an absolute path
"""
+ relative_path = path
+
if not path or path[0] == "/":
# empty or already absolute - nothing to do
- return path
+ pass
elif path.startswith("~"):
# prefixed with a ~ or ~user entry
- return os.path.expanduser(path)
+ relative_path = os.path.expanduser(path)
else:
# relative path, expand with the cwd
if not cwd: cwd = os.getcwd()
@@ -407,8 +527,11 @@ def expand_path(path, cwd = None):
# we'll be dealing with both "my/path/" and "./my/path" entries, so
# cropping the later
if path.startswith("./"): path = path[2:]
+ elif path == ".": path = ""
- return os.path.join(cwd, path)
+ relative_path = os.path.join(cwd, path)
+
+ return relative_path.rstrip("/")
def call(command, suppress_exc = True):
"""
@@ -429,6 +552,29 @@ def call(command, suppress_exc = True):
OSError if this fails and suppress_exc is False
"""
+ # Most of our system functions rely on system calls through this function, so
+ # testing may need to mock responses to exercise our various functionality.
+
+ if CALL_MOCKING:
+ mock_response = CALL_MOCKING(command)
+
+ # Mocking either returns...
+ # - str/None for unit tests to emulate system calls
+ # - bool for integ tests to indicate if we should make this system call or
+ # suppress it, to selectively trigger logic
+
+ if isinstance(mock_response, bool):
+ if mock_response:
+ pass # mocking indicates that we should go on to make the real call
+ else:
+ # call should be suppressed
+ if suppress_exc: return None
+ else: raise OSError("System call filtered by mocking")
+ else:
+ if mock_response == None and not suppress_exc:
+ raise OSError("Mocking provided a None response")
+ else: return mock_response
+
try:
start_time = time.time()
stdout, stderr = subprocess.Popen(command.split(), stdout = subprocess.PIPE, stderr = subprocess.PIPE).communicate()
diff --git a/test/integ/util/__init__.py b/test/integ/util/__init__.py
index a0b3303..95e5870 100644
--- a/test/integ/util/__init__.py
+++ b/test/integ/util/__init__.py
@@ -2,5 +2,5 @@
Integration tests for stem.util.* contents.
"""
-__all__ = ["system"]
+__all__ = ["conf", "system"]
diff --git a/test/integ/util/conf.py b/test/integ/util/conf.py
index 03ac4a1..a74406f 100644
--- a/test/integ/util/conf.py
+++ b/test/integ/util/conf.py
@@ -22,6 +22,10 @@ startup.run alias l=ls
""" % CONF_HEADER
class TestConf(unittest.TestCase):
+ """
+ Tests the stem.util.conf contents.
+ """
+
def tearDown(self):
# cleans up test configurations we made
if os.path.exists(CONF_PATH):
diff --git a/test/integ/util/system.py b/test/integ/util/system.py
index fc7c384..5d4a924 100644
--- a/test/integ/util/system.py
+++ b/test/integ/util/system.py
@@ -4,6 +4,7 @@ process.
"""
import os
+import getpass
import unittest
import test.runner
@@ -15,6 +16,10 @@ class TestSystem(unittest.TestCase):
running.
"""
+ def tearDown(self):
+ # resets call mocking back to being disabled
+ stem.util.system.CALL_MOCKING = None
+
def test_is_available(self):
"""
Checks the stem.util.system.is_available function.
@@ -33,26 +38,172 @@ class TestSystem(unittest.TestCase):
self.assertTrue(stem.util.system.is_running("tor"))
self.assertFalse(stem.util.system.is_running("blarg_and_stuff"))
-
- def test_get_pid(self):
+
+ def test_get_pid_by_name(self):
+ """
+ Checks general usage of the stem.util.system.get_pid_by_name function. This
+ will fail if there's other tor instances running.
+ """
+
+ runner = test.runner.get_runner()
+ self.assertEquals(runner.get_pid(), stem.util.system.get_pid_by_name("tor"))
+ self.assertEquals(None, stem.util.system.get_pid_by_name("blarg_and_stuff"))
+
+ def test_get_pid_by_name_pgrep(self):
+ """
+ Tests the get_pid_by_name function with a pgrep response.
+ """
+
+ if not stem.util.system.is_available("pgrep"):
+ self.skipTest("(pgrep unavailable)")
+
+ pgrep_prefix = stem.util.system.GET_PID_BY_NAME_PGREP % ""
+ self._run_pid_test(pgrep_prefix, stem.util.system.get_pid_by_name, "tor")
+
+ def test_get_pid_by_name_pidof(self):
+ """
+ Tests the get_pid_by_name function with a pidof response.
+ """
+
+ if not stem.util.system.is_available("pidof"):
+ self.skipTest("(pidof unavailable)")
+
+ pidof_prefix = stem.util.system.GET_PID_BY_NAME_PIDOF % ""
+ self._run_pid_test(pidof_prefix, stem.util.system.get_pid_by_name, "tor")
+
+ def test_get_pid_by_name_ps_linux(self):
+ """
+ Tests the get_pid_by_name function with the linux variant of ps.
"""
- Checks the stem.util.system.get_pid function.
+
+ if not stem.util.system.is_available("ps"):
+ self.skipTest("(ps unavailable)")
+ elif stem.util.system.is_bsd(): self.skipTest("(linux only)")
+
+ ps_prefix = stem.util.system.GET_PID_BY_NAME_PS_LINUX % ""
+ self._run_pid_test(ps_prefix, stem.util.system.get_pid_by_name, "tor")
+
+ def test_get_pid_by_name_ps_bsd(self):
+ """
+ Tests the get_pid_by_name function with the bsd variant of ps.
+ """
+
+ if not stem.util.system.is_available("ps"):
+ self.skipTest("(ps unavailable)")
+ elif not stem.util.system.is_bsd(): self.skipTest("(bsd only)")
+
+ ps_cmd = stem.util.system.GET_PID_BY_NAME_PS_BSD
+ self._run_pid_test(ps_cmd, stem.util.system.get_pid_by_name, "tor")
+
+ def test_get_pid_by_name_lsof(self):
+ """
+ Tests the get_pid_by_name function with a lsof response.
+ """
+
+ if not stem.util.system.is_available("lsof"):
+ self.skipTest("(lsof unavailable)")
+
+ lsof_prefix = stem.util.system.GET_PID_BY_NAME_LSOF % ""
+ self._run_pid_test(lsof_prefix, stem.util.system.get_pid_by_name, "tor")
+
+ def test_get_pid_by_port(self):
+ """
+ Checks general usage of the stem.util.system.get_pid_by_port function.
"""
runner = test.runner.get_runner()
- self.assertEquals(runner.get_pid(), stem.util.system.get_pid("tor", runner.get_control_port()))
- self.assertEquals(None, stem.util.system.get_pid("blarg_and_stuff"))
+ tor_pid, tor_port = runner.get_pid(), runner.get_control_port()
+ self.assertEquals(tor_pid, stem.util.system.get_pid_by_port(tor_port))
+ self.assertEquals(None, stem.util.system.get_pid_by_port(99999))
+
+ def test_get_pid_by_port_netstat(self):
+ """
+ Tests the get_pid_by_port function with a netstat response.
+ """
+
+ if not stem.util.system.is_available("netstat"):
+ self.skipTest("(netstat unavailable)")
+ elif stem.util.system.is_bsd(): self.skipTest("(linux only)")
+
+ netstat_cmd = stem.util.system.GET_PID_BY_PORT_NETSTAT
+ runner_port = test.runner.get_runner().get_control_port()
+ self._run_pid_test(netstat_cmd, stem.util.system.get_pid_by_port, runner_port)
+
+ def test_get_pid_by_port_sockstat(self):
+ """
+ Tests the get_pid_by_port function with a sockstat response.
+ """
+
+ if not stem.util.system.is_available("sockstat"):
+ self.skipTest("(sockstat unavailable)")
+ elif not stem.util.system.is_bsd(): self.skipTest("(bsd only)")
+
+ sockstat_prefix = stem.util.system.GET_PID_BY_PORT_SOCKSTAT % ""
+ runner_port = test.runner.get_runner().get_control_port()
+ self._run_pid_test(sockstat_prefix, stem.util.system.get_pid_by_port, runner_port)
+
+ def test_get_pid_by_port_lsof(self):
+ """
+ Tests the get_pid_by_port function with a lsof response.
+ """
+
+ if not stem.util.system.is_available("lsof"):
+ self.skipTest("(lsof unavailable)")
+
+ lsof_cmd = stem.util.system.GET_PID_BY_PORT_LSOF
+ runner_port = test.runner.get_runner().get_control_port()
+ self._run_pid_test(lsof_cmd, stem.util.system.get_pid_by_port, runner_port)
+
+ def test_get_pid_by_open_file(self):
+ """
+ Checks the stem.util.system.get_pid_by_open_file function.
+ """
+
+ # we're not running with a control socket so this just exercises the
+ # failure case
+
+ self.assertEquals(None, stem.util.system.get_pid_by_open_file("/tmp"))
+ self.assertEquals(None, stem.util.system.get_pid_by_open_file("/non-existnt-path"))
def test_get_cwd(self):
"""
- Checks the stem.util.system.get_cwd function.
+ Checks general usage of the stem.util.system.get_cwd function.
"""
# tor's pwd will match our process since we started it
runner = test.runner.get_runner()
self.assertEquals(os.getcwd(), stem.util.system.get_cwd(runner.get_pid()))
- self.assertEquals(None, stem.util.system.get_cwd(99999, True))
- self.assertRaises(IOError, stem.util.system.get_cwd, 99999, False)
+ self.assertEquals(None, stem.util.system.get_cwd(99999))
+
+ def test_get_cwd_pwdx(self):
+ """
+ Tests the get_pid_by_cwd function with a pwdx response.
+ """
+
+ if not stem.util.system.is_available("pwdx"):
+ self.skipTest("(pwdx unavailable)")
+
+ # filter the call function to only allow this command
+ pwdx_prefix = GET_CWD_PWDX % ""
+ stem.util.system.CALL_MOCKING = lambda cmd: cmd.startswith(pwdx_prefix)
+
+ runner_pid = test.runner.get_runner().get_pid()
+ self.assertEquals(os.getcwd(), stem.util.system.get_cwd(runner_pid))
+
+ def test_get_cwd_pwdx(self):
+ """
+ Tests the get_pid_by_cwd function with a lsof response.
+ """
+
+ if not stem.util.system.is_available("lsof"):
+ self.skipTest("(lsof unavailable)")
+
+ # filter the call function to only allow this command
+ lsof_prefix = "lsof -a -p "
+ stem.util.system.CALL_MOCKING = lambda cmd: cmd.startswith(lsof_prefix)
+
+ runner_pid = test.runner.get_runner().get_pid()
+ self.assertEquals(os.getcwd(), stem.util.system.get_cwd(runner_pid))
def test_get_bsd_jail_id(self):
"""
@@ -62,4 +213,30 @@ class TestSystem(unittest.TestCase):
"""
self.assertEquals(0, stem.util.system.get_bsd_jail_id(99999))
+
+ def test_expand_path(self):
+ """
+ Exercises the stem.expand_path method with actual runtime data.
+ """
+
+ self.assertEquals(os.getcwd(), stem.util.system.expand_path("."))
+ self.assertEquals(os.getcwd(), stem.util.system.expand_path("./"))
+ self.assertEquals(os.path.join(os.getcwd(), "foo"), stem.util.system.expand_path("./foo"))
+
+ home_dir, username = os.getenv("HOME"), getpass.getuser()
+ self.assertEquals(home_dir, stem.util.system.expand_path("~"))
+ self.assertEquals(home_dir, stem.util.system.expand_path("~/"))
+ self.assertEquals(home_dir, stem.util.system.expand_path("~%s" % username))
+ self.assertEquals(os.path.join(home_dir, "foo"), stem.util.system.expand_path("~%s/foo" % username))
+
+ def _run_pid_test(self, cmd_prefix, test_function, arg):
+ """
+ Runs a get_pid_by_* test with the given inputs.
+ """
+
+ # filter the call function to only allow this command
+ stem.util.system.CALL_MOCKING = lambda cmd: cmd.startswith(cmd_prefix)
+
+ runner_pid = test.runner.get_runner().get_pid()
+ self.assertEquals(runner_pid, test_function(arg))
diff --git a/test/unit/util/__init__.py b/test/unit/util/__init__.py
index 84f12bf..57015c1 100644
--- a/test/unit/util/__init__.py
+++ b/test/unit/util/__init__.py
@@ -2,5 +2,5 @@
Unit tests for stem.util.* contents.
"""
-__all__ = ["enum"]
+__all__ = ["enum", "system"]
diff --git a/test/unit/util/system.py b/test/unit/util/system.py
new file mode 100644
index 0000000..1941c46
--- /dev/null
+++ b/test/unit/util/system.py
@@ -0,0 +1,290 @@
+"""
+Unit tests for the stem.util.system functions. This works by mocking the
+stem.util.system.call function to selectively exercise other functions. None of
+these tests actually make system calls, use proc, or otherwise deal with the
+system running the tests.
+"""
+
+import functools
+import unittest
+import stem.util.system as system
+
+# Base responses for the get_pid_by_name tests. The 'success' and
+# 'multiple_results' entries are filled in by tests.
+
+GET_PID_BY_NAME_BASE_RESULTS = {
+ "success": [],
+ "multiple_results": [],
+ "malformed_data": ["bad data"],
+ "no_results": [],
+ "command_fails": None,
+}
+
+# testing output for system calls
+
+GET_PID_BY_NAME_PS_BSD = [
+ " PID TT STAT TIME COMMAND",
+ " 1 ?? Ss 9:00.22 launchd",
+ " 10 ?? Ss 0:09.97 kextd",
+ " 11 ?? Ss 5:47.36 DirectoryService",
+ " 12 ?? Ss 3:01.44 notifyd"]
+
+GET_PID_BY_PORT_NETSTAT_RESULTS = [
+ "Active Internet connections (only servers)",
+ "Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name",
+ "tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN - ",
+ "tcp 0 0 127.0.0.1:9051 0.0.0.0:* LISTEN 1641/tor ",
+ "tcp6 0 0 ::1:631 :::* LISTEN - ",
+ "udp 0 0 0.0.0.0:5353 0.0.0.0:* - ",
+ "udp6 0 0 fe80::7ae4:ff:fe2f::123 :::* - "]
+
+GET_PID_BY_PORT_SOCKSTAT_RESULTS = [
+ "_tor tor 4397 7 tcp4 51.64.7.84:9051 *:*",
+ "_tor tor 4397 12 tcp4 51.64.7.84:54011 80.3.121.7:9051",
+ "_tor tor 4397 15 tcp4 51.64.7.84:59374 7.42.1.102:9051"]
+
+GET_PID_BY_PORT_LSOF_RESULTS = [
+ "COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME",
+ "tor 1745 atagar 6u IPv4 14229 0t0 TCP 127.0.0.1:9051 (LISTEN)",
+ "apache 329 atagar 6u IPv4 14229 0t0 TCP 127.0.0.1:80 (LISTEN)"]
+
+def mock_call(base_cmd, responses, command):
+ """
+ Template mock function for testing a series of test inputs. Test functions
+ make a partial with the first two values filled out, then the system's call
+ method provides the 'command' argument.
+
+ Arguments:
+ base_cmd (str) - command to match against
+ responses (list, dict) - either list with the response, or mapping of
+ base_cmd formatted string completions to responses
+ command (str) - system call being mocked
+ """
+
+ if isinstance(responses, list):
+ if base_cmd == command: return responses
+ else: return None
+ else:
+ for cmd_completion in responses:
+ if command == base_cmd % cmd_completion:
+ return responses[cmd_completion]
+
+class TestSystem(unittest.TestCase):
+ """
+ Tests the stem.util.system contents.
+ """
+
+ def tearDown(self):
+ # resets call mocking back to being disabled
+ system.CALL_MOCKING = None
+
+ def test_is_running(self):
+ """
+ Exercises multiple use cases for the is_running function.
+ """
+
+ # mock response with a linux and bsd resolver
+ running_commands = ["irssi", "moc", "tor", "ps"]
+
+ for ps_cmd in (system.IS_RUNNING_PS_LINUX, system.IS_RUNNING_PS_BSD):
+ system.CALL_MOCKING = functools.partial(mock_call, ps_cmd, running_commands)
+
+ self.assertTrue(system.is_running("irssi"))
+ self.assertTrue(system.is_running("moc"))
+ self.assertTrue(system.is_running("tor"))
+ self.assertTrue(system.is_running("ps"))
+ self.assertFalse(system.is_running("something_else"))
+
+ # mock both calls failing
+ system.CALL_MOCKING = lambda cmd: None
+ self.assertFalse(system.is_running("irssi"))
+ self.assertEquals(None, system.is_running("irssi"))
+
+ def test_get_pid_by_name_pgrep(self):
+ """
+ Tests the get_pid_by_name function with pgrep responses.
+ """
+
+ responses = dict(GET_PID_BY_NAME_BASE_RESULTS)
+ responses["success"] = ["1111"]
+ responses["multiple_results"] = ["123", "456", "789"]
+ system.CALL_MOCKING = functools.partial(mock_call, system.GET_PID_BY_NAME_PGREP, responses)
+
+ for test_input in responses:
+ expected_response = 1111 if test_input == "success" else None
+ self.assertEquals(expected_response, system.get_pid_by_name(test_input))
+
+ def test_get_pid_by_name_pidof(self):
+ """
+ Tests the get_pid_by_name function with pidof responses.
+ """
+
+ responses = dict(GET_PID_BY_NAME_BASE_RESULTS)
+ responses["success"] = ["1111"]
+ responses["multiple_results"] = ["123 456 789"]
+ system.CALL_MOCKING = functools.partial(mock_call, system.GET_PID_BY_NAME_PIDOF, responses)
+
+ for test_input in responses:
+ expected_response = 1111 if test_input == "success" else None
+ self.assertEquals(expected_response, system.get_pid_by_name(test_input))
+
+ def test_get_pid_by_name_ps_linux(self):
+ """
+ Tests the get_pid_by_name function with the linux variant of ps.
+ """
+
+ responses = dict(GET_PID_BY_NAME_BASE_RESULTS)
+ responses["success"] = ["PID", " 1111"]
+ responses["multiple_results"] = ["PID", " 123", " 456", " 789"]
+ system.CALL_MOCKING = functools.partial(mock_call, system.GET_PID_BY_NAME_PS_LINUX, responses)
+
+ for test_input in responses:
+ expected_response = 1111 if test_input == "success" else None
+ self.assertEquals(expected_response, system.get_pid_by_name(test_input))
+
+ def test_get_pid_by_name_ps_bsd(self):
+ """
+ Tests the get_pid_by_name function with the bsd variant of ps.
+ """
+
+ system.CALL_MOCKING = functools.partial(mock_call, system.GET_PID_BY_NAME_PS_BSD, GET_PID_BY_NAME_PS_BSD)
+ self.assertEquals(1, system.get_pid_by_name("launchd"))
+ self.assertEquals(11, system.get_pid_by_name("DirectoryService"))
+ self.assertEquals(None, system.get_pid_by_name("blarg"))
+
+ def test_get_pid_by_name_lsof(self):
+ """
+ Tests the get_pid_by_name function with lsof responses.
+ """
+
+ responses = dict(GET_PID_BY_NAME_BASE_RESULTS)
+ responses["success"] = ["1111"]
+ responses["multiple_results"] = ["123", "456", "789"]
+ system.CALL_MOCKING = functools.partial(mock_call, system.GET_PID_BY_NAME_LSOF, responses)
+
+ for test_input in responses:
+ expected_response = 1111 if test_input == "success" else None
+ self.assertEquals(expected_response, system.get_pid_by_name(test_input))
+
+ def test_get_pid_by_port_netstat(self):
+ """
+ Tests the get_pid_by_port function with a netstat response.
+ """
+
+ system.CALL_MOCKING = functools.partial(mock_call, system.GET_PID_BY_PORT_NETSTAT, GET_PID_BY_PORT_NETSTAT_RESULTS)
+ self.assertEquals(1641, system.get_pid_by_port(9051))
+ self.assertEquals(1641, system.get_pid_by_port("9051"))
+ self.assertEquals(None, system.get_pid_by_port(631))
+ self.assertEquals(None, system.get_pid_by_port(123))
+
+ def test_get_pid_by_port_sockstat(self):
+ """
+ Tests the get_pid_by_port function with a sockstat response.
+ """
+
+ system.CALL_MOCKING = functools.partial(mock_call, system.GET_PID_BY_PORT_SOCKSTAT % 9051, GET_PID_BY_PORT_SOCKSTAT_RESULTS)
+ self.assertEquals(4397, system.get_pid_by_port(9051))
+ self.assertEquals(4397, system.get_pid_by_port("9051"))
+ self.assertEquals(None, system.get_pid_by_port(123))
+
+ def test_get_pid_by_port_lsof(self):
+ """
+ Tests the get_pid_by_port function with a lsof response.
+ """
+
+ system.CALL_MOCKING = functools.partial(mock_call, system.GET_PID_BY_PORT_LSOF, GET_PID_BY_PORT_LSOF_RESULTS)
+ self.assertEquals(1745, system.get_pid_by_port(9051))
+ self.assertEquals(1745, system.get_pid_by_port("9051"))
+ self.assertEquals(329, system.get_pid_by_port(80))
+ self.assertEquals(None, system.get_pid_by_port(123))
+
+ def test_get_pid_by_open_file_lsof(self):
+ """
+ Tests the get_pid_by_open_file function with a lsof response.
+ """
+
+ lsof_query = system.GET_PID_BY_FILE_LSOF % "/tmp/foo"
+ system.CALL_MOCKING = functools.partial(mock_call, lsof_query, ["4762"])
+ self.assertEquals(4762, system.get_pid_by_open_file("/tmp/foo"))
+ self.assertEquals(None, system.get_pid_by_open_file("/tmp/somewhere_else"))
+
+ def test_get_cwd_pwdx(self):
+ """
+ Tests the get_cwd function with a pwdx response.
+ """
+
+ responses = {
+ "3799": ["3799: /home/atagar"],
+ "5839": ["5839: No such process"],
+ "1234": ["malformed output"],
+ "7878": None,
+ }
+
+ system.CALL_MOCKING = functools.partial(mock_call, system.GET_CWD_PWDX, responses)
+
+ for test_input in responses:
+ expected_response = "/home/atagar" if test_input == "3799" else None
+ self.assertEquals(expected_response, system.get_cwd(test_input))
+
+ def test_get_cwd_lsof(self):
+ """
+ Tests the get_cwd function with a lsof response.
+ """
+
+ responses = {
+ "75717": ["p75717", "n/Users/atagar/tor/src/or"],
+ "1234": ["malformed output"],
+ "7878": None,
+ }
+
+ system.CALL_MOCKING = functools.partial(mock_call, system.GET_CWD_LSOF, responses)
+
+ for test_input in responses:
+ expected_response = "/Users/atagar/tor/src/or" if test_input == "75717" else None
+ self.assertEquals(expected_response, system.get_cwd(test_input))
+
+ def test_get_bsd_jail_id(self):
+ """
+ Tests the get_bsd_jail_id function.
+ """
+
+ responses = {
+ "1111": ["JID", " 1"],
+ "2222": ["JID", " 0"],
+ "3333": ["JID", "bad data"],
+ "4444": ["bad data"],
+ "5555": [],
+ "6666": None
+ }
+
+ system.CALL_MOCKING = functools.partial(mock_call, system.GET_BSD_JAIL_ID_PS, responses)
+
+ for test_input in responses:
+ expected_response = 1 if test_input == "1111" else 0
+ self.assertEquals(expected_response, system.get_bsd_jail_id(test_input))
+
+ def test_is_relative_path(self):
+ """
+ Tests the is_relative_path function.
+ """
+
+ self.assertTrue(system.is_relative_path("hello/world"))
+ self.assertTrue(system.is_relative_path("~/hello/world"))
+ self.assertTrue(system.is_relative_path("~user/hello/world"))
+ self.assertFalse(system.is_relative_path("/tmp/hello/world"))
+
+ def test_expand_path(self):
+ """
+ Tests the expand_path function. This does not exercise home directory
+ expansions since that deals with our environment (that's left to integ
+ tests).
+ """
+
+ self.assertEquals("", system.expand_path(""))
+ self.assertEquals("/tmp", system.expand_path("/tmp"))
+ self.assertEquals("/tmp", system.expand_path("/tmp/"))
+ self.assertEquals("/tmp", system.expand_path(".", "/tmp"))
+ self.assertEquals("/tmp", system.expand_path("./", "/tmp"))
+ self.assertEquals("/tmp/foo", system.expand_path("foo", "/tmp"))
+ self.assertEquals("/tmp/foo", system.expand_path("./foo", "/tmp"))
+
1
0
19 Nov '11
commit 12b290b25f16bd72275e72cddaa013d2ebfc8cc0
Author: Sebastian Hahn <sebastian(a)torproject.org>
Date: Sat Nov 19 01:40:37 2011 +0100
Add a TODO note for router.unreachable
We have to handle the case where circuit creation always succeeds, but
streams still fail to get to us without a real error message
---
scheduler.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/scheduler.py b/scheduler.py
index e246732..6127f6c 100644
--- a/scheduler.py
+++ b/scheduler.py
@@ -155,6 +155,8 @@ class TestScheduler:
return
# If we BUILT a circuit to this router, it is not unreachable.
+ # TODO: But it could still be that all streams through it fail,
+ # with inconclusive error messages. We have to handle that!
router.unreachable = False
# If we succeeded in building this router on retry,
# reset its failure count to give it a clean slate.
1
0