fix: disable psiphon when building with go1.19 (#871)

Part of https://github.com/ooni/probe/issues/2211.

See also https://github.com/ooni/probe/issues/2222, which
describes the issue we have with psiphon and go1.19.
This commit is contained in:
Simone Basso 2022-08-22 11:50:58 +02:00 committed by GitHub
commit 208ffa253b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 113 additions and 37 deletions

View file

@ -1,5 +1,11 @@
//go:build !go1.19
package tunnel
//
// Psiphon not working with go1.19: TODO(https://github.com/ooni/probe/issues/2222)
//
import (
"context"
"errors"
@ -82,13 +88,17 @@ func TestPsiphonStartFailure(t *testing.T) {
sess := &MockableSession{
Result: []byte(`{}`),
}
oldStartPsiphon := mockableStartPsiphon
defer func() {
mockableStartPsiphon = oldStartPsiphon
}()
mockableStartPsiphon = func(ctx context.Context, config []byte,
workdir string) (*clientlib.PsiphonTunnel, error) {
return nil, expected
}
tunnel, _, err := psiphonStart(context.Background(), &Config{
Session: sess,
TunnelDir: "testdata",
testStartPsiphon: func(ctx context.Context, config []byte,
workdir string) (*clientlib.PsiphonTunnel, error) {
return nil, expected
},
})
if !errors.Is(err, expected) {
t.Fatal("not the error we expected")