Commit Graph

95 Commits

Author SHA1 Message Date
Simone Basso
ef4b1aee76
Upgrade to probe-engine@v0.13.0 and fix Psiphon logic (#138)
* go.mod go.sum: pin to ooni/probe-engine@v0.13.0, update all other deps

Make sure dependencies of probe-engine are at the same exact version to
which is probe-engine, to avoid any possible issue.

* Readme.md: clarify the procedure for updating deps
2020-06-15 14:57:00 +02:00
Simone Basso
b4934b1619
Use ooni/probe-engine 0.12.0+patches (#133)
* nettests/groups.go: remove redundant struct names

* go.mod go.sum: update deps except probe-engine

* Update to ooni/probe-engine@e768161f91

The API has changed. Methods that used to change bits of the session have
been removed. Now the session is more immutable than before.

As such, we need to completely fill the config before using it.

* Set IncludeCountry to always true

Co-authored-by: Arturo Filastò <arturo@filasto.net>
2020-06-04 11:19:38 +02:00
Simone Basso
967e9f0924 nettests/nettests.go: use experiment getters to get data usage 2020-04-05 23:38:18 +02:00
Simone Basso
07e4367f6d
nettests: Just use "ndt", which is now "ndt7" in probe-engine (#121)
Part of https://github.com/ooni/backend/issues/369
2020-03-18 15:50:55 +01:00
Simone Basso
fe0b4a02be
nettests/ndt.go: use ndt7 rather than ndt5 (#119)
Part of https://github.com/ooni/probe/issues/969
2020-03-12 19:36:32 +01:00
Simone Basso
1d5c913019
Update deps and pin to ooni/probe-engine@v0.8.0 (#118)
Part of https://github.com/ooni/probe/issues/1030
2020-03-10 12:02:30 +01:00
Arturo Filastò
ac893c9095
Merge pull request #108 from ooni/issue/316
nettests.go: don't stop when measurement is failed
2020-02-13 14:22:59 +01:00
Arturo Filastò
f47391e24c Make log line be debug level 2020-02-12 15:08:36 +01:00
Arturo Filastò
1f94b20be5 Add support for parsing the enabled websites category codes
This implements: https://github.com/ooni/probe/issues/1012
2020-02-12 15:07:40 +01:00
Simone Basso
d44102bb7c nettests.go: don't stop when measurement is failed
Closes https://github.com/ooni/probe-engine/issues/316

Rationale: a measurement may fail for a bunch of reasons including
buts in the code. The original determination was that we won't
return an error from the measurement in case of anomaly. But doing
that is error prone, and indeed the Psiphon experiment was not
following this pattern. I claim that this pattern was wrong, and
it's much more in our interest to submit and store on disk anything
that we get from a measurement. This data can be useful to look
into bugs, as well as to discover novel anomalies we didnt' anticipate.
2020-02-11 15:28:35 +01:00
Arturo Filastò
e3d68457b3 Implement writing using the new single measurement pattern 2020-01-28 11:53:00 +01:00
Simone Basso
03e7d2ccac
circumvention: add the tor experiment (#100)
* go.mod go.sum: update all non-probe-engine deps

For each line in the go.mod, run `go get -u -v $package` if the
line is not an indirect dependency and is not probe-engine.

Upgrading probe-engine is going to require the same spell that
is used in probe-engine to update psiphon.

* go get -v github.com/ooni/probe-engine@v0.5.0

This just pins to the latest probe-engine but we've not manually
pinned all the other dependencieds yet.

Take care of the trivial API changes in probe-engine as well, such
that we can have a working build after this commit.

* go.mod go.sum: pin to probe-engine dependencies

Basically: remove all indirect dependencies. Merge this go.mod with
the one of probe-engine, to pin dependencies. Run `go mod tidy`.

* circumvention: add basic implementation of tor

This needs to be polished further, of course. But at least we have
now added support for running tor in the circumvention group.

* Readme.md: document how to update dependencies

* go get -v github.com/ooni/probe-engine@fcc9ee0a7afb

* go get -v github.com/ooni/probe-engine@4d254f5b2

* nettests/tor.go: implement summary test keys
2020-01-28 10:05:54 +01:00
Arturo Filastò
427ca18985 Refactor pattern of ok !ok 2020-01-07 16:44:11 +02:00
Arturo Filastò
2cb6661340 Fix typo 2020-01-07 16:42:04 +02:00
Arturo Filastò
24316728b9 Improve the output and extraction of psiphon metrics 2020-01-07 16:13:13 +02:00
Simone Basso
1e8b482c23
Allow to specify custom software name and version (#94)
In turn, this allows us to identify as ooniprobe-cli v3.0.0-rc.5.

Closes #41.
2019-12-29 14:07:57 +01:00
Simone Basso
955509e6f8 nettests: don't say ETA is infinite
1. only print time left if ETA is positive

2. skip ETA calculation with a single input

3. don't compute ETA for first entry[*]

[*] this is actually what avoids emitting infinite but the other
parts of this diff felt useful yak shaving as well.

Closes #91
2019-12-28 18:28:08 +01:00
Simone Basso
991b875bd9 fix(nettests/telegram.go): remove MK option
This option was meaningful for an MK implementation of Telegram but
is not meaningful for the new Go based implementation.

Closes #90
2019-12-28 17:56:47 +01:00
Simone Basso
259ab41b15 Implement the circumvention nettest group
Only Psiphon for now. Closes #87 #77.
2019-12-28 17:48:07 +01:00
Arturo Filastò
7bbbab8774 Handle the SIGINT and SIGTERM signals to support stopping a test cleanly (#84) 2019-12-27 11:32:08 +01:00
Simone Basso
8a1622d0c1 Update to ooni/probe-engine@v0.3.0
1. `go get -u github.com/ooni/probe-engine@v0.3.0`

2. `go mod tidy`

3. fix build failures
2019-12-26 18:09:23 +01:00
Arturo Filastò
b7deb6c88f Use a faster nettest for testing 2019-12-02 18:00:12 +02:00
Arturo Filastò
ccdff3ba24 Move IM tests into top level tree too 2019-12-02 17:59:37 +02:00
Arturo Filastò
b20af107dc Refactor nettests into top tree 2019-12-02 17:57:55 +02:00
Arturo Filastò
8a27de6c7d
Remove all settings which are not implemented (#73)
* Remove all settings which are not implemented

* Add support for migrating config files from version 0 -> 1

Add basic unittests for the config file migration

* Update the config file used by travis

* Fix typos in console log messages

* Improve the comment

* Fix type of limit

* Set informed consent to true in the travis config
2019-11-14 17:58:31 +01:00
Arturo Filastò
bc1314ca61
Add support for calculating the estimate time remaining (#71) 2019-11-14 12:01:40 +01:00
Simone Basso
946289d6fe
Use more general ooni/probe-engine API (#67)
No functional change, just importing less stuff and meddling
much less with the internals of ooni/probe-engine.
2019-10-28 14:05:05 +01:00
Arturo Filastò
f425d3f007 Implement the show command (#53) 2019-10-02 18:23:14 +02:00
Simone Basso
b9b555ba68 Integrate further with ooni/probe-engine: episode two (#46)
* utils/geoip.go: use github.com/ooni/probe-engine

Let's start using the engine by rewriting utils/geoip.go to
be just a thin wrapper around the engine functionality.

* Ready for review

* Checkpoint: the im tests are converted

Still have some doubts with respect to the variables that
are passed to MK via probe-engine. Will double check.

* fix(i/c/r/run.go): write the correct logic

* nettests: one more comment and also fix a format string

* Tweak previous

* progress

* Fix doofus

* better comment

* XXX => actionable comment

* Add glue to simplify test keys management

Making the concept of measurement more abstract in the engine is
not feasible because, when submitting a measurement, we need to
modify it to update the report ID and the measurement ID. Therefore,
returning a serialized measurement is not a good idea. We will
keep using a model.Measurement in the engine.

Changing model.Measurement.TestKeys's type from a `interface{}`
pointing to a well defined data structure to `map[string]interface{}`
is a regression because means that we are moving from code that
has a clear and defined structure to code that is more complicated
to parse and validate. Since we're already suffering havily from
the lack of a good schema, I'm not going to make the situation
worst by worsening the engine. At least for ndt7 and psiphon, we
now have a good schema and I don't want to lose that.

However, the current code in this repository is expecting the
test keys to be a `map[string]interface{}`. This choice was
dictated by the fact that we receive a JSON from Measurement Kit
and by the fact that there's not a clear schema.

To solve this tension, in this commit I am going to write glue
adapter code that makes sure that the TestKeys of a Measurement
are converted to `map[string]interface{}`. This will be done
using a type cast where possible and JSON serialization and parsing
otherwise. In a perfect world, glue is not a good idea, but in a
real world it may actually be useful.

When all tests in the engine will have a clear Go data structure,
we'll then remove the glue and just cast to the proper data
structure from `interface{}` where required.

* nettests/performance: use probe-engine

* go.{mod,sum}: upgrade to latest probe-engine

* nettests/middlebox: use ooni/probe-engine

* Update to the latest probe-engine

* web_connectivity: rewrite to use probe-engine

* Cosmetic change suggested by @hellais

* nettests/nettests.go: remove unused code

* nettests/nettests.go: fix progress

* nettests/nettests.go: remove go-measurement-kit code

* We don't depend on go-measurement-kit anymore

* Improve non-verbose output where possible

See also: https://github.com/measurement-kit/measurement-kit/issues/1856

* Make web_connectivity output pleasant

* Update to the latest probe-engine

* nettests/nettests.go: honour sharing settings

* Update to the latest probe-engine

* Use log.WithFields for probe-engine

* Update go.mod go.sum

* Revert "Update go.mod go.sum"

This reverts commit 5ecd38d8236f4a4e9b77ddb8e8a0d1e3cdd4b818.

* Revert "Revert "Update go.mod go.sum""

This reverts commit 6114b31eca98826112032776bd0feff02d763ecd.

* Upgrade ooni/probe-engine

* Unset GOPATH before running go build commands

* Dockefile: fix linux build by using latest

* Update to the latest ooni/probe-engine

```
go get -u github.com/ooni/probe-engine
go mod tidy
```

* Repair build
2019-08-15 18:08:43 +02:00
Simone Basso
df629237be
Use ooni/probe-engine: episode 1 (#42) 2019-05-23 16:38:46 +02:00
Arturo Filastò
23423cd74f Put MK loglevel to info 2019-05-16 10:22:29 +02:00
Arturo Filastò
6afc8bcc94 Remove reference to caBundlePath 2019-05-15 19:30:10 +02:00
Arturo Filastò
4ead3802a4 Bump MK verbosity and print SSL_CERT value 2019-05-15 19:29:34 +02:00
Arturo Filastò
9155ec95ae Remove getCaBundlePath 2019-05-15 19:25:23 +02:00
Arturo Filastò
5d0e6e6c8c Use info level MK debug 2019-05-15 16:14:01 +02:00
Simone Basso
9992690f8f Use MK v0.10.x, zap legacy GeoIP, build also on Linux (#29)
* Gopkg.lock: use MK v0.10.3

* ooni: stop using legacy GeoIP database files

* Some yak shaving of Makefile

1. remove now broken commands to download deps

2. also define the CXX cross compiler

* chore(dep): migrate from dep to go 1.11+ modules

See https://blog.callr.tech/migrating-from-dep-to-go-1.11-modules/

I need this to simplify my life in building for Travis.

* Introduce build.sh and repair build

In going forward, I believe we don't actually need a Makefile but I
didn't want to make such a radical change now.

* Another strategy wrt gopath

* travis: run regress tests on macOS

Closes #30
2019-05-15 15:48:06 +03:00
Arturo Filastò
1879f8e961 Make the testKeys extractions methods more robust 2018-09-27 11:40:57 +02:00
Arturo Filastò
bc5fe7d8bf Fix bug in report_create event 2018-09-27 11:12:22 +02:00
Arturo Filastò
a60f376846 Adjust the progress bars depending on the test type 2018-09-24 15:57:28 +02:00
Arturo Filastò
0d21186492 Add support for custom collectors and bouncers 2018-09-21 18:54:44 +02:00
Arturo Filastò
cd04ba8bf9 Remove sketchy workaround to UTF-8 characters in homedir
We now implement a workaround to this inside of probe-desktop.
See: d97189f312
2018-09-18 12:10:11 +02:00
Arturo Filastò
4738f7f32d Workaround to keep track of upload state 2018-09-17 13:00:00 +02:00
Arturo Filastò
bd6a5acf5b Sent ooniprobe-desktop as the software name 2018-09-17 11:52:10 +02:00
Arturo Filastò
5cae6b0b83 Make it possible to disable uploading of results 2018-09-17 11:51:54 +02:00
Arturo Filastò
4ed94dfc53 Improve the presentation of the measurement listing from the CLI 2018-09-13 14:54:56 +02:00
Arturo Filastò
7f5df07782 Fix a very annoying logic bug in URL insertion
Write test case for it
2018-09-12 18:47:57 +02:00
Arturo Filastò
2b1fb662fb Fix showing data usage indicators 2018-09-12 14:03:07 +02:00
Arturo Filastò
4880d31120 Fix data usage count 2018-09-12 13:48:18 +02:00
Arturo Filastò
54af7170d4 Add support for data_usage event 2018-09-12 13:42:16 +02:00
Arturo Filastò
1637fdbf93 Structured output of measurements 2018-09-10 18:03:32 +02:00