[tor-commits] [translation/tor-launcher-properties_completed] Update translations for tor-launcher-properties_completed
commit f08a8f735d205fb53b7fb0ea63968bb02991c815 Author: Translation commit bot translat...@torproject.org Date: Tue Aug 12 06:45:58 2014 + Update translations for tor-launcher-properties_completed --- fa/torlauncher.properties |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fa/torlauncher.properties b/fa/torlauncher.properties index 95847d8..ab718b4 100644 --- a/fa/torlauncher.properties +++ b/fa/torlauncher.properties @@ -4,7 +4,7 @@ torlauncher.error_title=اجرا Ú©ÙÙد٠تÙر torlauncher.tor_exited=تÙر بÙâدÙÛÙÛ Ùا٠شخص خارج شد. -torlauncher.please_restart_app=ÙØ·Ùا Ùر٠اÙزار را ٠جددا را٠اÙØ¯Ø§Ø²Û Ù٠اÛÛد. +torlauncher.tor_connection_lost=ت٠اس ش٠ا با شبک٠تÙر Ùطع شد٠است. torlauncher.tor_controlconn_failed=اتصا٠ب٠پÙرت Ú©Ùتر٠تÙر ا٠کا٠پذÛر ÙÙ Ûâباشد. torlauncher.tor_failed_to_start=خطا در را٠اÙدازÛ. torlauncher.tor_control_failed=بÙâدست گرÙت٠کÙتر٠تÙر Ùا٠ÙÙ٠بÙد. @@ -30,6 +30,7 @@ torlauncher.error_bridge_bad_default_type=ÙÛÚ Ù¾ÙÛ Ø§Ø² ÙÙع %S Ù Ùج٠torlauncher.recommended_bridge=(تÙصÛ٠شدÙ) torlauncher.connect=اتصا٠+torlauncher.reconnect=دÙباد٠Ùص٠کÙÛد. torlauncher.quit=خرÙج torlauncher.quit_win=خرÙج torlauncher.done=اÙجا٠شد ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-launcher-network-settings_completed] Update translations for tor-launcher-network-settings_completed
commit e7036c78a7a37e5df80c3b162f481a15e2091afd Author: Translation commit bot translat...@torproject.org Date: Tue Aug 12 06:46:09 2014 + Update translations for tor-launcher-network-settings_completed --- fa/network-settings.dtd |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fa/network-settings.dtd b/fa/network-settings.dtd index 919fa83..4cd68f8 100644 --- a/fa/network-settings.dtd +++ b/fa/network-settings.dtd @@ -29,7 +29,7 @@ !-- Other: -- !ENTITY torsettings.startingTor در اÙتظار آغاز ب٠کار تÙر... -!ENTITY torsettings.restart شرÙع دÙبار٠+!ENTITY torsettings.restartTor تÙر را دÙبار٠شÙرÙع Ú©ÙÛد. !ENTITY torsettings.optional اختÛØ§Ø±Û ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-launcher-network-settings] Update translations for tor-launcher-network-settings
commit 1dc50722cca57c794b0dc987f4542b63a51493a2 Author: Translation commit bot translat...@torproject.org Date: Tue Aug 12 06:46:06 2014 + Update translations for tor-launcher-network-settings --- fa/network-settings.dtd |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fa/network-settings.dtd b/fa/network-settings.dtd index 136acea..4cd68f8 100644 --- a/fa/network-settings.dtd +++ b/fa/network-settings.dtd @@ -29,7 +29,7 @@ !-- Other: -- !ENTITY torsettings.startingTor در اÙتظار آغاز ب٠کار تÙر... -!ENTITY torsettings.restartTor Restart Tor +!ENTITY torsettings.restartTor تÙر را دÙبار٠شÙرÙع Ú©ÙÛد. !ENTITY torsettings.optional اختÛØ§Ø±Û ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-launcher-properties] Update translations for tor-launcher-properties
commit be61b0546ab94064ba3ce168b7ed0003e03780a8 Author: Translation commit bot translat...@torproject.org Date: Tue Aug 12 06:45:54 2014 + Update translations for tor-launcher-properties --- fa/torlauncher.properties |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fa/torlauncher.properties b/fa/torlauncher.properties index 18906ed..ab718b4 100644 --- a/fa/torlauncher.properties +++ b/fa/torlauncher.properties @@ -4,7 +4,7 @@ torlauncher.error_title=اجرا Ú©ÙÙد٠تÙر torlauncher.tor_exited=تÙر بÙâدÙÛÙÛ Ùا٠شخص خارج شد. -torlauncher.tor_connection_lost=Your connection to the Tor Network has been lost. +torlauncher.tor_connection_lost=ت٠اس ش٠ا با شبک٠تÙر Ùطع شد٠است. torlauncher.tor_controlconn_failed=اتصا٠ب٠پÙرت Ú©Ùتر٠تÙر ا٠کا٠پذÛر ÙÙ Ûâباشد. torlauncher.tor_failed_to_start=خطا در را٠اÙدازÛ. torlauncher.tor_control_failed=بÙâدست گرÙت٠کÙتر٠تÙر Ùا٠ÙÙ٠بÙد. @@ -30,7 +30,7 @@ torlauncher.error_bridge_bad_default_type=ÙÛÚ Ù¾ÙÛ Ø§Ø² ÙÙع %S Ù Ùج٠torlauncher.recommended_bridge=(تÙصÛ٠شدÙ) torlauncher.connect=اتصا٠-torlauncher.reconnect=Reconnect +torlauncher.reconnect=دÙباد٠Ùص٠کÙÛد. torlauncher.quit=خرÙج torlauncher.quit_win=خرÙج torlauncher.done=اÙجا٠شد ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tails-greeter] Update translations for tails-greeter
commit 629f185d90e179a94100913e9b2d1a712f16102e Author: Translation commit bot translat...@torproject.org Date: Tue Aug 12 06:45:36 2014 + Update translations for tails-greeter --- fa/fa.po |9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fa/fa.po b/fa/fa.po index 4bb9878..df9fe46 100644 --- a/fa/fa.po +++ b/fa/fa.po @@ -7,14 +7,15 @@ # Mohammad Hossein desm...@gmail.com, 2014 # Gilberto, 2014 # zendegi hamaha...@posteo.eu, 2013 +# johnholzer johnholtzer...@gmail.com, 2014 # Mohammad Hossein desm...@gmail.com, 2014 msgid msgstr Project-Id-Version: The Tor Project\n Report-Msgid-Bugs-To: \n -POT-Creation-Date: 2014-06-11 16:20+0200\n -PO-Revision-Date: 2014-06-24 14:21+\n -Last-Translator: Mohammad Hossein desm...@gmail.com\n +POT-Creation-Date: 2014-07-20 18:36+0200\n +PO-Revision-Date: 2014-08-12 06:30+\n +Last-Translator: johnholzer johnholtzer...@gmail.com\n Language-Team: Persian (http://www.transifex.com/projects/p/torproject/language/fa/)\n MIME-Version: 1.0\n Content-Type: text/plain; charset=UTF-8\n @@ -24,7 +25,7 @@ msgstr #: ../glade/persistencewindow.glade.h:1 msgid Forward -msgstr Forward +msgstr ب٠س٠ت جÙÙ #: ../glade/persistencewindow.glade.h:2 ../glade/optionswindow.glade.h:1 msgid Login ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tails-greeter_completed] Update translations for tails-greeter_completed
commit 5b461fd308a62353083e591c5e93975352e76407 Author: Translation commit bot translat...@torproject.org Date: Tue Aug 12 06:45:42 2014 + Update translations for tails-greeter_completed --- fa/fa.po |9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fa/fa.po b/fa/fa.po index 4bb9878..df9fe46 100644 --- a/fa/fa.po +++ b/fa/fa.po @@ -7,14 +7,15 @@ # Mohammad Hossein desm...@gmail.com, 2014 # Gilberto, 2014 # zendegi hamaha...@posteo.eu, 2013 +# johnholzer johnholtzer...@gmail.com, 2014 # Mohammad Hossein desm...@gmail.com, 2014 msgid msgstr Project-Id-Version: The Tor Project\n Report-Msgid-Bugs-To: \n -POT-Creation-Date: 2014-06-11 16:20+0200\n -PO-Revision-Date: 2014-06-24 14:21+\n -Last-Translator: Mohammad Hossein desm...@gmail.com\n +POT-Creation-Date: 2014-07-20 18:36+0200\n +PO-Revision-Date: 2014-08-12 06:30+\n +Last-Translator: johnholzer johnholtzer...@gmail.com\n Language-Team: Persian (http://www.transifex.com/projects/p/torproject/language/fa/)\n MIME-Version: 1.0\n Content-Type: text/plain; charset=UTF-8\n @@ -24,7 +25,7 @@ msgstr #: ../glade/persistencewindow.glade.h:1 msgid Forward -msgstr Forward +msgstr ب٠س٠ت جÙÙ #: ../glade/persistencewindow.glade.h:2 ../glade/optionswindow.glade.h:1 msgid Login ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tails-greeter] Update translations for tails-greeter
commit 13aabbdae398174580a2f5ca4b10ae8c0d4b2957 Author: Translation commit bot translat...@torproject.org Date: Tue Aug 12 11:15:21 2014 + Update translations for tails-greeter --- fa/fa.po |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fa/fa.po b/fa/fa.po index df9fe46..41770c2 100644 --- a/fa/fa.po +++ b/fa/fa.po @@ -14,7 +14,7 @@ msgstr Project-Id-Version: The Tor Project\n Report-Msgid-Bugs-To: \n POT-Creation-Date: 2014-07-20 18:36+0200\n -PO-Revision-Date: 2014-08-12 06:30+\n +PO-Revision-Date: 2014-08-12 11:06+\n Last-Translator: johnholzer johnholtzer...@gmail.com\n Language-Team: Persian (http://www.transifex.com/projects/p/torproject/language/fa/)\n MIME-Version: 1.0\n ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tails-greeter_completed] Update translations for tails-greeter_completed
commit 2d0b2645fa4608fd32a29cf3b1e03301993add0a Author: Translation commit bot translat...@torproject.org Date: Tue Aug 12 11:15:25 2014 + Update translations for tails-greeter_completed --- fa/fa.po |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fa/fa.po b/fa/fa.po index df9fe46..41770c2 100644 --- a/fa/fa.po +++ b/fa/fa.po @@ -14,7 +14,7 @@ msgstr Project-Id-Version: The Tor Project\n Report-Msgid-Bugs-To: \n POT-Creation-Date: 2014-07-20 18:36+0200\n -PO-Revision-Date: 2014-08-12 06:30+\n +PO-Revision-Date: 2014-08-12 11:06+\n Last-Translator: johnholzer johnholtzer...@gmail.com\n Language-Team: Persian (http://www.transifex.com/projects/p/torproject/language/fa/)\n MIME-Version: 1.0\n ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] r26914: {website} Remove obsolete statement about working on Chrome APIs in th (website/trunk/docs/en)
Author: lunar Date: 2014-08-12 11:16:13 + (Tue, 12 Aug 2014) New Revision: 26914 Modified: website/trunk/docs/en/faq.wml Log: Remove obsolete statement about working on Chrome APIs in the FAQ The answer is still probably not optimal, but previously it was misleading. Wording courtesy of Sebastian. Modified: website/trunk/docs/en/faq.wml === --- website/trunk/docs/en/faq.wml 2014-08-07 18:15:54 UTC (rev 26913) +++ website/trunk/docs/en/faq.wml 2014-08-12 11:16:13 UTC (rev 26914) @@ -1277,15 +1277,16 @@ Chrome/IE/Opera/etc with Tor./a/h3 p -In short, using any browser besides Tor Browser Bundle with Tor is a +In short, using any browser besides Tor Browser with Tor is a really bad idea. /p p -We're working with the Chrome team to a -href=https://blog.torproject.org/blog/google-chrome-incognito-mode-tor-and-fingerprinting;fix some bugs and missing APIs in Chrome/a so it -will be possible to write a Torbutton for Chrome. No support for any -other browser is on the horizon. +Our efforts to work with the Chrome team to a +href=https://blog.torproject.org/blog/google-chrome-incognito-mode-tor-and-fingerprinting;add +missing APIs/a were unsuccessful, unfortunately. Currently, it is impossible +to use other browsers and get the same level of protections as when using the +Tor Browser. /p hr ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [onionoo/master] Add performance metrics to the servlet.
commit 4ac8773be3c5d2296fd3ae293427a33f42d9fe7d Author: Karsten Loesing karsten.loes...@gmx.net Date: Tue Aug 12 09:41:47 2014 +0200 Add performance metrics to the servlet. Implements #12655. --- .../onionoo/server/PerformanceMetrics.java | 198 +++ .../torproject/onionoo/server/ResourceServlet.java | 12 ++ .../torproject/onionoo/server/ResponseBuilder.java | 27 ++- .../onionoo/server/PerformanceMetricsTest.java | 199 4 files changed, 430 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/torproject/onionoo/server/PerformanceMetrics.java b/src/main/java/org/torproject/onionoo/server/PerformanceMetrics.java new file mode 100644 index 000..5f780d9 --- /dev/null +++ b/src/main/java/org/torproject/onionoo/server/PerformanceMetrics.java @@ -0,0 +1,198 @@ +/* Copyright 2014 The Tor Project + * See LICENSE for licensing information */ +package org.torproject.onionoo.server; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.SortedMap; +import java.util.SortedSet; +import java.util.TreeMap; +import java.util.TreeSet; + +import org.torproject.onionoo.util.ApplicationFactory; +import org.torproject.onionoo.util.DateTimeHelper; +import org.torproject.onionoo.util.Time; + +class Counter { + int value = 0; + void increment() { +this.value++; + } + public String toString() { +return String.valueOf(this.value); + } + void clear() { +this.value = 0; + } +} + +class MostFrequentString { + MapString, Integer stringFrequencies = new HashMapString, Integer(); + void addString(String string) { +if (!this.stringFrequencies.containsKey(string)) { + this.stringFrequencies.put(string, 1); +} else { + this.stringFrequencies.put(string, + this.stringFrequencies.get(string) + 1); +} + } + public String toString() { +SortedMapInteger, SortedSetString sortedFrequencies = +new TreeMapInteger, SortedSetString( +Collections.reverseOrder()); +if (this.stringFrequencies.isEmpty()) { + return null (0); +} +for (Map.EntryString, Integer e : stringFrequencies.entrySet()) { + if (!sortedFrequencies.containsKey(e.getValue())) { +sortedFrequencies.put(e.getValue(), new TreeSetString( +Arrays.asList(new String[] { e.getKey() } ))); + } else { +sortedFrequencies.get(e.getValue()).add(e.getKey()); + } +} +StringBuilder sb = new StringBuilder(); +int stringsToAdd = 3, written = 0; +for (Map.EntryInteger, SortedSetString e : +sortedFrequencies.entrySet()) { + for (String string : e.getValue()) { +if (stringsToAdd-- 0) { + sb.append((written++ 0 ? , : ) + string + ( + + e.getKey() + )); +} + } + if (stringsToAdd == 0) { +break; + } +} +return sb.toString(); + } + void clear() { +this.stringFrequencies.clear(); + } +} + +class IntegerDistribution { + int[] logValues = new int[64]; + void addLong(long value) { +logValues[64 - Long.numberOfLeadingZeros(value)]++; + } + public String toString() { +StringBuilder sb = new StringBuilder(); +int totalValues = 0; +for (int i = 0; i logValues.length; i++) { + totalValues += logValues[i]; +} +int[] permilles = new int[] { 500, 900, 990, 999 }; +if (totalValues 0) { + int seenValues = 0; + for (int i = 0, j = 0; i logValues.length; i++) { +seenValues += logValues[i]; +while (j permilles.length +(seenValues * 1000 totalValues * permilles[j])) { + sb.append((j 0 ? , : ) + . + permilles[j] + + (i logValues.length - 1 ? + (1L i) + : = + (1L i - 1))); + j++; +} +if (j == permilles.length) { + break; +} + } +} else { + for (int j = 0; j permilles.length; j++) { +sb.append((j 0 ? , : ) + . + permilles[j] + null); + } +} +return sb.toString(); + } + void clear() { +Arrays.fill(logValues, 0, logValues.length - 1, 0); + } +} + +public class PerformanceMetrics { + + private static final Object lock = new Object(); + + private static Time time; + + private static long lastLoggedMillis = -1L; + + private static final long LOG_INTERVAL = DateTimeHelper.ONE_HOUR; + + private static Counter totalProcessedRequests = new Counter(); + + private static MostFrequentString + requestsByResourceType = new MostFrequentString(), + requestsByParameters = new MostFrequentString(); + + private static IntegerDistribution + matchingRelayDocuments = new IntegerDistribution(), + matchingBridgeDocuments = new IntegerDistribution(), + writtenChars = new IntegerDistribution(), + handleRequestMillis = new IntegerDistribution(), + buildResponseMillis = new
[tor-commits] [onionoo/master] Fix confusing log message.
commit bea10398addff8baa09f7490a7d60edb5f42e7a7 Author: Karsten Loesing karsten.loes...@gmx.net Date: Tue Aug 12 16:04:15 2014 +0200 Fix confusing log message. --- src/main/java/org/torproject/onionoo/server/PerformanceMetrics.java |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/torproject/onionoo/server/PerformanceMetrics.java b/src/main/java/org/torproject/onionoo/server/PerformanceMetrics.java index 5f780d9..c7fc7f9 100644 --- a/src/main/java/org/torproject/onionoo/server/PerformanceMetrics.java +++ b/src/main/java/org/torproject/onionoo/server/PerformanceMetrics.java @@ -152,7 +152,7 @@ public class PerformanceMetrics { LOG_INTERVAL) { System.err.println(Request statistics ( + DateTimeHelper.format(lastLoggedMillis + LOG_INTERVAL) -+ , + LOG_INTERVAL + s):); ++ , + (LOG_INTERVAL / DateTimeHelper.ONE_SECOND) + s):); System.err.println( Total processed requests: + totalProcessedRequests); System.err.println( Most frequently requested resource: ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [onionoo/master] Allow robots to index the .html files.
commit f5b85859b09ff8164acc82dbea27fb15cb713bc8 Author: Karsten Loesing karsten.loes...@gmx.net Date: Tue Aug 12 16:15:27 2014 +0200 Allow robots to index the .html files. --- web/robots.txt |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/robots.txt b/web/robots.txt index 6ffbc30..9b19f8f 100644 --- a/web/robots.txt +++ b/web/robots.txt @@ -1,3 +1,8 @@ User-agent: * -Disallow: / +Disallow: /summary +Disallow: /details +Disallow: /bandwidth +Disallow: /weights +Disallow: /clients +Disallow: /uptime ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] r26915: {website} update torbrowser website tables to include alpha bundles (website/trunk/projects/en)
Author: erinn Date: 2014-08-12 16:32:36 + (Tue, 12 Aug 2014) New Revision: 26915 Modified: website/trunk/projects/en/torbrowser.wml Log: update torbrowser website tables to include alpha bundles Modified: website/trunk/projects/en/torbrowser.wml === --- website/trunk/projects/en/torbrowser.wml2014-08-12 11:16:13 UTC (rev 26914) +++ website/trunk/projects/en/torbrowser.wml2014-08-12 16:32:36 UTC (rev 26915) @@ -299,6 +299,217 @@ /tbody /table /div +!-- alpha bundles -- + div class=dltable style=margin-top: -35px; +table + thead +tr + thbrLanguage/th + thMicrosoft Windowsbrem(version-torbrowserbundlebeta)/em/th + thMac OS Xbrem(version-torbrowserbundleosx32beta)/em/th + thLinuxbrem(version-torbrowserbundlelinux32beta)/em/th +/tr + /thead + tbody +tr + tdEnglish (en-US)/td + tda href=../dist/torbrowser/version-torbrowserbundlebetadir/torbrowser-install-version-torbrowserbundlebeta_en-US.exe32/64-bit/a + em(a href=../dist/torbrowser/version-torbrowserbundlebetadir/torbrowser-install-version-torbrowserbundlebeta_en-US.exe.ascsig/a)/em/td + tda href=../dist/torbrowser/version-torbrowserbundlebetadir/TorBrowser-version-torbrowserbundleosx32beta-osx32_en-US.dmg32-bit/a + em(a href=../dist/torbrowser/version-torbrowserbundlebetadir/TorBrowser-version-torbrowserbundleosx32beta-osx32_en-US.dmg.ascsig/a)/em + !-- ECbull; a href=../dist/torbrowser/version-torbrowserbundlebetadir/TorBrowser-version-torbrowserbundleosx64-osx-x86_64-en-US.zip64-bit/a + em(a href=../dist/torbrowser/version-torbrowserbundlebetadir/TorBrowser-version-torbrowserbundleosx64-osx-x86_64-en-US.zip.ascsig/a)/em/td -- + tda href=../dist/torbrowser/version-torbrowserbundlebetadir/tor-browser-linux32-version-torbrowserbundlelinux32beta_en-US.tar.xz32-bit/a + em(a href=../dist/torbrowser/version-torbrowserbundlebetadir/tor-browser-linux32-version-torbrowserbundlelinux32beta_en-US.tar.xz.ascsig/a)/em + bull; a href=../dist/torbrowser/version-torbrowserbundlebetadir/tor-browser-linux64-version-torbrowserbundlelinux64beta_en-US.tar.xz64-bit/a + em(a href=../dist/torbrowser/version-torbrowserbundlebetadir/tor-browser-linux64-version-torbrowserbundlelinux64beta_en-US.tar.xz.ascsig/a)/em/td +/tr +tr class=alt + td#x0627;#x0644;#x0639;#x0631;#x0628;#x064a;#x0629; (ar)/td + tda href=../dist/torbrowser/version-torbrowserbundlebetadir/torbrowser-install-version-torbrowserbundlebeta_ar.exe32/64-bit/a + em(a href=../dist/torbrowser/version-torbrowserbundlebetadir/torbrowser-install-version-torbrowserbundlebeta_ar.exe.ascsig/a)/em/td + tda href=../dist/torbrowser/version-torbrowserbundlebetadir/TorBrowser-version-torbrowserbundleosx32beta-osx32_ar.dmg32-bit/a + em(a href=../dist/torbrowser/version-torbrowserbundlebetadir/TorBrowser-version-torbrowserbundleosx32beta-osx32_ar.dmg.ascsig/a)/em + !-- ECbull; a href=../dist/torbrowser/version-torbrowserbundlebetadir/TorBrowser-version-torbrowserbundleosx64-osx-x86_64-ar.zip64-bit/a + em(a href=../dist/torbrowser/version-torbrowserbundlebetadir/TorBrowser-version-torbrowserbundleosx64-osx-x86_64-ar.zip.ascsig/a)/em/td -- + tda href=../dist/torbrowser/version-torbrowserbundlebetadir/tor-browser-linux32-version-torbrowserbundlelinux32beta_ar.tar.xz32-bit/a + em(a href=../dist/torbrowser/version-torbrowserbundlebetadir/tor-browser-linux32-version-torbrowserbundlelinux32beta_ar.tar.xz.ascsig/a)/em + bull; a href=../dist/torbrowser/version-torbrowserbundlebetadir/tor-browser-linux64-version-torbrowserbundlelinux64beta_ar.tar.xz64-bit/a + em(a href=../dist/torbrowser/version-torbrowserbundlebetadir/tor-browser-linux64-version-torbrowserbundlelinux64beta_ar.tar.xz.ascsig/a)/em/td +/tr +tr + tdDeutsch (de)/td + tda href=../dist/torbrowser/version-torbrowserbundlebetadir/torbrowser-install-version-torbrowserbundlebeta_de.exe32/64-bit/a + em(a href=../dist/torbrowser/version-torbrowserbundlebetadir/torbrowser-install-version-torbrowserbundlebeta_de.exe.ascsig/a)/em/td + tda href=../dist/torbrowser/version-torbrowserbundlebetadir/TorBrowser-version-torbrowserbundleosx32beta-osx32_de.dmg32-bit/a + em(a href=../dist/torbrowser/version-torbrowserbundlebetadir/TorBrowser-version-torbrowserbundleosx32beta-osx32_de.dmg.ascsig/a)/em + !-- EC bull; a href=../dist/torbrowser/version-torbrowserbundlebetadir/TorBrowser-version-torbrowserbundleosx64-osx-x86_64-de.zip64-bit/a + em(a
[tor-commits] r26916: {website} update versions for TB 3.6.4 and 4.0-alpha-1 and finish upda (in website/trunk: include projects/en)
Author: erinn Date: 2014-08-12 17:56:25 + (Tue, 12 Aug 2014) New Revision: 26916 Modified: website/trunk/include/versions.wmi website/trunk/projects/en/torbrowser.wml Log: update versions for TB 3.6.4 and 4.0-alpha-1 and finish updating the torbrowser page Modified: website/trunk/include/versions.wmi === --- website/trunk/include/versions.wmi 2014-08-12 16:32:36 UTC (rev 26915) +++ website/trunk/include/versions.wmi 2014-08-12 17:56:25 UTC (rev 26916) @@ -23,11 +23,11 @@ define-tag version-osx-ppc-stable whitespace=delete0.2.3.25/define-tag define-tag version-osx-ppc-alpha whitespace=delete0.2.4.17-rc/define-tag -define-tag version-torbrowserbundledir whitespace=delete3.6.3/define-tag -define-tag version-torbrowserbundlebetadir whitespace=delete3.6.3/define-tag +define-tag version-torbrowserbundledir whitespace=delete3.6.4/define-tag +define-tag version-torbrowserbundlebetadir whitespace=delete3.6.4/define-tag -define-tag version-torbrowserbundle whitespace=delete3.6.3/define-tag -define-tag version-torbrowserbundlebeta whitespace=delete3.6-beta-2/define-tag +define-tag version-torbrowserbundle whitespace=delete3.6.4/define-tag +define-tag version-torbrowserbundlebeta whitespace=delete4.0-alpha-1/define-tag define-tag version-torbrowser-tor whitespace=delete0.2.4.19/define-tag define-tag version-torbrowser-tor-components whitespace=deletelibevent-2.0.21-stable, zlib-1.2.8, openssl-1.0.1e/define-tag define-tag version-torbrowser-firefox whitespace=delete24.2.0esr/define-tag @@ -37,19 +37,19 @@ define-tag version-torbrowser-vidalia whitespace=delete0.2.21/define-tag define-tag version-torimbrowserbundle whitespace=delete1.3.21/define-tag -define-tag version-torbrowserbundlelinux32 whitespace=delete3.6.3/define-tag -define-tag version-torbrowserbundlelinux64 whitespace=delete3.6.3/define-tag -define-tag version-torbrowserbundlelinux32beta whitespace=delete3.6-beta-2/define-tag -define-tag version-torbrowserbundlelinux64beta whitespace=delete3.6-beta-2/define-tag +define-tag version-torbrowserbundlelinux32 whitespace=delete3.6.4/define-tag +define-tag version-torbrowserbundlelinux64 whitespace=delete3.6.4/define-tag +define-tag version-torbrowserbundlelinux32beta whitespace=delete4.0-alpha-1/define-tag +define-tag version-torbrowserbundlelinux64beta whitespace=delete4.0-alpha-1/define-tag define-tag version-gnu-torbrowser-tor whitespace=delete0.2.4.19/define-tag define-tag version-gnu-torbrowser-tor-components whitespace=deletelibevent-2.0.21-stable, zlib-1.2.8, openssl-1.0.0k/define-tag define-tag version-gnu-torbrowser-firefox whitespace=delete24.2.0esr/define-tag define-tag version-gnu-torbrowser-torbutton whitespace=delete1.5.2/define-tag define-tag version-gnu-torbrowser-vidalia whitespace=delete0.2.21/define-tag -define-tag version-torbrowserbundleosx32 whitespace=delete3.6.3/define-tag +define-tag version-torbrowserbundleosx32 whitespace=delete3.6.4/define-tag define-tag version-torbrowserbundleosx64 whitespace=delete2.3.25-15/define-tag -define-tag version-torbrowserbundleosx32beta whitespace=delete3.6-beta-2/define-tag +define-tag version-torbrowserbundleosx32beta whitespace=delete4.0-alpha-1/define-tag define-tag version-osx-torbrowser-tor whitespace=delete0.2.4.19/define-tag define-tag version-osx-torbrowser-firefox whitespace=delete24.2.0esr/define-tag define-tag version-osx-torbrowser-torbutton whitespace=delete1.5.2/define-tag Modified: website/trunk/projects/en/torbrowser.wml === --- website/trunk/projects/en/torbrowser.wml2014-08-12 16:32:36 UTC (rev 26915) +++ website/trunk/projects/en/torbrowser.wml2014-08-12 17:56:25 UTC (rev 26916) @@ -89,6 +89,8 @@ for your preferred language. This file can be saved wherever is convenient, e.g. the Desktop or a USB flash drive./p/div +p/p +centerh3Stable Tor Browser/h3/center div class=pjtext div class=dltable style=margin-top: -35px; table @@ -299,7 +301,18 @@ /tbody /table /div + /div +pSee our instructions on a href=page docs/verifying-signatureshow to verify package signatures/a, + which allows you to make sure you've downloaded the file we intended + you to get. Also, note that the Firefox ESR in our bundles is + a href=https://gitweb.torproject.org/torbrowser.git/tree/HEAD:/build-scripts/config/;modified/a from the a + href=https://www.mozilla.org/en-US/firefox/organizations/;default + Firefox ESR/a/p !-- alpha bundles -- +hr +p/p +centerh3Experimental Tor Browser/h3/center + div class=pjtext div class=dltable style=margin-top: -35px; table thead @@ -509,13 +522,7 @@ /tbody /table /div - - pSee our instructions on a href=page docs/verifying-signatureshow to verify package
[tor-commits] r26917: {website} fix torbrowserbundlebetadir version (website/trunk/include)
Author: erinn Date: 2014-08-12 17:59:07 + (Tue, 12 Aug 2014) New Revision: 26917 Modified: website/trunk/include/versions.wmi Log: fix torbrowserbundlebetadir version Modified: website/trunk/include/versions.wmi === --- website/trunk/include/versions.wmi 2014-08-12 17:56:25 UTC (rev 26916) +++ website/trunk/include/versions.wmi 2014-08-12 17:59:07 UTC (rev 26917) @@ -24,7 +24,7 @@ define-tag version-osx-ppc-alpha whitespace=delete0.2.4.17-rc/define-tag define-tag version-torbrowserbundledir whitespace=delete3.6.4/define-tag -define-tag version-torbrowserbundlebetadir whitespace=delete3.6.4/define-tag +define-tag version-torbrowserbundlebetadir whitespace=delete4.0-alpha-1/define-tag define-tag version-torbrowserbundle whitespace=delete3.6.4/define-tag define-tag version-torbrowserbundlebeta whitespace=delete4.0-alpha-1/define-tag ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [ooni-probe/master] Add details on how to contribute to the README.md
commit 137ddd824694f12686dab3c4c130334653f2c756 Author: Arturo Filastò a...@fuffa.org Date: Tue Aug 12 20:07:33 2014 +0200 Add details on how to contribute to the README.md This closes https://trac.torproject.org/projects/tor/ticket/11980 --- README.md | 24 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 5f07069..28c895c 100644 --- a/README.md +++ b/README.md @@ -232,3 +232,27 @@ tracker [filing them under the Ooni component](https://trac.torproject.org/pro You can either register an account or use the group account cypherpunks with password writecode. +## Contributing + +You can download the code for ooniprobe from the following git repository: + +``` +git clone https://git.torproject.org/ooni-probe.git +``` + +It is also viewable on the web via [https://gitweb.torproject.org/ooni-probe.git](https://git.torproject.org/ooni-probe.git). + +You should then submit patches for review as pull requests to this github repository: + +https://github.com/TheTorProject/ooni-probe + +Read this article to learn how to [create a pull request on github](https://help.github.com/articles/creating-a-pull-request). + +If you prefer not to use github (or don't have an account), you may also submit +patches as attachments to tickets. + +Be sure to format the patch (given that you are working on a feature branch that is different from master) with: + +``` +git format-patch master --stdout my_first_ooniprobe.patch +``` ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [ooni-probe/master] Pep8 fixes
commit 49150087dded2885a9eb17d07c436fefe06c9104 Author: Arturo Filastò a...@fuffa.org Date: Sun Aug 10 20:10:54 2014 +0200 Pep8 fixes --- ooni/templates/scapyt.py | 35 +-- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/ooni/templates/scapyt.py b/ooni/templates/scapyt.py index c6dedd7..925a9d6 100644 --- a/ooni/templates/scapyt.py +++ b/ooni/templates/scapyt.py @@ -1,26 +1,23 @@ -import random -from zope.interface import implements -from twisted.plugin import IPlugin -from twisted.internet import protocol, defer, threads - -from scapy.all import send, sr, IP, TCP, config - -from ooni.reporter import createPacketReport from ooni.nettest import NetTestCase from ooni.utils import log from ooni.settings import config -from ooni.utils.txscapy import ScapySender, getDefaultIface, ScapyFactory +from ooni.utils.txscapy import ScapySender, ScapyFactory from ooni.utils.txscapy import hasRawSocketPermission class BaseScapyTest(NetTestCase): + The report of a test run with scapy looks like this: report: -sent_packets: [{'raw_packet': BASE64Encoding of packet, -'summary': 'IP / TCP 192.168.2.66:ftp_data 8.8.8.8:http S'}] +sent_packets: [ +{ +'raw_packet': BASE64Encoding of packet, +'summary': 'IP / TCP 192.168.2.66:ftp_data 8.8.8.8:http S' +} +] answered_packets: [] @@ -31,12 +28,12 @@ class BaseScapyTest(NetTestCase): requiresRoot = not hasRawSocketPermission() baseFlags = [ ['ipsrc', 's', - 'Does *not* check if IP src and ICMP IP citation matches when processing answers'], + 'Does *not* check if IP src and ICMP IP citation ' + 'matches when processing answers'], ['seqack', 'k', - 'Check if TCP sequence number and ACK match in the ICMP citation when processing answers'], -['ipid', 'i', - 'Check if the IPID matches when processing answers'] -] + 'Check if TCP sequence number and ACK match in the ' + 'ICMP citation when processing answers'], +['ipid', 'i', 'Check if the IPID matches when processing answers']] def _setUp(self): super(BaseScapyTest, self)._setUp() @@ -84,8 +81,10 @@ class BaseScapyTest(NetTestCase): received_packet = rcv if not config.privacy.includeip: -log.debug(Detected you would not like to include your ip in the report) -log.debug(Stripping source and destination IPs from the reports) +log.debug(Detected you would not like to + include your ip in the report) +log.debug( +Stripping source and destination IPs from the reports) sent_packet.src = '127.0.0.1' received_packet.dst = '127.0.0.1' ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [ooni-probe/master] Fix a bug that lead ooniprobe to require root when set_pcap was not used.
commit ba88ae7622f86a9ebe8a4af8d1825daf3ff78aab Author: Arturo Filastò a...@fuffa.org Date: Sun Aug 10 20:01:47 2014 +0200 Fix a bug that lead ooniprobe to require root when set_pcap was not used. --- ooni/director.py |5 - ooni/oonicli.py |2 +- ooni/templates/scapyt.py |4 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ooni/director.py b/ooni/director.py index d81010a..43269cc 100644 --- a/ooni/director.py +++ b/ooni/director.py @@ -265,7 +265,10 @@ class Director(object): Start sniffing with Scapy. Exits if required privileges (root) are not available. -from ooni.utils.txscapy import ScapySniffer +from ooni.utils.txscapy import ScapySniffer, ScapyFactory + +if config.scapyFactory is None: +config.scapyFactory = ScapyFactory(config.advanced.interface) if not config.reports.pcap: prefix = 'report' diff --git a/ooni/oonicli.py b/ooni/oonicli.py index 2320dec..eef3112 100644 --- a/ooni/oonicli.py +++ b/ooni/oonicli.py @@ -125,10 +125,10 @@ def runWithDirector(logging=True, start_tor=True, check_incoherences=True): if logging: log.start(global_options['logfile']) -config.scapyFactory = ScapyFactory(config.advanced.interface) if config.privacy.includepcap: try: checkForRoot() +config.scapyFactory = ScapyFactory(config.advanced.interface) except errors.InsufficientPrivileges: log.err(Insufficient Privileges to capture packets. See ooniprobe.conf privacy.includepcap) diff --git a/ooni/templates/scapyt.py b/ooni/templates/scapyt.py index d99ea3f..c6dedd7 100644 --- a/ooni/templates/scapyt.py +++ b/ooni/templates/scapyt.py @@ -41,6 +41,10 @@ class BaseScapyTest(NetTestCase): def _setUp(self): super(BaseScapyTest, self)._setUp() +if config.scapyFactory is None: +log.debug(Scapy factory not set, registering it.) +config.scapyFactory = ScapyFactory(config.advanced.interface) + self.report['answer_flags'] = [] if self.localOptions['ipsrc']: config.checkIPsrc = 0 ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [ooni-probe/master] Add rsync support to doc Makefile
commit b2a05794f32510fa79b7811685f30d882531993d Author: Arturo Filastò a...@fuffa.org Date: Sun Aug 10 20:11:15 2014 +0200 Add rsync support to doc Makefile --- docs/Makefile |8 1 file changed, 8 insertions(+) diff --git a/docs/Makefile b/docs/Makefile index 9ee92b1..b9582d9 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -14,6 +14,11 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) sou # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source +SSH_HOST=staticiforme.torproject.org +SSH_PORT=22 +SSH_USER=art +SSH_TARGET_DIR=/home/art/docs/ + .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext help: @@ -151,3 +156,6 @@ doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo Testing of doctests in the sources finished, look at the \ results in $(BUILDDIR)/doctest/output.txt. + +rsync_upload: + rsync -e ssh -p $(SSH_PORT) -P -rvz $(BUILDDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] r26918: {website} Add a downloads-alpha anchor. (website/trunk/projects/en)
Author: mikeperry Date: 2014-08-13 00:28:37 + (Wed, 13 Aug 2014) New Revision: 26918 Modified: website/trunk/projects/en/torbrowser.wml Log: Add a downloads-alpha anchor. Modified: website/trunk/projects/en/torbrowser.wml === --- website/trunk/projects/en/torbrowser.wml2014-08-12 17:59:07 UTC (rev 26917) +++ website/trunk/projects/en/torbrowser.wml2014-08-13 00:28:37 UTC (rev 26918) @@ -311,6 +311,7 @@ !-- alpha bundles -- hr p/p +div id=downloads-alpha class=anchor/div centerh3Experimental Tor Browser/h3/center div class=pjtext div class=dltable style=margin-top: -35px; ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] Copy captchas/ into run/ during 'before_script' .travis.yml section.
commit c6ec7e51792029a28f1c31809e35a1c6f7e47bde Author: Isis Lovecruft i...@torproject.org Date: Thu Aug 7 06:27:56 2014 + Copy captchas/ into run/ during 'before_script' .travis.yml section. --- .travis.yml |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e664a26..d8edafb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,7 +49,7 @@ install: # Start a BridgeDB instance before running the tests: before_script: - mkdir run - - cp -t run bridgedb.conf + - cp -R -t run bridgedb.conf captchas - leekspin -n 100 - cp -t run networkstatus-bridges cached-extrainfo* bridge-descriptors - ./scripts/make-ssl-cert ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] Bump leekspin version to 0.2.0.
commit 4d302bd3d391fb0174914a2ce035d1dcfaa707c0 Author: Isis Lovecruft i...@torproject.org Date: Thu Aug 7 11:28:36 2014 + Bump leekspin version to 0.2.0. --- .test.requirements.txt |2 +- .travis.requirements.txt |2 +- setup.py |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.test.requirements.txt b/.test.requirements.txt index df97c1a..12dfb7b 100644 --- a/.test.requirements.txt +++ b/.test.requirements.txt @@ -6,7 +6,7 @@ # $ make coverage # coverage==3.7.1 -leekspin==0.1.4 +leekspin==0.2.0 mechanize==0.2.5 pep8==1.5.7 # pylint must be pinned until pylint bug #203 is fixed. See diff --git a/.travis.requirements.txt b/.travis.requirements.txt index 428438a..feef181 100644 --- a/.travis.requirements.txt +++ b/.travis.requirements.txt @@ -15,7 +15,7 @@ #-- coverage==3.7.1 coveralls==0.4.2 -leekspin==0.1.4 +leekspin==0.2.0 mechanize==0.2.5 pep8==1.5.7 # pylint must be pinned until pylint bug #203 is fixed. See diff --git a/setup.py b/setup.py index 4654415..cc2bd32 100644 --- a/setup.py +++ b/setup.py @@ -285,7 +285,7 @@ setuptools.setup( scripts=['scripts/bridgedb'], extras_require={'test': [sure==1.2.2, coverage==3.7.1, - leekspin==0.1.3]}, + leekspin==0.2.0]}, zip_safe=False, cmdclass=get_cmdclass(), include_package_data=True, ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] Start BridgeDB in before_script section of .travis.yml.
commit d4d753f29cdda65861a60a15285c13186f6ac1c6 Author: Isis Lovecruft i...@torproject.org Date: Thu Aug 7 01:11:36 2014 + Start BridgeDB in before_script section of .travis.yml. --- .travis.yml | 10 ++ 1 file changed, 10 insertions(+) diff --git a/.travis.yml b/.travis.yml index 71cbb9a..7374fa7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,6 +53,16 @@ install: - pip install -q --no-use-wheel Twisted==$TWISTED_VERSION pyOpenSSL==$PYOPENSSL_VERSION - make install +# Start a BridgeDB instance before running the tests: +before_script: + - mkdir run + - cp -t run bridgedb.conf + - leekspin -n 100 + - cp -t run networkstatus-bridges cached-extrainfo* bridge-descriptors + - ./scripts/make-ssl-cert + - cp -t run privkey.pem cert + - bridgedb -r run + script: - make coverage-test ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] Merge branch 'fix/9874-https' into fix/9874-email
commit 321020ef0fcbb1507a3a0f38fed4b13267dff586 Merge: b15e76b 4d302bd Author: Isis Lovecruft i...@torproject.org Date: Thu Aug 7 12:10:44 2014 + Merge branch 'fix/9874-https' into fix/9874-email .test.requirements.txt |2 +- .travis.requirements.txt |2 +- setup.py |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] Add test_https.py from trygve.
commit d5556300a9f53c80760e12b13c94a93d041ca9ff Author: trygve tor-...@lists.torproject.org Date: Thu Aug 7 00:44:15 2014 + Add test_https.py from trygve. * FIXES part of #9874. See https://trac.torproject.org/projects/tor/attachment/ticket/9874/test_https.py --- lib/bridgedb/test/test_https.py | 146 +++ 1 file changed, 146 insertions(+) diff --git a/lib/bridgedb/test/test_https.py b/lib/bridgedb/test/test_https.py new file mode 100644 index 000..46da832 --- /dev/null +++ b/lib/bridgedb/test/test_https.py @@ -0,0 +1,146 @@ +integration tests for BridgeDB . +http://wwwsearch.sourceforge.net/mechanize/ +http://www.crummy.com/software/BeautifulSoup/bs3/documentation.html + + +from __future__ import print_function +from twisted.trial import unittest +from BeautifulSoup import BeautifulSoup +import mechanize + +HTTPS_ROOT = 'https://127.0.0.1:6789' +CAPTCHA_RESPONSE = 'Tvx74Pmy' + +class HTTPTests(unittest.TestCase): +def setUp(self): + self.br = None + +def tearDown(self): + self.br = None + +def openBrowser(self): + # use mechanize to open the BridgeDB website in its browser + self.br = mechanize.Browser() + self.br.set_handle_robots(False) # prevents 'HTTP Error 403: request disallowed by robots.txt' + self.br.open(HTTPS_ROOT) + + # -- Home/Root page + self.assertTrue(self.br.viewing_html()) + self.assertEquals(self.br.response().geturl(), HTTPS_ROOT) + self.assertEquals(self.br.title(), BridgeDB) + #for link in self.br.links(): print(link) + #for form in self.br.forms(): print(form) + return self.br + +def goToOptionsPage(self): +# check that we are on the root page + self.assertTrue(self.br.viewing_html()) + self.assertEquals(self.br.response().geturl(), HTTPS_ROOT) + + # follow the link with the word 'bridges' in it. + # Could also use: text='bridges' + # Could also use: url='/options' + self.br.follow_link(text_regex='bridges') + + # - Options + self.assertEquals(self.br.response().geturl(), HTTPS_ROOT + /options) + #print(self.br.response().read()) + #for form in self.br.forms(): print(form) + return self.br + +def submitOptions(self, transport, ipv6, captchaResponse): + # check that we are on the options page + self.assertEquals(self.br.response().geturl(), HTTPS_ROOT + /options) + + # At this point, we'd like to be able to set some values in + # the 'advancedOptions' form. Unfortunately the HTML form + # does not define a 'name' attribute, so the we have to rely on + # the fact that this is the only form on the page and will therefore + # always exist at index 0. + #br.select_form(name=advancedOptions) + self.br.select_form(nr=0) + + # change the pluggable transport to something else + #print(self.br.form) + self.br.form['transport'] = [transport] +if ipv6: +self.br.form['ipv6'] = ['yes'] + self.br.submit() + + # - Captcha + EXPECTED_URL = HTTPS_ROOT + /bridges?transport=%s % transport +if ipv6: +EXPECTED_URL += ipv6=yes + self.assertEquals(self.br.response().geturl(), EXPECTED_URL) + #print(self.br.response().read()) + #for form in self.br.forms(): print(form) + + # As on the previous page, the form does not define a 'name' attribute, forcing + # us to use the index of the form i.e. 0 + #self.br.select_form(name=captchaSubmission) + self.br.select_form(nr=0) + + # input the required captcha response. There is only one captcha defined + # by default, so this should always be accepted. Note this will not be possible + # to automate if used with a real captcha systems (e.g. reCAPTCHA) + #self.br.form['captcha_response_field'] = 'Tvx74PMy' + self.br.form['captcha_response_field'] = captchaResponse + captcha_response = self.br.submit() + + # - Results + # URL should be the same as last time + self.assertEquals(self.br.response().geturl(), EXPECTED_URL) + soup = BeautifulSoup(captcha_response.read()) + #print soup.prettify() + return soup + +def getBridgeLinesFromSoup(self, soup): + # Now we're looking for something like this in the response: + # div class=bridge-lines + # obfs2 175.213.252.207:11125 5c6da7d927460317c6ff5420b75c2d0f431f18dd + # /div + bridges = [] + bridge_lines = soup.findAll(attrs={'class' : 'bridge-lines'}) + self.assertTrue(len(bridge_lines) 0, Found no bridge lines) + for bridge_line in bridge_lines: + text = bridge_line.text + #print(Found bridge-line: %s % text) + items = text.split(' ') + self.assertEquals(len(items), 3, Expected Pluggale
[tor-commits] [bridgedb/develop] Add --no-use-wheel when pip installing Travis CI dependencies.
commit e01aedc7ebe9cd767c87e2f0ee1ad4fd1cf4e21f Author: Isis Lovecruft i...@torproject.org Date: Thu Aug 7 06:16:34 2014 + Add --no-use-wheel when pip installing Travis CI dependencies. --- .travis.yml |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9066fc7..e664a26 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,7 +42,7 @@ before_install: install: - sudo apt-get install -qq --no-install-suggests --no-install-recommends build-essential openssl sqlite3 libgpgme11 libgpgme11-dev python-dev python-setuptools - - pip install -q -r .travis.requirements.txt + - pip install -q --no-use-wheel -r .travis.requirements.txt - pip install -q --no-use-wheel Twisted==$TWISTED_VERSION pyOpenSSL==$PYOPENSSL_VERSION - make install ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] Add 'mechanize==0.2.5' to .test.requirements.txt.
commit c61af9b2aed80a98359720d46a40420a296cea48 Author: Isis Lovecruft i...@torproject.org Date: Thu Aug 7 00:55:41 2014 + Add 'mechanize==0.2.5' to .test.requirements.txt. --- .test.requirements.txt |1 + 1 file changed, 1 insertion(+) diff --git a/.test.requirements.txt b/.test.requirements.txt index dad35c5..df97c1a 100644 --- a/.test.requirements.txt +++ b/.test.requirements.txt @@ -7,6 +7,7 @@ # coverage==3.7.1 leekspin==0.1.4 +mechanize==0.2.5 pep8==1.5.7 # pylint must be pinned until pylint bug #203 is fixed. See # https://bitbucket.org/logilab/pylint/issue/203/importing-namespace-packages-crashes#comment-11013783 ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] Add '127.0.0.1' to copied bridgedb.conf in .travis.yml.
commit b15e76b2d9441acf17856b888e27d1b5dd06169e Author: Isis Lovecruft i...@torproject.org Date: Thu Aug 7 11:02:30 2014 + Add '127.0.0.1' to copied bridgedb.conf in .travis.yml. This is necessary to run the tests in `lib/bridgedb/test/test_smtp.py`, and shouldn't be set on production servers. It's done with a sed command in the `.travis.yml` file to a copied bridgedb.conf so that it doesn't ever end up in a production config file. --- .travis.yml |3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index a3771b0..5f0aed2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,6 +50,9 @@ install: before_script: - mkdir run - cp -R -t run bridgedb.conf captchas gnupghome + # Add '127.0.0.1' to EMAIL_DOMAINS in bridgedb.conf. This should ONLY be + # done on testing servers, never on production servers. + - sed -r -i -e s/(EMAIL_DOMAINS)(.*)(])/\1\2\, '127.0.0.1']/ run/bridgedb.conf - leekspin -n 100 - cp -t run networkstatus-bridges cached-extrainfo* bridge-descriptors - ./scripts/make-ssl-cert ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] Move several test dependencies from .travis.yml to .travis.requirements.txt.
commit 3c9b8732a5c9119837212056306deb4353d6e7bd Author: Isis Lovecruft i...@torproject.org Date: Thu Aug 7 06:06:31 2014 + Move several test dependencies from .travis.yml to .travis.requirements.txt. --- .travis.requirements.txt | 24 .travis.yml |7 --- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/.travis.requirements.txt b/.travis.requirements.txt index e018631..428438a 100644 --- a/.travis.requirements.txt +++ b/.travis.requirements.txt @@ -1,3 +1,27 @@ +# +# This is a pip requirements.txt file for running BridgeDB's tests on Travis +# See https://travis-ci.org/ and the .travis.yml file for more info. Please +# note that there may be additional dependencies not listed here but specified +# with their version numbers in .travis.yml in order to submit test runs which +# use multiple different dependency versions. +# +#-- +# +# To run install these dependencies and run the tests, do: +# +# $ pip install -r .test.requirements.txt +# $ make coverage +# +#-- +coverage==3.7.1 +coveralls==0.4.2 +leekspin==0.1.4 +mechanize==0.2.5 +pep8==1.5.7 +# pylint must be pinned until pylint bug #203 is fixed. See +# https://bitbucket.org/logilab/pylint/issue/203/importing-namespace-packages-crashes#comment-11013783 +pylint==1.1.0 +sure==1.2.2 Babel==0.9.6 BeautifulSoup==3.2.1 Mako==0.8.1 diff --git a/.travis.yml b/.travis.yml index 7374fa7..9066fc7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,11 +26,6 @@ addons: - bridges.torproject.org env: - global: -- LEEKSPIN_VERSION=0.1.4 -- COVERAGE_VERSION=3.7.1 -- COVERALLS_VERSION=0.4.2 -- SURE_VERSION=1.2.2 matrix: - TWISTED_VERSION=13.2.0 PYOPENSSL_VERSION=0.13.1 @@ -48,8 +43,6 @@ before_install: install: - sudo apt-get install -qq --no-install-suggests --no-install-recommends build-essential openssl sqlite3 libgpgme11 libgpgme11-dev python-dev python-setuptools - pip install -q -r .travis.requirements.txt - - pip install -q --no-use-wheel leekspin==$LEEKSPIN_VERSION sure==$SURE_VERSION - - pip install -q --no-use-wheel coverage==$COVERAGE_VERSION coveralls==$COVERALLS_VERSION - pip install -q --no-use-wheel Twisted==$TWISTED_VERSION pyOpenSSL==$PYOPENSSL_VERSION - make install ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] Also copy gnupghome/ to run/ in .travis.yml 'before_script'.
commit 8d47543523f9120f8ea0fd93612782f50fcbe941 Author: Isis Lovecruft i...@torproject.org Date: Thu Aug 7 07:52:08 2014 + Also copy gnupghome/ to run/ in .travis.yml 'before_script'. --- .travis.yml |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d8edafb..a3771b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,7 +49,7 @@ install: # Start a BridgeDB instance before running the tests: before_script: - mkdir run - - cp -R -t run bridgedb.conf captchas + - cp -R -t run bridgedb.conf captchas gnupghome - leekspin -n 100 - cp -t run networkstatus-bridges cached-extrainfo* bridge-descriptors - ./scripts/make-ssl-cert ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] Split unittests in test_bridgedb.py; refactor to use already running server.
commit 9873fad412081d35e508de5c8dd095a17fd921cb Author: Isis Lovecruft i...@torproject.org Date: Thu Aug 7 07:47:05 2014 + Split unittests in test_bridgedb.py; refactor to use already running server. The unittests in `lib/bridgedb/test/test_bridgedb.py` now expect a BridgeDB instance to have already been started *before* the tests run. This change is necessary because it is non-trivial to have two instances of BridgeDB running simultaneously (at least not without changing every port in the config file) and the tests in `lib/bridgedb/test/test_https.py` also require a running server. These refactored tests should raise SkipTest if they believe that there is no running BridgeDB instance to test against. For Travis CI, the BridgeDB instance is started automatically in the 'before_script' section of `travis.yml` (in the top directory of this repo). * FIXES part of #9874. --- lib/bridgedb/test/test_bridgedb.py | 167 +++- lib/bridgedb/test/util.py | 22 + 2 files changed, 89 insertions(+), 100 deletions(-) diff --git a/lib/bridgedb/test/test_bridgedb.py b/lib/bridgedb/test/test_bridgedb.py index c7aefff..e54d324 100644 --- a/lib/bridgedb/test/test_bridgedb.py +++ b/lib/bridgedb/test/test_bridgedb.py @@ -14,121 +14,88 @@ from __future__ import print_function import os -import shutil import signal import time -from os.path import join as pjoin -from subprocess import Popen, PIPE - -from twisted.python import log -from twisted.python.procutils import which from twisted.trial import unittest +from twisted.trial.unittest import SkipTest -from bridgedb.test.util import fileCheckDecorator +from bridgedb.test.util import pidExists class BridgeDBCliTest(unittest.TestCase): Test the `bridgedb` command. -@fileCheckDecorator -def doCopyFile(self, src, dst, description=None): -shutil.copy(src, dst) - -@fileCheckDecorator -def doMoveFile(self, src, dst, description=None): -shutil.move(src, dst) - -def test_bridgedb_commands(self): -print('') -here = os.getcwd() -runDir = pjoin(here, 'rundir') -topDir = here.rstrip('_trial_temp') -scriptsDir = pjoin(topDir, 'scripts') - -# Create the lowest directory we need, and all its parents: -os.makedirs(os.path.join(runDir, 'gnupghome')) - -conf = pjoin(topDir, 'bridgedb.conf') -confMoved = pjoin(runDir, 'bridgedb.conf') -gpgFile = pjoin(topDir, 'gnupghome', 'TESTING.subkeys.sec') -gpgMoved = pjoin(runDir, 'gnupghome', 'TESTING.subkeys.sec') -certFile = pjoin(topDir, 'cert') -certMoved = pjoin(runDir, 'cert') -keyFile = pjoin(topDir, 'privkey.pem') -keyMoved = pjoin(runDir, 'privkey.pem') - -makeSSLCertScript = os.path.join(scriptsDir, 'make-ssl-cert') -bridgedbScript= which('bridgedb') # this returns a list - -self.doCopyFile(conf, confMoved, 'config') -self.doCopyFile(gpgFile, gpgMoved, 'GPG test key') -print(Running subcommands from directory:\n %r % runDir) -print(Running %r... % makeSSLCertScript) -makeSSLCertProcess = Popen(makeSSLCertScript) -makeSSLCertProcess.wait() -self.doMoveFile(certFile, certMoved, 'certificate') -self.doMoveFile(keyFile, keyMoved, 'SSL private key') - -self.assertTrue(os.path.isfile(bridgedbScript[0]), -Couldn't find bridgedb script %r % bridgedbScript[0]) -bridgedbScript = bridgedbScript[0] -print(Running bridgedb script %r... % bridgedbScript) - -os.chdir(runDir) # we have to do this to get files to end up there -print(Running `bridgedb mock' to generate mock bridge descriptors...) -mockProc = Popen([bridgedbScript, 'mock', '-n', '50']) -mockProcCode = mockProc.wait() -print(`bridgedb mock' exited with status code %d % int(mockProcCode)) -os.chdir(here) - -# See ticket #11216, cached-extrainfo* files should not be parsed -# cumulatively. -eidesc = pjoin(runDir, 'cached-extrainfo') -eindesc = pjoin(runDir, 'cached-extrainfo.new') -self.doCopyFile(eindesc, eidesc, 'duplicated cached-extrainfo(.new)') -self.assertTrue(os.path.isfile(eidesc)) -self.assertTrue(os.path.isfile(eindesc)) - - -print(Running `bridgedb' to test server startups...) -# Sorry Windows users -devnull = open('/dev/null', 'w') -bridgedbProc = Popen([bridgedbScript, '-r', runDir], stdout=devnull) -print(Waiting 10 seconds while bridgedb loads...) -time.sleep(10) -assignments = pjoin(runDir, 'assignments.log') -self.assertTrue(os.path.isfile(assignments)) -os.unlink(assignments) -print(Sending SIGHUP, checking for assignments.log ...) -
[tor-commits] [bridgedb/develop] Sphinxify bridgedb.test.test_https module docstring.
commit 7ae1282581e3d690c310fa054a7d692f8cd2fe56 Author: Isis Lovecruft i...@torproject.org Date: Thu Aug 7 09:48:22 2014 + Sphinxify bridgedb.test.test_https module docstring. --- lib/bridgedb/test/test_https.py | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/bridgedb/test/test_https.py b/lib/bridgedb/test/test_https.py index 8e0fc50..a154856 100644 --- a/lib/bridgedb/test/test_https.py +++ b/lib/bridgedb/test/test_https.py @@ -7,9 +7,19 @@ # (c) 2014, The Tor Project, Inc. # :license: see LICENSE for licensing information #_ -integration tests for BridgeDB . -http://wwwsearch.sourceforge.net/mechanize/ -http://www.crummy.com/software/BeautifulSoup/bs3/documentation.html + +Integration tests for BridgeDB's HTTPS Distributor. + +These tests use `mechanize`_ and `BeautifulSoup`_, and require a BridgeDB +instance to have been started in a separate process. To see how a BridgeDB is +started for our CI infrastructure from a fresh clone of this repository, see +the before_script section of the `.travis.yml` file in the top level of this +repository. + +.. _mechanize: https://pypi.python.org/pypi/mechanize/ +http://wwwsearch.sourceforge.net/mechanize/ +.. _BeautifulSoup: +http://www.crummy.com/software/BeautifulSoup/bs3/documentation.html from __future__ import print_function @@ -20,6 +30,7 @@ import mechanize HTTPS_ROOT = 'https://127.0.0.1:6789' CAPTCHA_RESPONSE = 'Tvx74Pmy' + class HTTPTests(unittest.TestCase): def setUp(self): self.br = None ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] Add test_smtp.py by trygve.
commit c3e6c2168e48dcf51b5c57aa3061a213bd8fb39c Author: trygve tor-...@lists.torproject.org Date: Thu Aug 7 09:50:56 2014 + Add test_smtp.py by trygve. See https://trac.torproject.org/projects/tor/attachment/ticket/9874/test_smtp.py * FIXES part of #9874. --- lib/bridgedb/test/test_smtp.py | 140 1 file changed, 140 insertions(+) diff --git a/lib/bridgedb/test/test_smtp.py b/lib/bridgedb/test/test_smtp.py new file mode 100644 index 000..5e8b5c9 --- /dev/null +++ b/lib/bridgedb/test/test_smtp.py @@ -0,0 +1,140 @@ +integration tests for BridgeDB . + +from __future__ import print_function +from twisted.trial import unittest + +import smtplib +from smtpd import SMTPServer +import asyncore +import threading +import Queue +import random +import time +import random + +# - SMTP Client Config +SMTP_DEBUG_LEVEL = 0 # set to 1 to see SMTP message exchange +BRIDGEDB_SMTP_SERVER_ADDRESS = localhost +BRIDGEDB_SMTP_SERVER_PORT = 6725 +FROM_ADDRESS_TEMPLATE = test%d@127.0.0.1 # %d is parameterised with a random integer to make the sender unique +MIN_FROM_ADDRESS = 1 # minimum value used to parameterise FROM_ADDRESS_TEMPLATE +MAX_FROM_ADDRESS = 10**8 # max value used to parameterise FROM_ADDRESS_TEMPLATE. Needs to be pretty big to reduce the chance of collisions +TO_ADDRESS = brid...@torproject.org +MESSAGE_TEMPLATE = From: %s +To: %s +Subject: testing + +get bridges + +# - SMTP Server Setup +# Setup an SMTP server which we use to check for responses +# from bridgedb. This needs to be done before sending the actual mail +LOCAL_SMTP_SERVER_ADDRESS = 'localhost' +LOCAL_SMTP_SERVER_PORT = 2525 # Must be the same as bridgedb's EMAIL_SMTP_PORT + +class EmailServer(SMTPServer): +def process_message(self, peer, mailfrom, rcpttos, data): +''' Overridden from SMTP server, called whenever a message is received''' +self.message_queue.put(data) + +def thread_proc(self): +''' This function runs in thread, and will continue looping +until the _stop Event object is set by the stop() function''' +while self._stop.is_set() == False: +asyncore.loop(timeout=0.0, count=1) +# must close, or asyncore will hold on to the socket and subsequent tests will fail with 'Address not in use' +self.close() + +def start(self): +self.message_queue = Queue.Queue() +self._stop = threading.Event() +self._thread = threading.Thread(target=self.thread_proc) +self._thread.setDaemon(True) # ensures that if any tests do fail, then threads will exit when the parent exits +self._thread.start() + +@classmethod +def startServer(cls): +#print(Starting SMTP server on %s:%s % (LOCAL_SMTP_SERVER_ADDRESS, LOCAL_SMTP_SERVER_PORT)) +server = EmailServer((LOCAL_SMTP_SERVER_ADDRESS, LOCAL_SMTP_SERVER_PORT), None) +server.start() +return server + +def stop(self): +# signal thread_proc to stop +self._stop.set() +# wait for thread_proc to return (shouldn't take long) +self._thread.join() +assert self._thread.is_alive() == False, Thread is alive and kicking + +def getAndCheckMessageContains(self, text, timeoutInSecs=2.0): +#print(Checking for reponse) +message = self.message_queue.get(block=True, timeout=timeoutInSecs) +assert message.find(text) != -1, Message did not contain text \%s\. Full message is:\n %s % (text, message) + +def checkNoMessageReceived(self, timeoutInSecs=2.0): +try: +self.message_queue.get(block=True, timeout=timeoutInSecs) +except Queue.Empty: +return True +assert False, Found a message in the queue, but expected none + +def sendMail(fromAddress): +#print(Connecting to %s:%d % (BRIDGEDB_SMTP_SERVER_ADDRESS, BRIDGEDB_SMTP_SERVER_PORT)) +client = smtplib.SMTP(BRIDGEDB_SMTP_SERVER_ADDRESS, BRIDGEDB_SMTP_SERVER_PORT) +client.set_debuglevel(SMTP_DEBUG_LEVEL) + +#print(Sending mail TO:%s, FROM:%s % (TO_ADDRESS, fromAddress)) +result = client.sendmail(fromAddress, TO_ADDRESS, MESSAGE_TEMPLATE % (fromAddress, TO_ADDRESS)) +assert result == {}, Failed to send mail +client.quit() + +class SMTPTests(unittest.TestCase): +def setUp(self): +''' Called at the start of each test, ensures that the SMTP server is running''' +self.server = EmailServer.startServer() + +def tearDown(self): +''' Called after each test, ensures that the SMTP server is cleaned up''' +self.server.stop() + +def test_getBridges(self): +# send the mail to bridgedb, choosing a random email address +sendMail(fromAddress=FROM_ADDRESS_TEMPLATE % random.randint(MIN_FROM_ADDRESS, MAX_FROM_ADDRESS)) + +# then check that our local SMTP server received a response +# and that response contained
[tor-commits] [bridgedb/develop] Add file header to lib/bridgedb/test/test_https.py.
commit e96ebb1b02f704a30fe63da863d2ea714d1ad1ec Author: Isis Lovecruft i...@torproject.org Date: Thu Aug 7 09:47:43 2014 + Add file header to lib/bridgedb/test/test_https.py. --- lib/bridgedb/test/test_https.py |9 + 1 file changed, 9 insertions(+) diff --git a/lib/bridgedb/test/test_https.py b/lib/bridgedb/test/test_https.py index 46da832..8e0fc50 100644 --- a/lib/bridgedb/test/test_https.py +++ b/lib/bridgedb/test/test_https.py @@ -1,3 +1,12 @@ +#_ +# +# This file is part of BridgeDB, a Tor bridge distribution system. +# +# :authors: trygve tor-...@lists.torproject.org +# :copyright: (c) trygve +# (c) 2014, The Tor Project, Inc. +# :license: see LICENSE for licensing information +#_ integration tests for BridgeDB . http://wwwsearch.sourceforge.net/mechanize/ http://www.crummy.com/software/BeautifulSoup/bs3/documentation.html ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] Merge branch 'fix/9874-https' into fix/9874-email
commit f18ba06ffc7ff8031b3c074b4c4e656fbe0a9773 Merge: 3536724 be93cb7 Author: Isis Lovecruft i...@torproject.org Date: Fri Aug 8 03:12:59 2014 + Merge branch 'fix/9874-https' into fix/9874-email lib/bridgedb/test/test_https.py | 217 +-- 1 file changed, 115 insertions(+), 102 deletions(-) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] PEP8 style fixes for bridgedb.test.test_smtp.
commit fc127ad1e59601d0507a2ae802d333c220291a17 Author: trygve tor-...@lists.torproject.org Date: Fri Aug 8 03:30:05 2014 + PEP8 style fixes for bridgedb.test.test_smtp. --- lib/bridgedb/test/test_smtp.py | 76 +++- 1 file changed, 52 insertions(+), 24 deletions(-) diff --git a/lib/bridgedb/test/test_smtp.py b/lib/bridgedb/test/test_smtp.py index 4e59002..4f30030 100644 --- a/lib/bridgedb/test/test_smtp.py +++ b/lib/bridgedb/test/test_smtp.py @@ -16,9 +16,13 @@ import random SMTP_DEBUG_LEVEL = 0 # set to 1 to see SMTP message exchange BRIDGEDB_SMTP_SERVER_ADDRESS = localhost BRIDGEDB_SMTP_SERVER_PORT = 6725 -FROM_ADDRESS_TEMPLATE = test%d@127.0.0.1 # %d is parameterised with a random integer to make the sender unique -MIN_FROM_ADDRESS = 1 # minimum value used to parameterise FROM_ADDRESS_TEMPLATE -MAX_FROM_ADDRESS = 10**8 # max value used to parameterise FROM_ADDRESS_TEMPLATE. Needs to be pretty big to reduce the chance of collisions +# %d is parameterised with a random integer to make the sender unique +FROM_ADDRESS_TEMPLATE = test%d@127.0.0.1 +# Minimum value used to parameterise FROM_ADDRESS_TEMPLATE +MIN_FROM_ADDRESS = 1 +# Max value used to parameterise FROM_ADDRESS_TEMPLATE. Needs to be pretty big +# to reduce the chance of collisions +MAX_FROM_ADDRESS = 10**8 TO_ADDRESS = brid...@torproject.org MESSAGE_TEMPLATE = From: %s To: %s @@ -32,6 +36,7 @@ get bridges LOCAL_SMTP_SERVER_ADDRESS = 'localhost' LOCAL_SMTP_SERVER_PORT = 2525 # Must be the same as bridgedb's EMAIL_SMTP_PORT + class EmailServer(SMTPServer): def process_message(self, peer, mailfrom, rcpttos, data): ''' Overridden from SMTP server, called whenever a message is received''' @@ -42,34 +47,42 @@ class EmailServer(SMTPServer): until the _stop Event object is set by the stop() function''' while self._stop.is_set() == False: asyncore.loop(timeout=0.0, count=1) -# must close, or asyncore will hold on to the socket and subsequent tests will fail with 'Address not in use' +# Must close, or asyncore will hold on to the socket and subsequent +# tests will fail with 'Address not in use'. self.close() def start(self): self.message_queue = Queue.Queue() self._stop = threading.Event() self._thread = threading.Thread(target=self.thread_proc) -self._thread.setDaemon(True) # ensures that if any tests do fail, then threads will exit when the parent exits +# Ensures that if any tests do fail, then threads will exit when the +# parent exits. +self._thread.setDaemon(True) self._thread.start() @classmethod def startServer(cls): -#print(Starting SMTP server on %s:%s % (LOCAL_SMTP_SERVER_ADDRESS, LOCAL_SMTP_SERVER_PORT)) -server = EmailServer((LOCAL_SMTP_SERVER_ADDRESS, LOCAL_SMTP_SERVER_PORT), None) +#print(Starting SMTP server on %s:%s +# % (LOCAL_SMTP_SERVER_ADDRESS, LOCAL_SMTP_SERVER_PORT)) +server = EmailServer((LOCAL_SMTP_SERVER_ADDRESS, + LOCAL_SMTP_SERVER_PORT), + None) server.start() return server def stop(self): -# signal thread_proc to stop +# Signal thread_proc to stop: self._stop.set() -# wait for thread_proc to return (shouldn't take long) +# Wait for thread_proc to return (shouldn't take long) self._thread.join() assert self._thread.is_alive() == False, Thread is alive and kicking def getAndCheckMessageContains(self, text, timeoutInSecs=2.0): #print(Checking for reponse) message = self.message_queue.get(block=True, timeout=timeoutInSecs) -assert message.find(text) != -1, Message did not contain text \%s\. Full message is:\n %s % (text, message) +assert message.find(text) != -1, (Message did not contain text '%s'. + Full message is:\n %s + % (text, message)) def checkNoMessageReceived(self, timeoutInSecs=2.0): try: @@ -79,27 +92,36 @@ class EmailServer(SMTPServer): assert False, Found a message in the queue, but expected none def sendMail(fromAddress): -#print(Connecting to %s:%d % (BRIDGEDB_SMTP_SERVER_ADDRESS, BRIDGEDB_SMTP_SERVER_PORT)) -client = smtplib.SMTP(BRIDGEDB_SMTP_SERVER_ADDRESS, BRIDGEDB_SMTP_SERVER_PORT) +#print(Connecting to %s:%d +# % (BRIDGEDB_SMTP_SERVER_ADDRESS, BRIDGEDB_SMTP_SERVER_PORT)) +client = smtplib.SMTP(BRIDGEDB_SMTP_SERVER_ADDRESS, + BRIDGEDB_SMTP_SERVER_PORT) client.set_debuglevel(SMTP_DEBUG_LEVEL) -#print(Sending mail TO:%s, FROM:%s % (TO_ADDRESS, fromAddress)) -result = client.sendmail(fromAddress, TO_ADDRESS, MESSAGE_TEMPLATE % (fromAddress, TO_ADDRESS)) +#print(Sending mail
[tor-commits] [bridgedb/develop] Change EMAIL_SMTP_PORT to 2525 in copied bridgedb.conf for Travis.
commit 353672434209b0fe58ba4e9ef1ae49942644f0b0 Author: Isis Lovecruft i...@torproject.org Date: Thu Aug 7 12:17:40 2014 + Change EMAIL_SMTP_PORT to 2525 in copied bridgedb.conf for Travis. --- .travis.yml |2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5f0aed2..6992f6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,6 +53,8 @@ before_script: # Add '127.0.0.1' to EMAIL_DOMAINS in bridgedb.conf. This should ONLY be # done on testing servers, never on production servers. - sed -r -i -e s/(EMAIL_DOMAINS)(.*)(])/\1\2\, '127.0.0.1']/ run/bridgedb.conf + # Change EMAIL_SMTP_PORT to 2525: + - sed -r -i -e s/(EMAIL_SMTP_PORT = )([1-9]{2,5})/\12525/ run/bridgedb.conf - leekspin -n 100 - cp -t run networkstatus-bridges cached-extrainfo* bridge-descriptors - ./scripts/make-ssl-cert ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] Whitespace fixes for bridgedb.test.test_smtp.
commit 209721600ce0f4249b516775eeea709a61142508 Author: trygve tor-...@lists.torproject.org Date: Fri Aug 8 03:15:49 2014 + Whitespace fixes for bridgedb.test.test_smtp. --- lib/bridgedb/test/test_smtp.py | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/bridgedb/test/test_smtp.py b/lib/bridgedb/test/test_smtp.py index 5e8b5c9..4e59002 100644 --- a/lib/bridgedb/test/test_smtp.py +++ b/lib/bridgedb/test/test_smtp.py @@ -38,11 +38,11 @@ class EmailServer(SMTPServer): self.message_queue.put(data) def thread_proc(self): -''' This function runs in thread, and will continue looping +''' This function runs in thread, and will continue looping until the _stop Event object is set by the stop() function''' while self._stop.is_set() == False: asyncore.loop(timeout=0.0, count=1) -# must close, or asyncore will hold on to the socket and subsequent tests will fail with 'Address not in use' +# must close, or asyncore will hold on to the socket and subsequent tests will fail with 'Address not in use' self.close() def start(self): @@ -63,7 +63,7 @@ class EmailServer(SMTPServer): # signal thread_proc to stop self._stop.set() # wait for thread_proc to return (shouldn't take long) -self._thread.join() +self._thread.join() assert self._thread.is_alive() == False, Thread is alive and kicking def getAndCheckMessageContains(self, text, timeoutInSecs=2.0): @@ -75,7 +75,7 @@ class EmailServer(SMTPServer): try: self.message_queue.get(block=True, timeout=timeoutInSecs) except Queue.Empty: -return True +return True assert False, Found a message in the queue, but expected none def sendMail(fromAddress): @@ -101,7 +101,7 @@ class SMTPTests(unittest.TestCase): # send the mail to bridgedb, choosing a random email address sendMail(fromAddress=FROM_ADDRESS_TEMPLATE % random.randint(MIN_FROM_ADDRESS, MAX_FROM_ADDRESS)) -# then check that our local SMTP server received a response +# then check that our local SMTP server received a response # and that response contained some bridges self.server.getAndCheckMessageContains(Here are your bridges) @@ -110,11 +110,11 @@ class SMTPTests(unittest.TestCase): FROM_ADDRESS = FROM_ADDRESS_TEMPLATE % random.randint(MIN_FROM_ADDRESS, MAX_FROM_ADDRESS) sendMail(FROM_ADDRESS) -# then check that our local SMTP server received a response +# then check that our local SMTP server received a response # and that response contained some bridges self.server.getAndCheckMessageContains(Here are your bridges) - # send another request from the same email address +# send another request from the same email address sendMail(FROM_ADDRESS) # this time, the email response should not contain any bridges @@ -127,7 +127,7 @@ class SMTPTests(unittest.TestCase): self.server.checkNoMessageReceived(timeoutInSecs=1.0) def test_getBridges_stressTest(self): -''' Sends a large number of emails in a short period of time, and checks that +''' Sends a large number of emails in a short period of time, and checks that a response is received for each message ''' NUM_MAILS = 100 for i in range(NUM_MAILS): @@ -137,4 +137,3 @@ class SMTPTests(unittest.TestCase): for i in range(NUM_MAILS): self.server.getAndCheckMessageContains(Here are your bridges) - ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] Change obfs3 ipv6 integration test to vanilla ipv4; add scramblesuit test.
commit d798533ff482bd7c1a149d1d38bcc9dfb53da3bc Author: trygve tor-...@lists.torproject.org Date: Fri Aug 8 03:06:18 2014 + Change obfs3 ipv6 integration test to vanilla ipv4; add scramblesuit test. The ipv6 bridge has been changed to a vanilla ipv4 bridge. I've also added a new test to check for a scramblesuit bridge. Both of these surprised me because they had a different number of fields in each bridge line, but I've adjusted the tests accordingly. --- lib/bridgedb/test/test_https.py | 33 +++-- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/lib/bridgedb/test/test_https.py b/lib/bridgedb/test/test_https.py index a154856..4ffbe08 100644 --- a/lib/bridgedb/test/test_https.py +++ b/lib/bridgedb/test/test_https.py @@ -114,7 +114,7 @@ class HTTPTests(unittest.TestCase): #print soup.prettify() return soup -def getBridgeLinesFromSoup(self, soup): +def getBridgeLinesFromSoup(self, soup, fieldsPerBridge): # Now we're looking for something like this in the response: # div class=bridge-lines # obfs2 175.213.252.207:11125 5c6da7d927460317c6ff5420b75c2d0f431f18dd @@ -126,7 +126,7 @@ class HTTPTests(unittest.TestCase): text = bridge_line.text #print(Found bridge-line: %s % text) items = text.split(' ') - self.assertEquals(len(items), 3, Expected Pluggale Transport, Bridge and Fingerprint in %s % str(items)) + self.assertEquals(len(items), fieldsPerBridge, Expected %d fields in bridge line %s % (fieldsPerBridge, str(items))) bridges.append(items) return bridges @@ -137,7 +137,7 @@ class HTTPTests(unittest.TestCase): PT = 'obfs2' soup = self.submitOptions(transport=PT, ipv6=False, captchaResponse=CAPTCHA_RESPONSE) - bridges = self.getBridgeLinesFromSoup(soup) + bridges = self.getBridgeLinesFromSoup(soup, fieldsPerBridge=3) for pt, bridge, fingerprint in bridges: self.assertEquals(PT, pt) @@ -148,19 +148,32 @@ class HTTPTests(unittest.TestCase): PT = 'obfs3' soup = self.submitOptions(transport=PT, ipv6=False, captchaResponse=CAPTCHA_RESPONSE) - bridges = self.getBridgeLinesFromSoup(soup) + bridges = self.getBridgeLinesFromSoup(soup, fieldsPerBridge=3) for pt, bridge, fingerprint in bridges: self.assertEquals(PT, pt) -def test_get_obfs3_ipv6(self): +def test_get_vanilla_ipv4(self): self.openBrowser() self.goToOptionsPage() - PT = 'obfs3' -soup = self.submitOptions(transport=PT, ipv6=True, captchaResponse=CAPTCHA_RESPONSE) + PT = '0' +soup = self.submitOptions(transport=PT, ipv6=False, captchaResponse=CAPTCHA_RESPONSE) - # at the time of writing, this test fails due to lack of ipv6 bridges - bridges = self.getBridgeLinesFromSoup(soup) -for pt, bridge, fingerprint in bridges: + bridges = self.getBridgeLinesFromSoup(soup, fieldsPerBridge=2) + for bridge, fingerprint in bridges: + # TODO: do more interesting checks + self.assertTrue(bridge != None) + +def test_get_scramblesuit_ipv4(self): + self.openBrowser() + self.goToOptionsPage() + + PT = 'scramblesuit' + soup = self.submitOptions(transport=PT, ipv6=False, captchaResponse=CAPTCHA_RESPONSE) + + bridges = self.getBridgeLinesFromSoup(soup, fieldsPerBridge=4) + for pt, bridge, fingerprint, password in bridges: self.assertEquals(PT, pt) + self.assertTrue(password.find(password=) != -1, Password field missing expected text) + ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] Clarify comments in .travis.requirements.txt.
commit 01562144625fe4d9d6ae3870583cfef456513a39 Author: Isis Lovecruft i...@torproject.org Date: Tue Aug 12 23:58:23 2014 + Clarify comments in .travis.requirements.txt. --- .travis.requirements.txt | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.requirements.txt b/.travis.requirements.txt index feef181..37b7bfe 100644 --- a/.travis.requirements.txt +++ b/.travis.requirements.txt @@ -1,10 +1,10 @@ +# This is a pip requirements.txt file for running BridgeDB and BridgeDB's test +# suites on Travis CI infrastructure. See https://travis-ci.org/ and the +# .travis.yml file for more info. # -# This is a pip requirements.txt file for running BridgeDB's tests on Travis -# See https://travis-ci.org/ and the .travis.yml file for more info. Please -# note that there may be additional dependencies not listed here but specified -# with their version numbers in .travis.yml in order to submit test runs which -# use multiple different dependency versions. -# +# Please note that there may be additional dependencies not listed here but +# specified with their version numbers in .travis.yml in order to submit test +# runs which use multiple different dependency versions. #-- # # To run install these dependencies and run the tests, do: ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] Remove unused/extra imports `time` and `random` from test_smtp.py.
commit cc2ea6208f1580f973fd0ed0e71cda6c838c763a Author: Isis Lovecruft i...@torproject.org Date: Fri Aug 8 11:27:39 2014 + Remove unused/extra imports `time` and `random` from test_smtp.py. --- lib/bridgedb/test/test_smtp.py |2 -- 1 file changed, 2 deletions(-) diff --git a/lib/bridgedb/test/test_smtp.py b/lib/bridgedb/test/test_smtp.py index 4f30030..fb25c46 100644 --- a/lib/bridgedb/test/test_smtp.py +++ b/lib/bridgedb/test/test_smtp.py @@ -9,8 +9,6 @@ import asyncore import threading import Queue import random -import time -import random # - SMTP Client Config SMTP_DEBUG_LEVEL = 0 # set to 1 to see SMTP message exchange ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] Merge branch 'fix/9874-email' into develop
commit ef6a5e4fdf4b890a4bdd2c412e20b4e72fa0fa07 Merge: f565959 cc2ea62 Author: Isis Lovecruft i...@torproject.org Date: Tue Aug 12 23:45:16 2014 + Merge branch 'fix/9874-email' into develop .travis.yml|5 ++ lib/bridgedb/test/test_smtp.py | 165 2 files changed, 170 insertions(+) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] Whitespace fixes for bridgedb.test.test_https.
commit be93cb7c849990bf516c33c1a440ca406b2b3cb9 Author: trygve tor-...@lists.torproject.org Date: Fri Aug 8 03:11:31 2014 + Whitespace fixes for bridgedb.test.test_https. --- lib/bridgedb/test/test_https.py | 210 +++ 1 file changed, 105 insertions(+), 105 deletions(-) diff --git a/lib/bridgedb/test/test_https.py b/lib/bridgedb/test/test_https.py index 4ffbe08..cad0715 100644 --- a/lib/bridgedb/test/test_https.py +++ b/lib/bridgedb/test/test_https.py @@ -33,147 +33,147 @@ CAPTCHA_RESPONSE = 'Tvx74Pmy' class HTTPTests(unittest.TestCase): def setUp(self): - self.br = None +self.br = None def tearDown(self): - self.br = None +self.br = None def openBrowser(self): - # use mechanize to open the BridgeDB website in its browser - self.br = mechanize.Browser() - self.br.set_handle_robots(False) # prevents 'HTTP Error 403: request disallowed by robots.txt' - self.br.open(HTTPS_ROOT) - - # -- Home/Root page - self.assertTrue(self.br.viewing_html()) - self.assertEquals(self.br.response().geturl(), HTTPS_ROOT) - self.assertEquals(self.br.title(), BridgeDB) - #for link in self.br.links(): print(link) - #for form in self.br.forms(): print(form) - return self.br +# use mechanize to open the BridgeDB website in its browser +self.br = mechanize.Browser() +self.br.set_handle_robots(False) # prevents 'HTTP Error 403: request disallowed by robots.txt' +self.br.open(HTTPS_ROOT) + +# -- Home/Root page +self.assertTrue(self.br.viewing_html()) +self.assertEquals(self.br.response().geturl(), HTTPS_ROOT) +self.assertEquals(self.br.title(), BridgeDB) +#for link in self.br.links(): print(link) +#for form in self.br.forms(): print(form) +return self.br def goToOptionsPage(self): # check that we are on the root page - self.assertTrue(self.br.viewing_html()) - self.assertEquals(self.br.response().geturl(), HTTPS_ROOT) - - # follow the link with the word 'bridges' in it. - # Could also use: text='bridges' - # Could also use: url='/options' - self.br.follow_link(text_regex='bridges') - - # - Options - self.assertEquals(self.br.response().geturl(), HTTPS_ROOT + /options) - #print(self.br.response().read()) - #for form in self.br.forms(): print(form) - return self.br - +self.assertTrue(self.br.viewing_html()) +self.assertEquals(self.br.response().geturl(), HTTPS_ROOT) + +# follow the link with the word 'bridges' in it. +# Could also use: text='bridges' +# Could also use: url='/options' +self.br.follow_link(text_regex='bridges') + +# - Options +self.assertEquals(self.br.response().geturl(), HTTPS_ROOT + /options) +#print(self.br.response().read()) +#for form in self.br.forms(): print(form) +return self.br + def submitOptions(self, transport, ipv6, captchaResponse): - # check that we are on the options page - self.assertEquals(self.br.response().geturl(), HTTPS_ROOT + /options) - - # At this point, we'd like to be able to set some values in - # the 'advancedOptions' form. Unfortunately the HTML form - # does not define a 'name' attribute, so the we have to rely on - # the fact that this is the only form on the page and will therefore - # always exist at index 0. - #br.select_form(name=advancedOptions) - self.br.select_form(nr=0) - - # change the pluggable transport to something else - #print(self.br.form) - self.br.form['transport'] = [transport] +# check that we are on the options page +self.assertEquals(self.br.response().geturl(), HTTPS_ROOT + /options) + +# At this point, we'd like to be able to set some values in +# the 'advancedOptions' form. Unfortunately the HTML form +# does not define a 'name' attribute, so the we have to rely on +# the fact that this is the only form on the page and will therefore +# always exist at index 0. +#br.select_form(name=advancedOptions) +self.br.select_form(nr=0) + +# change the pluggable transport to something else +#print(self.br.form) +self.br.form['transport'] = [transport] if ipv6: self.br.form['ipv6'] = ['yes'] - self.br.submit() +self.br.submit() - # - Captcha - EXPECTED_URL = HTTPS_ROOT + /bridges?transport=%s % transport +# - Captcha +EXPECTED_URL = HTTPS_ROOT + /bridges?transport=%s % transport if ipv6: EXPECTED_URL += ipv6=yes - self.assertEquals(self.br.response().geturl(), EXPECTED_URL) - #print(self.br.response().read()) -
[tor-commits] [bridgedb/develop] Merge branch 'fix/9874-https' into develop
commit b95d400ff0293cf6de9fe9c2fa7a2dd78f1ee809 Merge: 74cdb09 be93cb7 Author: Isis Lovecruft i...@torproject.org Date: Tue Aug 12 03:23:36 2014 + Merge branch 'fix/9874-https' into develop .test.requirements.txt |3 +- .travis.requirements.txt | 24 + .travis.yml| 19 ++-- lib/bridgedb/test/test_bridgedb.py | 167 ++--- lib/bridgedb/test/test_https.py| 179 lib/bridgedb/test/util.py | 22 + setup.py |2 +- 7 files changed, 306 insertions(+), 110 deletions(-) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/develop] Add CHANGELOG entry for #9874.
commit f565959785b8a9bffd0014cef74427223ede7fab Author: Isis Lovecruft i...@torproject.org Date: Tue Aug 12 03:27:13 2014 + Add CHANGELOG entry for #9874. --- CHANGELOG |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 9d07e62..c6a5c2c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,10 @@ -Changes in version 0.2.3 - 2014-07-XXX +Changes in version 0.2.4 - 2014-08-XXX +* FIXES #9874 https://bugs.torproject.org/9874 +BridgeDB now has integration tests for all bridge distributors. +Thanks to trygve for the patches. + + +Changes in version 0.2.3 - 2014-07-26 * FIXES #5463 https://bugs.torproject.org/5463 XXX ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits