fix(session): make sure tunnel code is tested (#301)

* fix(session): make sure tunnel code is tested

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

* fix: add missing TunnelDir for correctness
This commit is contained in:
Simone Basso 2021-04-05 19:51:41 +02:00 committed by GitHub
commit 7172e750dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 69 additions and 4 deletions

View file

@ -20,7 +20,11 @@ func (s *Session) FetchPsiphonConfig(ctx context.Context) ([]byte, error) {
// to tunnel.Start to fetch the Psiphon configuration.
type sessionTunnelEarlySession struct{}
// errPsiphonNoEmbeddedConfig indicates that there is no
// embedded psiphong config file in this binary.
var errPsiphonNoEmbeddedConfig = errors.New("no embedded configuration file")
// FetchPsiphonConfig implements tunnel.Session.FetchPsiphonConfig.
func (s *sessionTunnelEarlySession) FetchPsiphonConfig(ctx context.Context) ([]byte, error) {
return nil, errors.New("no embedded configuration file")
return nil, errPsiphonNoEmbeddedConfig
}