More progress towards release v3.10.0 (#320)
* chore: unvendor github.com/mitchellh/go-wordwrap The library seems reasonably maintained and tested. Part of https://github.com/ooni/probe/issues/1439 * fix(netx/quicdialer): ensure we handle all errors Part of https://github.com/ooni/probe/issues/1439 * fix previous * cleanup: remove unnecessary shutil fork Part of https://github.com/ooni/probe/issues/1439 * doc: documented some undocumented functions Part of https://github.com/ooni/probe/issues/1439 * fix(ooniprobe): rename mis-named function Part of https://github.com/ooni/probe/issues/1439
This commit is contained in:
@@ -8,9 +8,16 @@ import (
|
||||
|
||||
"github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/database"
|
||||
"github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/ooni"
|
||||
"github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/utils/shutil"
|
||||
)
|
||||
|
||||
func copyfile(source, dest string) error {
|
||||
data, err := ioutil.ReadFile(source)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return ioutil.WriteFile(dest, data, 0600)
|
||||
}
|
||||
|
||||
func newOONIProbe(t *testing.T) *ooni.Probe {
|
||||
homePath, err := ioutil.TempDir("", "ooniprobetests")
|
||||
if err != nil {
|
||||
@@ -18,7 +25,9 @@ func newOONIProbe(t *testing.T) *ooni.Probe {
|
||||
}
|
||||
configPath := path.Join(homePath, "config.json")
|
||||
testingConfig := path.Join("..", "..", "testdata", "testing-config.json")
|
||||
shutil.Copy(testingConfig, configPath, false)
|
||||
if err := copyfile(testingConfig, configPath); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
probe := ooni.NewProbe(configPath, homePath)
|
||||
swName := "ooniprobe-cli-tests"
|
||||
swVersion := "3.0.0-alpha"
|
||||
|
||||
Reference in New Issue
Block a user