From 4364c7d59be5616e67a56a5e570b80c7ef063569 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Wed, 8 Jan 2020 11:04:12 +0100 Subject: [PATCH 1/2] ooniresolver_test.go: clarify when this test may fail It certainly fails in my house. I have Vodafone Italy and I have not disabled the "rete sicura" option, which does DNS hijacking. I used to have it disabled, but then I moved and now I am again using the default value of that setting. So, I figured it made sense to run all tests and mark those which are going to fail if you're under a similar setup. (Making them pass under such conditions is probably not what I want.) --- internal/resolver/ooniresolver/ooniresolver_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/resolver/ooniresolver/ooniresolver_test.go b/internal/resolver/ooniresolver/ooniresolver_test.go index 0859af0..1476efb 100644 --- a/internal/resolver/ooniresolver/ooniresolver_test.go +++ b/internal/resolver/ooniresolver/ooniresolver_test.go @@ -49,7 +49,9 @@ func TestLookupCNAME(t *testing.T) { func TestLookupHostWithRetry(t *testing.T) { // Because there is no server there, if there is no DNS injection - // then we are going to see several timeouts. + // then we are going to see several timeouts. However, this test is + // going to fail if you're under permanent DNS hijacking, which is + // what happens with Vodafone "Rete Sicura" (on by default) in Italy. client := New(dnsoverudp.NewTransport( &net.Dialer{}, "www.example.com:53", )) From 1cbdb1503885e84906c4fe532404db2e7a22d047 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Wed, 8 Jan 2020 11:14:32 +0100 Subject: [PATCH 2/2] porcelain_test.go: repair broken integration test The test assumed there was no redirect when accessing ooni.io but it has recently changed to redirect to ooni.org. By changing the input URL for this integration test, we fix it. --- x/porcelain/porcelain_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/porcelain/porcelain_test.go b/x/porcelain/porcelain_test.go index a97b43f..9485088 100644 --- a/x/porcelain/porcelain_test.go +++ b/x/porcelain/porcelain_test.go @@ -241,7 +241,7 @@ func TestIntegrationBodySnapSizes(t *testing.T) { ) ctx := context.Background() results := HTTPDo(ctx, HTTPDoConfig{ - URL: "https://ooni.io", + URL: "https://ooni.org", MaxEventsBodySnapSize: maxEventsBodySnapSize, MaxResponseBodySnapSize: maxResponseBodySnapSize, })