diff --git a/test/filetype_test.go b/test/filetype_test.go index 8cb4bd3c..522bee98 100644 --- a/test/filetype_test.go +++ b/test/filetype_test.go @@ -101,10 +101,10 @@ func testFileTypeChange(t *testing.T) { log.Println("Syncing...") sender := syncthingProcess{ // id1 - log: "1.out", - argv: []string{"-home", "h1"}, - port: 8081, - apiKey: apiKey, + instance: "1", + argv: []string{"-home", "h1"}, + port: 8081, + apiKey: apiKey, } err = sender.start() if err != nil { @@ -112,10 +112,10 @@ func testFileTypeChange(t *testing.T) { } receiver := syncthingProcess{ // id2 - log: "2.out", - argv: []string{"-home", "h2"}, - port: 8082, - apiKey: apiKey, + instance: "2", + argv: []string{"-home", "h2"}, + port: 8082, + apiKey: apiKey, } err = receiver.start() if err != nil { diff --git a/test/http_test.go b/test/http_test.go index 3eb3d8dd..092a642f 100644 --- a/test/http_test.go +++ b/test/http_test.go @@ -41,9 +41,9 @@ var jsonEndpoints = []string{ func TestGetIndex(t *testing.T) { st := syncthingProcess{ - argv: []string{"-home", "h2"}, - port: 8082, - log: "2.out", + argv: []string{"-home", "h2"}, + port: 8082, + instance: "2", } err := st.start() if err != nil { @@ -84,9 +84,9 @@ func TestGetIndex(t *testing.T) { func TestGetIndexAuth(t *testing.T) { st := syncthingProcess{ - argv: []string{"-home", "h1"}, - port: 8081, - log: "1.out", + argv: []string{"-home", "h1"}, + port: 8081, + instance: "1", } err := st.start() if err != nil { @@ -142,9 +142,9 @@ func TestGetIndexAuth(t *testing.T) { func TestGetJSON(t *testing.T) { st := syncthingProcess{ - argv: []string{"-home", "h2"}, - port: 8082, - log: "2.out", + argv: []string{"-home", "h2"}, + port: 8082, + instance: "2", } err := st.start() if err != nil { @@ -174,9 +174,9 @@ func TestGetJSON(t *testing.T) { func TestPOSTWithoutCSRF(t *testing.T) { st := syncthingProcess{ - argv: []string{"-home", "h2"}, - port: 8082, - log: "2.out", + argv: []string{"-home", "h2"}, + port: 8082, + instance: "2", } err := st.start() if err != nil { diff --git a/test/httpstress_test.go b/test/httpstress_test.go index 6f70cf9d..091cb479 100644 --- a/test/httpstress_test.go +++ b/test/httpstress_test.go @@ -39,10 +39,10 @@ func TestStressHTTP(t *testing.T) { log.Println("Starting up...") sender := syncthingProcess{ // id1 - log: "2.out", - argv: []string{"-home", "h2"}, - port: 8082, - apiKey: apiKey, + instance: "2", + argv: []string{"-home", "h2"}, + port: 8082, + apiKey: apiKey, } err = sender.start() if err != nil { diff --git a/test/ignore_test.go b/test/ignore_test.go index 9b038218..a1fb003c 100644 --- a/test/ignore_test.go +++ b/test/ignore_test.go @@ -36,10 +36,10 @@ func TestIgnores(t *testing.T) { } p := syncthingProcess{ // id1 - log: "1.out", - argv: []string{"-home", "h1"}, - port: 8081, - apiKey: apiKey, + instance: "1", + argv: []string{"-home", "h1"}, + port: 8081, + apiKey: apiKey, } err = p.start() if err != nil { diff --git a/test/manypeers_test.go b/test/manypeers_test.go index 641fb92c..55c83fc7 100644 --- a/test/manypeers_test.go +++ b/test/manypeers_test.go @@ -43,10 +43,10 @@ func TestManyPeers(t *testing.T) { } receiver := syncthingProcess{ // id2 - log: "2.out", - argv: []string{"-home", "h2"}, - port: 8082, - apiKey: apiKey, + instance: "2", + argv: []string{"-home", "h2"}, + port: 8082, + apiKey: apiKey, } err = receiver.start() if err != nil { @@ -90,10 +90,10 @@ func TestManyPeers(t *testing.T) { log.Println("Starting up...") sender := syncthingProcess{ // id1 - log: "1.out", - argv: []string{"-home", "h1"}, - port: 8081, - apiKey: apiKey, + instance: "1", + argv: []string{"-home", "h1"}, + port: 8081, + apiKey: apiKey, } err = sender.start() if err != nil { diff --git a/test/parallell_scan_test.go b/test/parallell_scan_test.go index 0849906b..c9f6d6c2 100644 --- a/test/parallell_scan_test.go +++ b/test/parallell_scan_test.go @@ -46,10 +46,10 @@ func TestParallellScan(t *testing.T) { log.Println("Starting up...") st := syncthingProcess{ // id1 - log: "1.out", - argv: []string{"-home", "h1"}, - port: 8081, - apiKey: apiKey, + instance: "1", + argv: []string{"-home", "h1"}, + port: 8081, + apiKey: apiKey, } err = st.start() if err != nil { diff --git a/test/reconnect_test.go b/test/reconnect_test.go index 579d61fb..bf4953ef 100644 --- a/test/reconnect_test.go +++ b/test/reconnect_test.go @@ -54,10 +54,10 @@ func testRestartDuringTransfer(t *testing.T, restartSender, restartReceiver bool log.Println("Starting up...") sender := syncthingProcess{ // id1 - log: "1.out", - argv: []string{"-home", "h1"}, - port: 8081, - apiKey: apiKey, + instance: "1", + argv: []string{"-home", "h1"}, + port: 8081, + apiKey: apiKey, } err = sender.start() if err != nil { @@ -65,10 +65,10 @@ func testRestartDuringTransfer(t *testing.T, restartSender, restartReceiver bool } receiver := syncthingProcess{ // id2 - log: "2.out", - argv: []string{"-home", "h2"}, - port: 8082, - apiKey: apiKey, + instance: "2", + argv: []string{"-home", "h2"}, + port: 8082, + apiKey: apiKey, } err = receiver.start() if err != nil { diff --git a/test/symlink_test.go b/test/symlink_test.go index 5d28821d..f5da4065 100644 --- a/test/symlink_test.go +++ b/test/symlink_test.go @@ -177,10 +177,10 @@ func testSymlinks(t *testing.T) { log.Println("Syncing...") sender := syncthingProcess{ // id1 - log: "1.out", - argv: []string{"-home", "h1"}, - port: 8081, - apiKey: apiKey, + instance: "1", + argv: []string{"-home", "h1"}, + port: 8081, + apiKey: apiKey, } err = sender.start() if err != nil { @@ -188,10 +188,10 @@ func testSymlinks(t *testing.T) { } receiver := syncthingProcess{ // id2 - log: "2.out", - argv: []string{"-home", "h2"}, - port: 8082, - apiKey: apiKey, + instance: "2", + argv: []string{"-home", "h2"}, + port: 8082, + apiKey: apiKey, } err = receiver.start() if err != nil { diff --git a/test/sync_test.go b/test/sync_test.go index be8c8479..9f04e7c4 100644 --- a/test/sync_test.go +++ b/test/sync_test.go @@ -254,10 +254,10 @@ func scStartProcesses() ([]syncthingProcess, error) { p := make([]syncthingProcess, 3) p[0] = syncthingProcess{ // id1 - log: "1.out", - argv: []string{"-home", "h1"}, - port: 8081, - apiKey: apiKey, + instance: "1", + argv: []string{"-home", "h1"}, + port: 8081, + apiKey: apiKey, } err := p[0].start() if err != nil { @@ -265,10 +265,10 @@ func scStartProcesses() ([]syncthingProcess, error) { } p[1] = syncthingProcess{ // id2 - log: "2.out", - argv: []string{"-home", "h2"}, - port: 8082, - apiKey: apiKey, + instance: "2", + argv: []string{"-home", "h2"}, + port: 8082, + apiKey: apiKey, } err = p[1].start() if err != nil { @@ -277,10 +277,10 @@ func scStartProcesses() ([]syncthingProcess, error) { } p[2] = syncthingProcess{ // id3 - log: "3.out", - argv: []string{"-home", "h3"}, - port: 8083, - apiKey: apiKey, + instance: "3", + argv: []string{"-home", "h3"}, + port: 8083, + apiKey: apiKey, } err = p[2].start() if err != nil { diff --git a/test/syncthingprocess.go b/test/syncthingprocess.go index da649cb0..aba9d8e9 100644 --- a/test/syncthingprocess.go +++ b/test/syncthingprocess.go @@ -37,7 +37,7 @@ var env = []string{ } type syncthingProcess struct { - log string + instance string argv []string port int apiKey string @@ -50,7 +50,7 @@ type syncthingProcess struct { func (p *syncthingProcess) start() error { if p.logfd == nil { - logfd, err := os.Create(p.log) + logfd, err := os.Create(p.instance + ".out") if err != nil { return err } @@ -82,7 +82,7 @@ func (p *syncthingProcess) stop() error { p.cmd.Process.Signal(os.Kill) p.cmd.Wait() - fd, err := os.Open(p.log) + fd, err := os.Open(p.instance + ".out") if err != nil { return err }