From ef4b1aee76246220b2d889fc6648fa4253d166ba Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Mon, 15 Jun 2020 14:57:00 +0200 Subject: [PATCH] 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 --- Readme.md | 10 ++++++++-- go.mod | 2 +- go.sum | 40 ++++++++++++++++++++-------------------- nettests/psiphon.go | 14 +++++++------- 4 files changed, 36 insertions(+), 30 deletions(-) diff --git a/Readme.md b/Readme.md index 1621175..b17bf37 100644 --- a/Readme.md +++ b/Readme.md @@ -78,10 +78,16 @@ instructions on how to install dependencies. ## Updating dependencies 1. update every direct dependency in `go.mod` except `probe-engine` -using `go get -u -v $dependency` +using `go get -u -v $dependency`: + +``` +for name in `grep -v indirect go.mod | grep -v probe-engine | awk '/^\t/{print $1}'`; do \ + go get -u -v $name; \ +done +``` 2. pin to the latest version of the `probe-engine` with -`go get -v github.com/ooni/probe-engine@tag` +`go get -v github.com/ooni/probe-engine@TAG` 3. remove all indirect dependencies from `go.mod` and merge the content of `probe-engine`'s `go.mod` into our `go.mod` diff --git a/go.mod b/go.mod index cd57570..20be061 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/fatih/color v1.9.0 github.com/getsentry/raven-go v0.0.0-20190419175539-919484f041ea github.com/mattn/go-colorable v0.1.6 - github.com/ooni/probe-engine v0.12.1-0.20200529160604-e768161f91db + github.com/ooni/probe-engine v0.13.0 github.com/pkg/errors v0.9.1 github.com/rubenv/sql-migrate v0.0.0-20200429072036-ae26b214fa43 gopkg.in/AlecAivazis/survey.v1 v1.8.8 diff --git a/go.sum b/go.sum index f5e8751..8390985 100644 --- a/go.sum +++ b/go.sum @@ -19,20 +19,18 @@ github.com/Psiphon-Labs/bolt v0.0.0-20200203172706-f3d58e369264 h1:HE/SqHaxiGrMq github.com/Psiphon-Labs/bolt v0.0.0-20200203172706-f3d58e369264/go.mod h1:JRYGUlpSqM4W5cdQu2oUVfNoAw1XJ79ibUQ+OHc1QiE= github.com/Psiphon-Labs/chacha20 v0.2.1-0.20200128191310-899a4be52863 h1:K6noP73BqojSybxrJnGRVmCOFsQ4vCAL2/h4K0k7p8A= github.com/Psiphon-Labs/chacha20 v0.2.1-0.20200128191310-899a4be52863/go.mod h1:etJKEBpSqqzNKGPLUYlVc0dTE5LEkGRcR8fa127A5UQ= -github.com/Psiphon-Labs/dns v0.0.0-20170814182607-d23cdaf67bbc h1:W+dNJivdYUujm+mhvmSDn3847jbzar8J7qzjj/w4U6I= -github.com/Psiphon-Labs/dns v0.0.0-20170814182607-d23cdaf67bbc/go.mod h1:F1eU0RdWZXN2kn6A8cBRixr1HLyM1Va7xXp88LRhlps= github.com/Psiphon-Labs/goarista v0.0.0-20160825065156-d002785f4c67 h1:aQE2/masBGr/uqI63UIxN/IkRByNTxjYz2JYySw9ry8= github.com/Psiphon-Labs/goarista v0.0.0-20160825065156-d002785f4c67/go.mod h1:5Jm7sRmp4HSWIoZk/ZRryF/KbcQeIhBMoaGqD7psbkU= github.com/Psiphon-Labs/goptlib v0.0.0-20200406165125-c0e32a7a3464 h1:VmnMMMheFXwLV0noxYhbJbLmkV4iaVW3xNnj6xcCNHo= github.com/Psiphon-Labs/goptlib v0.0.0-20200406165125-c0e32a7a3464/go.mod h1:Pe5BqN2DdIdChorAXl6bDaQd/wghpCleJfid2NoSli0= github.com/Psiphon-Labs/net v0.0.0-20191204183604-f5d60dada742 h1:te4lDZfA3tFwaheo+h/GZYGiLGJvm7Dcq2YkFh13QmE= github.com/Psiphon-Labs/net v0.0.0-20191204183604-f5d60dada742/go.mod h1:3mBCrUrPxFCKAhG0ZdEfiU7QU6zl2+gr1HUk1sKYdjI= -github.com/Psiphon-Labs/psiphon-tunnel-core v2.0.11+incompatible h1:GCjSr2s/r5vVkm1rsnCzKt3UWhpUyuqnJIRG+ZnLId8= -github.com/Psiphon-Labs/psiphon-tunnel-core v2.0.11+incompatible/go.mod h1:VcNEtiQ0z2sCGJf16ZGcpwCas5+r9rt+P20r6LlJ06U= +github.com/Psiphon-Labs/psiphon-tunnel-core v2.0.12-0.20200608133602-4698936ee666+incompatible h1:+o+Bx2k8rk1PjekH4zUx65TcIinj7611JegDAFfuAvo= +github.com/Psiphon-Labs/psiphon-tunnel-core v2.0.12-0.20200608133602-4698936ee666+incompatible/go.mod h1:VcNEtiQ0z2sCGJf16ZGcpwCas5+r9rt+P20r6LlJ06U= github.com/Psiphon-Labs/quic-go v0.14.1-0.20200306193310-474e74c89fab h1:LYp5/y2XR38yyDtNyEZBt0TtFaWgrYMNu3hEcN+om6c= github.com/Psiphon-Labs/quic-go v0.14.1-0.20200306193310-474e74c89fab/go.mod h1:I0Z7XA8KzHZl2MzwqEbZJhBQOHT8ajGUQ5+SWf5KHw0= -github.com/Psiphon-Labs/tls-tris v0.0.0-20200326183334-7ff412878bba h1:V2+6lGbWy16VL1j75pry549QavFCmp+MOtEGthL0dH8= -github.com/Psiphon-Labs/tls-tris v0.0.0-20200326183334-7ff412878bba/go.mod h1:v3y9GXFo9Sf2mO6auD2ExGG7oDgrK8TI7eb49ZnUxrE= +github.com/Psiphon-Labs/tls-tris v0.0.0-20200504183724-16ab4b2ea797 h1:8jTZ+3BhLiYm3QJ4qH2l5Oeb8Vft5eMVG/cYk4uoi4s= +github.com/Psiphon-Labs/tls-tris v0.0.0-20200504183724-16ab4b2ea797/go.mod h1:v3y9GXFo9Sf2mO6auD2ExGG7oDgrK8TI7eb49ZnUxrE= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/sarama v1.26.1/go.mod h1:NbSGBSSndYaIhRcBtY9V0U7AyH+x71bG668AuWys/yU= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= @@ -59,8 +57,8 @@ github.com/aphistic/golf v0.0.0-20180712155816-02c07f170c5a/go.mod h1:3NqKYiepwy github.com/aphistic/sweet v0.2.0/go.mod h1:fWDlIh/isSE9n6EPsRmC0det+whmX6dJid3stzu0Xys= github.com/aristanetworks/fsnotify v1.4.2/go.mod h1:D/rtu7LpjYM8tRJphJ0hUBYpjai8SfX+aSNsWDTq/Ks= github.com/aristanetworks/glog v0.0.0-20191112221043-67e8567f59f3/go.mod h1:KASm+qXFKs/xjSoWn30NrWBBvdTTQq+UjkhjEJHfSFA= -github.com/aristanetworks/goarista v0.0.0-20200410125653-0a3087568c00 h1:TTtNI7l0CDy3xNObgxyI20KzJvOY8DhzZqLPNGwBvKE= -github.com/aristanetworks/goarista v0.0.0-20200410125653-0a3087568c00/go.mod h1:QZe5Yh80Hp1b6JxQdpfSEEe8X7hTyTEZSosSrFf/oJE= +github.com/aristanetworks/goarista v0.0.0-20200602234848-db8a79a18e4a h1:SLrT2O2v0QGaH1JSte1vJ2HtreWZa0MjdGSfXp25qlc= +github.com/aristanetworks/goarista v0.0.0-20200602234848-db8a79a18e4a/go.mod h1:QZe5Yh80Hp1b6JxQdpfSEEe8X7hTyTEZSosSrFf/oJE= github.com/aristanetworks/splunk-hec-go v0.3.3/go.mod h1:1VHO9r17b0K7WmOlLb9nTk/2YanvOEnLMUgsFrxBROc= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= @@ -325,8 +323,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.29 h1:xHBEhR+t5RzcFJjBLJlax2daXOrTYtr9z4WdKEfWFzg= -github.com/miekg/dns v1.1.29/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= +github.com/miekg/dns v1.1.30-0.20200428072418-d128d10d176b h1:HOmliqRWsjtpSxWaulwlgzShQQCiI0yIaoxJoSDcxao= +github.com/miekg/dns v1.1.30-0.20200428072418-d128d10d176b/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -362,8 +360,8 @@ github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/ooni/probe-engine v0.12.1-0.20200529160604-e768161f91db h1:FPpbvR8pLrrkXewpZCkOE4UU2Qqn6bkYLWz9of53nPE= -github.com/ooni/probe-engine v0.12.1-0.20200529160604-e768161f91db/go.mod h1:PigipvcUn71UWONQ3lVO4e+NxW8g/5zSqgimQdj/WNg= +github.com/ooni/probe-engine v0.13.0 h1:K1kPefC6PGFpuFYXymLgsEdwnLeCf6k6I47OjFv4/vM= +github.com/ooni/probe-engine v0.13.0/go.mod h1:Y5o5zVyqVMOyUNmpDJ+i5hGaJNIiK4j73QMuANXpfQI= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/openconfig/gnmi v0.0.0-20190823184014-89b2bf29312c/go.mod h1:t+O9It+LKzfOAhKTT5O0ehDix+MTqbtT0T9t+7zzOvc= github.com/openconfig/reference v0.0.0-20190727015836-8dfd928c9696/go.mod h1:ym2A+zigScwkSEb/cVQB0/ZMpU3rqiH6X7WRRsxgOGw= @@ -390,6 +388,8 @@ github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9 github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.4.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pion/stun v0.3.5 h1:uLUCBCkQby4S1cf6CGuR9QrVOKcvUwFeemaC865QHDg= +github.com/pion/stun v0.3.5/go.mod h1:gDMim+47EeEtfWogA37n6qXZS88L5V6LqFcf+DZA2UA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -424,8 +424,8 @@ github.com/redjack/marionette v0.0.0-20180818172807-360dd8f58226 h1:8+dAj8X8Lmdu github.com/redjack/marionette v0.0.0-20180818172807-360dd8f58226/go.mod h1:yJd0pT0e04p+VSmLGjce8BoPlRDlrGrdfXf2En7oq9A= github.com/refraction-networking/gotapdance v0.0.0-20190909202946-3a6e1938ad70 h1:EUwVKYIxba8xd9YeCG+63W2HiwKDPIw92F4pccOmXug= github.com/refraction-networking/gotapdance v0.0.0-20190909202946-3a6e1938ad70/go.mod h1:iBzxMSHu9kVV7v3Rc6vcDVCUDLsRGqLL3vtiR74JBvk= -github.com/refraction-networking/utls v0.0.0-20190909200633-43c36d3c1f57 h1:SL1K0QAuC1b54KoY1pjPWe6kSlsFHwK9/oC960fKrTY= -github.com/refraction-networking/utls v0.0.0-20190909200633-43c36d3c1f57/go.mod h1:tz9gX959MEFfFN5whTIocCLUG57WiILqtdVxI8c6Wj0= +github.com/refraction-networking/utls v0.0.0-20200601200209-ada0bb9b38a0 h1:vIkvetWOJZSADSKCF9MLTsQNW2httdBmYz47dQQteP8= +github.com/refraction-networking/utls v0.0.0-20200601200209-ada0bb9b38a0/go.mod h1:tz9gX959MEFfFN5whTIocCLUG57WiILqtdVxI8c6Wj0= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -543,8 +543,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 h1:cg5LA/zNPRzIXIWSCxQW10Rvpy94aQh3LT/ShoCpkHw= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79 h1:IaQbIIB2X/Mp/DKctl6ROxz1KyMlKp4uyvL6+kQ7C88= +golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -576,8 +576,8 @@ golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200528225125-3c3fba18258b h1:IYiJPiJfzktmDAO1HQiwjMjwjlYKHAL7KzeD544RJPs= -golang.org/x/net v0.0.0-20200528225125-3c3fba18258b/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200602114024-627f9648deb9 h1:pNX+40auqi2JqRfOP1akLGtYcn15TUbkhwuCO3foqqM= +golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -616,8 +616,8 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121 h1:rITEj+UZHYC927n8GT97eC3zrpzXdb/voyeOuVKS46o= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200610111108-226ff32320da h1:bGb80FudwxpeucJUjPYJXuJ8Hk91vNtfvrymzwiei38= +golang.org/x/sys v0.0.0-20200610111108-226ff32320da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= diff --git a/nettests/psiphon.go b/nettests/psiphon.go index f96f59e..5e90ca3 100644 --- a/nettests/psiphon.go +++ b/nettests/psiphon.go @@ -27,22 +27,22 @@ type PsiphonTestKeys struct { // GetTestKeys generates a summary for a test run func (h Psiphon) GetTestKeys(tk map[string]interface{}) (interface{}, error) { var ( - err error - ok bool + ok bool + testKeys PsiphonTestKeys ) - testKeys := PsiphonTestKeys{IsAnomaly: false, Failure: ""} if tk["failure"] != nil { testKeys.IsAnomaly = true - testKeys.Failure, ok = tk["failure"].(string) + failure, ok := tk["failure"].(*string) if !ok { - err = errors.Wrap(err, "failure key invalid") + return testKeys, errors.New("failure key invalid") } + testKeys.Failure = *failure } testKeys.BootstrapTime, ok = tk["bootstrap_time"].(float64) if !ok { - err = errors.Wrap(err, "bootstrap_time key invalid") + return testKeys, errors.New("bootstrap_time key invalid") } - return testKeys, err + return testKeys, nil } // LogSummary writes the summary to the standard output