Skip to content

Commit

Permalink
enable openvpn in the experimental group
Browse files Browse the repository at this point in the history
Additionally, remove RiseupVPN, that was disabled and is superseded
by the generic openvpn test.
  • Loading branch information
ainghazal committed Jul 22, 2024
1 parent 268c866 commit e2f55bc
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/ooniprobe/internal/nettests/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var All = map[string]Group{
DNSCheck{},
ECHCheck{},
STUNReachability{},
RiseupVPN{},
OpenVPN{},
TorSf{},
VanillaTor{},
},
Expand Down
38 changes: 38 additions & 0 deletions cmd/ooniprobe/internal/nettests/openvpn.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package nettests

import (
"context"

"github.com/ooni/probe-cli/v3/internal/model"
)

// OpenVPN nettest implementation.
type OpenVPN struct{}

func (o OpenVPN) loadTargets(ctl *Controller, builder model.ExperimentBuilder) ([]model.ExperimentTarget, error) {
config := &model.ExperimentTargetLoaderConfig{
CheckInConfig: &model.OOAPICheckInConfig{},
Session: ctl.Session,
SourceFiles: ctl.InputFiles,
StaticInputs: ctl.Inputs,
}
targetloader := builder.NewTargetLoader(config)
targets, err := targetloader.Load(context.Background())
if err != nil {
return nil, err
}
return ctl.BuildAndSetInputIdxMap(targets)
}

// Run starts the nettest.
func (o OpenVPN) Run(ctl *Controller) error {
builder, err := ctl.Session.NewExperimentBuilder("openvpn")
if err != nil {
return err
}
inputs, err := o.loadTargets(ctl, builder)
if err != nil {
return err
}
return ctl.Run(builder, inputs)
}

0 comments on commit e2f55bc

Please sign in to comment.