Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable openvpn in the experimental group #1637

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
Loading