drone use go 1.19.1
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
bbe4198a41
commit
2f3860eb89
|
@ -5,7 +5,7 @@ name: linux-test
|
|||
|
||||
steps:
|
||||
- name: fetch
|
||||
image: golang:1.17.5
|
||||
image: golang:1.19.1
|
||||
volumes:
|
||||
- name: deps
|
||||
path: /go
|
||||
|
@ -15,14 +15,14 @@ steps:
|
|||
- chmod a+x tmp/tor
|
||||
- go mod download
|
||||
- name: quality
|
||||
image: golang:1.17.5
|
||||
image: golang:1.19.1
|
||||
volumes:
|
||||
- name: deps
|
||||
path: /go
|
||||
commands:
|
||||
- staticcheck ./...
|
||||
- name: units-tests
|
||||
image: golang:1.17.5
|
||||
image: golang:1.19.1
|
||||
volumes:
|
||||
- name: deps
|
||||
path: /go
|
||||
|
@ -33,7 +33,7 @@ steps:
|
|||
- sh testing/tests.sh
|
||||
- pkill -9 tor
|
||||
- name: integration-tests
|
||||
image: golang:1.17.5
|
||||
image: golang:1.19.1
|
||||
volumes:
|
||||
- name: deps
|
||||
path: /go
|
||||
|
|
|
@ -3,7 +3,6 @@ package testing
|
|||
import (
|
||||
"git.openprivacy.ca/openprivacy/connectivity/tor"
|
||||
"git.openprivacy.ca/openprivacy/log"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"os"
|
||||
path "path/filepath"
|
||||
|
@ -30,7 +29,7 @@ func TestLaunchTor(t *testing.T) {
|
|||
}
|
||||
|
||||
dataDir := ""
|
||||
if dataDir, err = ioutil.TempDir(path.Join("..", "testing"), "data-dir-"); err != nil {
|
||||
if dataDir, err = os.MkdirTemp(path.Join("..", "testing"), "data-dir-"); err != nil {
|
||||
t.Fatalf("could not create data dir")
|
||||
}
|
||||
|
||||
|
|
|
@ -335,7 +335,6 @@ func (tp *torProvider) restart() {
|
|||
}
|
||||
tp.lastRestartTime = time.Now()
|
||||
tp.isClosed = false
|
||||
tp.t.Control.TakeOwnership()
|
||||
go tp.monitorRestart()
|
||||
} else {
|
||||
log.Errorf("Error restarting Tor process: %v", err)
|
||||
|
@ -432,7 +431,6 @@ func NewTorACNWithAuth(appDirectory string, bundledTorPath string, dataDir strin
|
|||
tp, err := startTor(appDirectory, bundledTorPath, dataDir, controlPort, authenticator)
|
||||
if err == nil {
|
||||
tp.isClosed = false
|
||||
tp.t.Control.TakeOwnership()
|
||||
go tp.monitorRestart()
|
||||
}
|
||||
return tp, err
|
||||
|
@ -488,9 +486,9 @@ func startTor(appDirectory string, bundledTorPath string, dataDir string, contro
|
|||
if err == nil {
|
||||
log.Debugf("creating tor handler from system tor")
|
||||
tp.t = createFromExisting(controlport, dataDir)
|
||||
tp.dialer, err = tp.t.Dialer(context.TODO(), &tor.DialConf{Authenticator: tp.authenticator})
|
||||
return tp, err
|
||||
}
|
||||
tp.dialer, err = tp.t.Dialer(context.TODO(), &tor.DialConf{Authenticator: tp.authenticator})
|
||||
return tp, err
|
||||
}
|
||||
|
||||
// check if the torrc file is present where expected
|
||||
|
@ -529,6 +527,7 @@ func startTor(appDirectory string, bundledTorPath string, dataDir string, contro
|
|||
tp.t.DeleteDataDirOnClose = false // caller is responsible for dealing with cached information...
|
||||
tp.dialer, err = tp.t.Dialer(context.TODO(), &tor.DialConf{Authenticator: tp.authenticator})
|
||||
tp.version = version
|
||||
tp.t.Control.TakeOwnership()
|
||||
return tp, err
|
||||
}
|
||||
return nil, fmt.Errorf("could not connect to running tor: %v", err)
|
||||
|
|
|
@ -3,7 +3,6 @@ package tor
|
|||
import (
|
||||
"fmt"
|
||||
"git.openprivacy.ca/openprivacy/log"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
path "path/filepath"
|
||||
"runtime"
|
||||
|
@ -41,7 +40,7 @@ func TestTorProvider(t *testing.T) {
|
|||
|
||||
dataDir := ""
|
||||
var err error
|
||||
if dataDir, err = ioutil.TempDir(path.Join("..", "testing"), "data-dir-"); err != nil {
|
||||
if dataDir, err = os.MkdirTemp(path.Join("..", "testing"), "data-dir-"); err != nil {
|
||||
t.Fatalf("could not create data dir")
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -98,7 +98,7 @@ func (tb *TorrcBuilder) WithHashedPassword(password string) *TorrcBuilder {
|
|||
|
||||
// Build finalizes the torrc contents and write a file
|
||||
func (tb *TorrcBuilder) Build(path string) error {
|
||||
return ioutil.WriteFile(path, []byte(strings.Join(tb.lines, "\n")), 0600)
|
||||
return os.WriteFile(path, []byte(strings.Join(tb.lines, "\n")), 0600)
|
||||
}
|
||||
|
||||
// Preview provides a string representation of the torrc file without writing it to a file location.
|
||||
|
|
Loading…
Reference in New Issue