Release 3.6.0 (#239)

* chore: update dependencies

* chore: update user agent for measurements

* chore: we're now at v3.6.0

* chore: update assets

* chore: update bundled CA

* fix: address some goreportcard.com warnings

* fix(debian/changelog): zap release that breaks out build scripts

We're forcing the content of changelog with `dch`, so it's fine to
not have any specific new release in there.

* fix: make sure tests are passing locally

Notably, I removed a chunk of code where we were checking for network
activity. Now we don't fetch the databases and it's not important. Before,
it was important because the databases are ~large.

* fix: temporarily comment out riseupvn integration tests

See https://github.com/ooni/probe/issues/1354 for work aimed at
reducing the rate of false positives (thanks @cyBerta!)
This commit is contained in:
Simone Basso
2021-03-03 14:42:17 +01:00
committed by GitHub
parent 034db78f94
commit 0d4323ae66
24 changed files with 80 additions and 109 deletions
@@ -278,6 +278,7 @@ func TestFailureGeoIpServiceBlocked(t *testing.T) {
}
func TestFailureGateway(t *testing.T) {
t.Skip("test currently not WAI - will restore after release")
var testCases = [...]string{"openvpn", "obfs4"}
eipService, err := fetchEipService()
if err != nil {
@@ -421,7 +422,7 @@ func runGatewayTest(t *testing.T, censoredGateway *SelfCensoredGateway) {
}
if tk.APIStatus == "blocked" {
t.Fatal("invalid ApiStatus")
t.Fatal("invalid ApiStatus", tk.APIStatus)
}
if tk.APIFailure != nil {
+1 -1
View File
@@ -100,7 +100,7 @@ func TestMeasurerMeasureFetchTorTargetsEmptyList(t *testing.T) {
func TestMeasurerMeasureGoodWithMockedOrchestra(t *testing.T) {
// This test mocks orchestra to return a nil list of targets, so the code runs
// but we don't perform any actualy network actions.
// but we don't perform any actual network actions.
measurer := NewMeasurer(Config{})
measurer.newOrchestraClient = func(ctx context.Context, sess model.ExperimentSession) (model.ExperimentOrchestraClient, error) {
return new(probeservices.Client), nil
@@ -109,7 +109,7 @@ func Summarize(tk *TestKeys) (out Summary) {
tcpIP = "tcp_ip"
)
// If the measurement was for an HTTPS website and the HTTP experiment
// succeded, then either there is a compromised CA in our pool (which is
// succeeded, then either there is a compromised CA in our pool (which is
// certifi-go), or there is transparent proxying, or we are actually
// speaking with the legit server. We assume the latter. This applies
// also to cases in which we are redirected to HTTPS.
@@ -129,7 +129,7 @@ func Summarize(tk *TestKeys) (out Summary) {
if tk.DNSExperimentFailure != nil &&
*tk.DNSExperimentFailure == errorx.FailureDNSNXDOMAINError &&
tk.DNSConsistency != nil && *tk.DNSConsistency == DNSConsistent {
// TODO(bassosimone): MK flags this as accessible. This result is debateable. We
// TODO(bassosimone): MK flags this as accessible. This result is debatable. We
// are doing what MK does. But we most likely want to make it better later.
//
// See <https://github.com/ooni/probe-engine/issues/579>.
@@ -146,7 +146,7 @@ func Summarize(tk *TestKeys) (out Summary) {
out.Status |= StatusAnomalyDNS | StatusExperimentDNS
return
}
// If we tried to connect more than once and never succeded and we were
// If we tried to connect more than once and never succedeed and we were
// able to measure DNS consistency, then we can conclude something.
if tk.TCPConnectAttempts > 0 && tk.TCPConnectSuccesses <= 0 && tk.DNSConsistency != nil {
out.Status |= StatusAnomalyConnect | StatusExperimentConnect
+2 -2
View File
@@ -3,8 +3,8 @@ package httpheader
// UserAgent returns the User-Agent header used for measuring.
func UserAgent() string {
// 12.0% as of Jan 29, 2021 according to https://techblog.willshouse.com/2012/01/03/most-common-user-agents/
const ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36"
// 8.0% as of Mar 3, 2021 according to https://techblog.willshouse.com/2012/01/03/most-common-user-agents/
const ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36"
return ua
}
+1 -1
View File
@@ -34,7 +34,7 @@ func testresolverquick(t *testing.T, network, address string) {
}
}
if !foundquad8 {
t.Fatalf("did not find 8.8.8.8 in ouput; output=%+v", addrs)
t.Fatalf("did not find 8.8.8.8 in output; output=%+v", addrs)
}
}
@@ -173,27 +173,27 @@ func configureDNS(seed int64, network, address string) (modelx.DNSResolver, erro
return nil, err
}
fallbacks := []dnsFallback{
dnsFallback{
{
network: "doh",
address: "https://cloudflare-dns.com/dns-query",
},
dnsFallback{
{
network: "doh",
address: "https://dns.google/dns-query",
},
dnsFallback{
{
network: "dot",
address: "8.8.8.8:853",
},
dnsFallback{
{
network: "dot",
address: "8.8.4.4:853",
},
dnsFallback{
{
network: "dot",
address: "1.1.1.1:853",
},
dnsFallback{
{
network: "dot",
address: "9.9.9.9:853",
},
@@ -274,10 +274,10 @@ func obfs4config() OBFS4ConnectConfig {
Address: "109.105.109.165:10527",
StateBaseDir: "../../testdata/",
Params: map[string][]string{
"cert": []string{
"cert": {
"Bvg/itxeL4TWKLP6N1MaQzSOC6tcRIBv6q57DYAZc3b2AzuM+/TfB7mqTFEfXILCjEwzVA",
},
"iat-mode": []string{"1"},
"iat-mode": {"1"},
},
}
}
+1 -1
View File
@@ -19,7 +19,7 @@ func (d ErrorWrapperDialer) DialContext(ctx context.Context, network, address st
conn, err := d.Dialer.DialContext(ctx, network, address)
err = errorx.SafeErrWrapperBuilder{
// ConnID does not make any sense if we've failed and the error
// does not make any sense (and is nil) if we succeded.
// does not make any sense (and is nil) if we succeeded.
DialID: dialID,
Error: err,
Operation: errorx.ConnectOperation,
+1 -1
View File
@@ -38,7 +38,7 @@ func WithProxyURL(ctx context.Context, url *url.URL) context.Context {
// DialContext implements Dialer.DialContext
func (d ProxyDialer) DialContext(ctx context.Context, network, address string) (net.Conn, error) {
url := ContextProxyURL(ctx) // context URL takes precendence
url := ContextProxyURL(ctx) // context URL takes precedence
if url == nil {
url = d.ProxyURL
}
+2 -2
View File
@@ -1,5 +1,5 @@
// Code generated by go generate; DO NOT EDIT.
// 2021-01-29 09:54:51.941105652 +0100 CET m=+1.231498959
// 2021-03-03 11:48:43.129132377 +0100 CET m=+2.301468593
// https://curl.haxx.se/ca/cacert.pem
package gocertifi
@@ -3241,7 +3241,7 @@ kpzNNIaRkPpkUZ3+/uul9XXeifdy
`
// CACerts builds an X.509 certificate pool containing the
// certificate bundle from https://curl.haxx.se/ca/cacert.pem fetch on 2021-01-29 09:54:51.941105652 +0100 CET m=+1.231498959.
// certificate bundle from https://curl.haxx.se/ca/cacert.pem fetch on 2021-03-03 11:48:43.129132377 +0100 CET m=+2.301468593.
// Returns nil on error along with an appropriate error code.
func CACerts() (*x509.CertPool, error) {
pool := x509.NewCertPool()
@@ -22,7 +22,7 @@ func (d ErrorWrapperDialer) DialContext(
sess, err := d.Dialer.DialContext(ctx, network, host, tlsCfg, cfg)
err = errorx.SafeErrWrapperBuilder{
// ConnID does not make any sense if we've failed and the error
// does not make any sense (and is nil) if we succeded.
// does not make any sense (and is nil) if we succeeded.
DialID: dialID,
Error: err,
Operation: errorx.QUICHandshakeOperation,
@@ -69,7 +69,7 @@ func TestSystemDialerSuccessWithReadWrite(t *testing.T) {
t.Fatal("unexpected Name")
}
if ev[idx].Time.Before(ev[idx-1].Time) {
t.Fatal("unexpected Time")
t.Fatal("unexpected Time", ev[idx].Time, ev[idx-1].Time)
}
}
}
@@ -51,7 +51,7 @@ func validate(t *testing.T, data []byte, qtype byte) {
t.Fatal("The name does not contain 1:x")
}
if data[14] != 3 || data[15] != byte('o') || data[16] != byte('r') || data[17] != byte('g') {
t.Fatal("The name does not containg 3:org")
t.Fatal("The name does not contain 3:org")
}
if data[18] != 0 {
t.Fatal("The name does not terminate where expected")
@@ -34,7 +34,7 @@ func testresolverquick(t *testing.T, reso resolver.Resolver) {
}
}
if !foundquad8 {
t.Fatalf("did not find 8.8.8.8 in ouput; output=%+v", addrs)
t.Fatalf("did not find 8.8.8.8 in output; output=%+v", addrs)
}
}
+7 -7
View File
@@ -2,7 +2,7 @@ package resources
const (
// Version contains the assets version.
Version = 20210129095811
Version = 20210303114512
// ASNDatabaseName is the ASN-DB file name
ASNDatabaseName = "asn.mmdb"
@@ -30,13 +30,13 @@ type ResourceInfo struct {
// All contains info on all known assets.
var All = map[string]ResourceInfo{
"asn.mmdb": {
URLPath: "/ooni/probe-assets/releases/download/20210129095811/asn.mmdb.gz",
GzSHA256: "ef1759bf8b77128723436c4ec5a3d7f2e695fb5a959e741ba39012ced325132c",
SHA256: "0afa5afc48ba913933f17b11213c3044499c8338cf63b8f9af2778faa5875474",
URLPath: "/ooni/probe-assets/releases/download/20210303114512/asn.mmdb.gz",
GzSHA256: "efafd5a165c5a4e6bf6258d87ed685254a2660669eb4557e25c5ed72e48d039a",
SHA256: "675dbaec3fa1e6f12957c4e4ddee03f50f5192507b5095ccb9ed057468c2441b",
},
"country.mmdb": {
URLPath: "/ooni/probe-assets/releases/download/20210129095811/country.mmdb.gz",
GzSHA256: "5d465224ab02242a8a79652161d2768e64dd91fc1ed840ca3d0746f4cd29a914",
SHA256: "b4aa1292d072d9b2631711e6d3ac69c1e89687b4d513d43a1c330a92b7345e4d",
URLPath: "/ooni/probe-assets/releases/download/20210303114512/country.mmdb.gz",
GzSHA256: "7f1db0e2903271258319834f26bbcdedd2d0641457a8c0a63b048a985b7d6e7b",
SHA256: "19e4d2c5cd31789da1a67baf883995f2ea03c4b8ba7342b69ef8ae2c2aa8409c",
},
}
@@ -36,6 +36,14 @@ type CopyWorker struct {
WriteFile func(filename string, data []byte, perm fs.FileMode) error // optional
}
// If you arrive here because of this error:
//
// internal/engine/resourcesmanager/resourcesmanager.go:39:12: pattern *.mmdb.gz: no matching files found
// internal/engine/resourcesmanager/resourcesmanager.go:39:12: pattern *.mmdb.gz: no matching files found
//
// then your problem is that you need to fetch resources _before_ compiling
// ooniprobe. See Readme.md for instructions on how to do that.
//go:embed *.mmdb.gz
var efs embed.FS
@@ -305,12 +305,6 @@ func TestSessionLocationLookup(t *testing.T) {
if sess.ResolverNetworkName() == geolocate.DefaultResolverNetworkName {
t.Fatal("unexpected ResolverNetworkName")
}
if sess.KibiBytesSent() <= 0 {
t.Fatal("unexpected KibiBytesSent")
}
if sess.KibiBytesReceived() <= 0 {
t.Fatal("unexpected KibiBytesReceived")
}
}
func TestSessionCloseCancelsTempDir(t *testing.T) {
+1 -1
View File
@@ -3,5 +3,5 @@ package version
const (
// Version is the software version
Version = "3.5.2"
Version = "3.6.0"
)