Change integration test "log" field to "instance"
This commit is contained in:
parent
571cf7d490
commit
d4d391b34f
@ -101,7 +101,7 @@ func testFileTypeChange(t *testing.T) {
|
||||
log.Println("Syncing...")
|
||||
|
||||
sender := syncthingProcess{ // id1
|
||||
log: "1.out",
|
||||
instance: "1",
|
||||
argv: []string{"-home", "h1"},
|
||||
port: 8081,
|
||||
apiKey: apiKey,
|
||||
@ -112,7 +112,7 @@ func testFileTypeChange(t *testing.T) {
|
||||
}
|
||||
|
||||
receiver := syncthingProcess{ // id2
|
||||
log: "2.out",
|
||||
instance: "2",
|
||||
argv: []string{"-home", "h2"},
|
||||
port: 8082,
|
||||
apiKey: apiKey,
|
||||
|
||||
@ -43,7 +43,7 @@ func TestGetIndex(t *testing.T) {
|
||||
st := syncthingProcess{
|
||||
argv: []string{"-home", "h2"},
|
||||
port: 8082,
|
||||
log: "2.out",
|
||||
instance: "2",
|
||||
}
|
||||
err := st.start()
|
||||
if err != nil {
|
||||
@ -86,7 +86,7 @@ func TestGetIndexAuth(t *testing.T) {
|
||||
st := syncthingProcess{
|
||||
argv: []string{"-home", "h1"},
|
||||
port: 8081,
|
||||
log: "1.out",
|
||||
instance: "1",
|
||||
}
|
||||
err := st.start()
|
||||
if err != nil {
|
||||
@ -144,7 +144,7 @@ func TestGetJSON(t *testing.T) {
|
||||
st := syncthingProcess{
|
||||
argv: []string{"-home", "h2"},
|
||||
port: 8082,
|
||||
log: "2.out",
|
||||
instance: "2",
|
||||
}
|
||||
err := st.start()
|
||||
if err != nil {
|
||||
@ -176,7 +176,7 @@ func TestPOSTWithoutCSRF(t *testing.T) {
|
||||
st := syncthingProcess{
|
||||
argv: []string{"-home", "h2"},
|
||||
port: 8082,
|
||||
log: "2.out",
|
||||
instance: "2",
|
||||
}
|
||||
err := st.start()
|
||||
if err != nil {
|
||||
|
||||
@ -39,7 +39,7 @@ func TestStressHTTP(t *testing.T) {
|
||||
|
||||
log.Println("Starting up...")
|
||||
sender := syncthingProcess{ // id1
|
||||
log: "2.out",
|
||||
instance: "2",
|
||||
argv: []string{"-home", "h2"},
|
||||
port: 8082,
|
||||
apiKey: apiKey,
|
||||
|
||||
@ -36,7 +36,7 @@ func TestIgnores(t *testing.T) {
|
||||
}
|
||||
|
||||
p := syncthingProcess{ // id1
|
||||
log: "1.out",
|
||||
instance: "1",
|
||||
argv: []string{"-home", "h1"},
|
||||
port: 8081,
|
||||
apiKey: apiKey,
|
||||
|
||||
@ -43,7 +43,7 @@ func TestManyPeers(t *testing.T) {
|
||||
}
|
||||
|
||||
receiver := syncthingProcess{ // id2
|
||||
log: "2.out",
|
||||
instance: "2",
|
||||
argv: []string{"-home", "h2"},
|
||||
port: 8082,
|
||||
apiKey: apiKey,
|
||||
@ -90,7 +90,7 @@ func TestManyPeers(t *testing.T) {
|
||||
|
||||
log.Println("Starting up...")
|
||||
sender := syncthingProcess{ // id1
|
||||
log: "1.out",
|
||||
instance: "1",
|
||||
argv: []string{"-home", "h1"},
|
||||
port: 8081,
|
||||
apiKey: apiKey,
|
||||
|
||||
@ -46,7 +46,7 @@ func TestParallellScan(t *testing.T) {
|
||||
|
||||
log.Println("Starting up...")
|
||||
st := syncthingProcess{ // id1
|
||||
log: "1.out",
|
||||
instance: "1",
|
||||
argv: []string{"-home", "h1"},
|
||||
port: 8081,
|
||||
apiKey: apiKey,
|
||||
|
||||
@ -54,7 +54,7 @@ func testRestartDuringTransfer(t *testing.T, restartSender, restartReceiver bool
|
||||
|
||||
log.Println("Starting up...")
|
||||
sender := syncthingProcess{ // id1
|
||||
log: "1.out",
|
||||
instance: "1",
|
||||
argv: []string{"-home", "h1"},
|
||||
port: 8081,
|
||||
apiKey: apiKey,
|
||||
@ -65,7 +65,7 @@ func testRestartDuringTransfer(t *testing.T, restartSender, restartReceiver bool
|
||||
}
|
||||
|
||||
receiver := syncthingProcess{ // id2
|
||||
log: "2.out",
|
||||
instance: "2",
|
||||
argv: []string{"-home", "h2"},
|
||||
port: 8082,
|
||||
apiKey: apiKey,
|
||||
|
||||
@ -177,7 +177,7 @@ func testSymlinks(t *testing.T) {
|
||||
log.Println("Syncing...")
|
||||
|
||||
sender := syncthingProcess{ // id1
|
||||
log: "1.out",
|
||||
instance: "1",
|
||||
argv: []string{"-home", "h1"},
|
||||
port: 8081,
|
||||
apiKey: apiKey,
|
||||
@ -188,7 +188,7 @@ func testSymlinks(t *testing.T) {
|
||||
}
|
||||
|
||||
receiver := syncthingProcess{ // id2
|
||||
log: "2.out",
|
||||
instance: "2",
|
||||
argv: []string{"-home", "h2"},
|
||||
port: 8082,
|
||||
apiKey: apiKey,
|
||||
|
||||
@ -254,7 +254,7 @@ func scStartProcesses() ([]syncthingProcess, error) {
|
||||
p := make([]syncthingProcess, 3)
|
||||
|
||||
p[0] = syncthingProcess{ // id1
|
||||
log: "1.out",
|
||||
instance: "1",
|
||||
argv: []string{"-home", "h1"},
|
||||
port: 8081,
|
||||
apiKey: apiKey,
|
||||
@ -265,7 +265,7 @@ func scStartProcesses() ([]syncthingProcess, error) {
|
||||
}
|
||||
|
||||
p[1] = syncthingProcess{ // id2
|
||||
log: "2.out",
|
||||
instance: "2",
|
||||
argv: []string{"-home", "h2"},
|
||||
port: 8082,
|
||||
apiKey: apiKey,
|
||||
@ -277,7 +277,7 @@ func scStartProcesses() ([]syncthingProcess, error) {
|
||||
}
|
||||
|
||||
p[2] = syncthingProcess{ // id3
|
||||
log: "3.out",
|
||||
instance: "3",
|
||||
argv: []string{"-home", "h3"},
|
||||
port: 8083,
|
||||
apiKey: apiKey,
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user