Example #1
0
func startInstance(t *testing.T, i int) *rc.Process {
	log.Printf("Starting instance %d...", i)
	addr := fmt.Sprintf("127.0.0.1:%d", 8080+i)
	log := fmt.Sprintf("logs/%s-%d-%d.out", getTestName(), i, time.Now().Unix()%86400)

	p := rc.NewProcess(addr)
	p.LogTo(log)
	if err := p.Start("../bin/syncthing", "-home", fmt.Sprintf("h%d", i), "-no-browser"); err != nil {
		t.Fatal(err)
	}
	p.AwaitStartup()
	return p
}
Example #2
0
// testScan starts a process and reports on the resource usage required to
// perform the initial scan.
func testScan() {
	log.Println("Starting...")
	p := rc.NewProcess("127.0.0.1:8081")
	if err := p.Start(syncthingBin, "-home", homeDir, "-no-browser"); err != nil {
		log.Println(err)
		return
	}
	defer p.Stop()

	wallTime := awaitScanComplete(p)

	report(p, wallTime)
}