2015-04-02 08:21:11 +00:00
|
|
|
// Copyright (C) 2015 The Syncthing Authors.
|
|
|
|
//
|
|
|
|
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
2017-02-09 06:52:18 +00:00
|
|
|
// You can obtain one at https://mozilla.org/MPL/2.0/.
|
2015-04-02 08:21:11 +00:00
|
|
|
|
2021-08-17 08:10:41 +00:00
|
|
|
//go:build integration
|
2015-04-02 08:21:11 +00:00
|
|
|
// +build integration
|
|
|
|
|
|
|
|
package integration
|
|
|
|
|
|
|
|
import (
|
2021-11-22 07:59:47 +00:00
|
|
|
"io"
|
2015-04-02 08:21:11 +00:00
|
|
|
"log"
|
|
|
|
"os"
|
|
|
|
"strings"
|
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
|
2015-08-06 09:29:25 +00:00
|
|
|
"github.com/syncthing/syncthing/lib/config"
|
2019-08-20 08:17:11 +00:00
|
|
|
"github.com/syncthing/syncthing/lib/events"
|
2015-09-22 17:38:46 +00:00
|
|
|
"github.com/syncthing/syncthing/lib/protocol"
|
2015-08-06 09:29:25 +00:00
|
|
|
"github.com/syncthing/syncthing/lib/rc"
|
2015-04-02 08:21:11 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestOverride(t *testing.T) {
|
2018-09-17 10:37:54 +00:00
|
|
|
// Enable "send-only" on s1/default
|
2015-04-02 08:21:11 +00:00
|
|
|
id, _ := protocol.DeviceIDFromString(id1)
|
2020-09-07 07:35:37 +00:00
|
|
|
cfg, _, _ := config.Load("h1/config.xml", id, events.NoopLogger)
|
2015-04-02 08:21:11 +00:00
|
|
|
fld := cfg.Folders()["default"]
|
2016-12-19 11:26:26 +00:00
|
|
|
fld.Type = config.FolderTypeSendOnly
|
2015-04-02 08:21:11 +00:00
|
|
|
cfg.SetFolder(fld)
|
2019-01-29 15:59:01 +00:00
|
|
|
os.Rename("h1/config.xml", "h1/config.xml.orig")
|
|
|
|
defer os.Rename("h1/config.xml.orig", "h1/config.xml")
|
2015-04-02 08:21:11 +00:00
|
|
|
cfg.Save()
|
|
|
|
|
|
|
|
log.Println("Cleaning...")
|
|
|
|
err := removeAll("s1", "s2", "h1/index*", "h2/index*")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
log.Println("Generating files...")
|
|
|
|
err = generateFiles("s1", 100, 20, "../LICENSE")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
fd, err := os.Create("s1/testfile.txt")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
_, err = fd.WriteString("hello\n")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
err = fd.Close()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
expected, err := directoryContents("s1")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
sendOnly := startInstance(t, 1)
|
|
|
|
defer checkedStop(t, sendOnly)
|
2015-04-02 08:21:11 +00:00
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
sendRecv := startInstance(t, 2)
|
|
|
|
defer checkedStop(t, sendRecv)
|
2015-04-02 08:21:11 +00:00
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
sendOnly.ResumeAll()
|
|
|
|
sendRecv.ResumeAll()
|
2017-11-12 23:54:21 +00:00
|
|
|
|
2015-04-02 08:21:11 +00:00
|
|
|
log.Println("Syncing...")
|
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
rc.AwaitSync("default", sendOnly, sendRecv)
|
2015-04-02 08:21:11 +00:00
|
|
|
|
|
|
|
log.Println("Verifying...")
|
|
|
|
|
|
|
|
actual, err := directoryContents("s2")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
err = compareDirectoryContents(actual, expected)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
log.Println("Changing file on sendRecv side...")
|
2015-04-02 08:21:11 +00:00
|
|
|
|
2024-11-19 10:32:56 +00:00
|
|
|
fd, err = os.OpenFile("s2/testfile.txt", os.O_WRONLY|os.O_APPEND, 0o644)
|
2015-04-02 08:21:11 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
_, err = fd.WriteString("text added to s2\n")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
err = fd.Close()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
if err := sendRecv.Rescan("default"); err != nil {
|
2015-04-02 08:21:11 +00:00
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2015-05-23 20:56:43 +00:00
|
|
|
log.Println("Waiting for index to send...")
|
2015-04-02 08:21:11 +00:00
|
|
|
|
2015-05-23 20:56:43 +00:00
|
|
|
time.Sleep(10 * time.Second)
|
2015-04-02 08:21:11 +00:00
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
log.Println("Hitting Override on sendOnly...")
|
2015-04-02 08:21:11 +00:00
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
if _, err := sendOnly.Post("/rest/db/override?folder=default", nil); err != nil {
|
2015-04-02 08:21:11 +00:00
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
log.Println("Syncing...")
|
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
rc.AwaitSync("default", sendOnly, sendRecv)
|
2015-04-02 08:21:11 +00:00
|
|
|
|
|
|
|
// Verify that the override worked
|
|
|
|
|
|
|
|
fd, err = os.Open("s1/testfile.txt")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2021-11-22 07:59:47 +00:00
|
|
|
bs, err := io.ReadAll(fd)
|
2015-04-02 08:21:11 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
fd.Close()
|
|
|
|
|
|
|
|
if strings.Contains(string(bs), "added to s2") {
|
2018-09-17 10:37:54 +00:00
|
|
|
t.Error("Change should not have been synced to sendOnly")
|
2015-04-02 08:21:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fd, err = os.Open("s2/testfile.txt")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2021-11-22 07:59:47 +00:00
|
|
|
bs, err = io.ReadAll(fd)
|
2015-04-02 08:21:11 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
fd.Close()
|
|
|
|
|
|
|
|
if strings.Contains(string(bs), "added to s2") {
|
2018-09-17 10:37:54 +00:00
|
|
|
t.Error("Change should have been overridden on sendRecv")
|
2015-04-02 08:21:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-23 20:56:43 +00:00
|
|
|
/* This doesn't currently work with detection completion, as we don't actually
|
2018-09-17 10:37:54 +00:00
|
|
|
get to completion when in sendOnly/sendRecv mode. Needs fixing.
|
2015-05-23 20:56:43 +00:00
|
|
|
|
2015-05-10 09:23:29 +00:00
|
|
|
func TestOverrideIgnores(t *testing.T) {
|
2018-09-17 10:37:54 +00:00
|
|
|
// Enable "sendOnly" on s1/default
|
2015-05-10 09:23:29 +00:00
|
|
|
id, _ := protocol.DeviceIDFromString(id1)
|
2020-09-07 07:35:37 +00:00
|
|
|
cfg, _, _ := config.Load("h1/config.xml", id, events.NoopLogger)
|
2015-05-10 09:23:29 +00:00
|
|
|
fld := cfg.Folders()["default"]
|
|
|
|
fld.ReadOnly = true
|
|
|
|
cfg.SetFolder(fld)
|
|
|
|
os.Rename("h1/config.xml", "h1/config.xml.orig")
|
2017-11-05 09:05:18 +00:00
|
|
|
defer os.Rename("h1/config.xml.orig", "h1/config.xml")
|
2015-05-10 09:23:29 +00:00
|
|
|
cfg.Save()
|
|
|
|
|
|
|
|
log.Println("Cleaning...")
|
|
|
|
err := removeAll("s1", "s2", "h1/index*", "h2/index*")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
log.Println("Generating files...")
|
|
|
|
err = generateFiles("s1", 10, 2, "../LICENSE")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
fd, err := os.Create("s1/testfile.txt")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
_, err = fd.WriteString("original text\n")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
err = fd.Close()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
expected, err := directoryContents("s1")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
log.Println("Starting sendOnly...")
|
|
|
|
sendOnly := syncthingProcess{ // id1
|
2015-05-10 09:23:29 +00:00
|
|
|
instance: "1",
|
2021-11-04 07:42:55 +00:00
|
|
|
argv: []string{"--home", "h1"},
|
2015-05-10 09:23:29 +00:00
|
|
|
port: 8081,
|
|
|
|
apiKey: apiKey,
|
|
|
|
}
|
2018-09-17 10:37:54 +00:00
|
|
|
err = sendOnly.start()
|
2015-05-10 09:23:29 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2018-09-17 10:37:54 +00:00
|
|
|
defer sendOnly.stop()
|
2015-05-10 09:23:29 +00:00
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
log.Println("Starting sendRecv...")
|
|
|
|
sendRecv := syncthingProcess{ // id2
|
2015-05-10 09:23:29 +00:00
|
|
|
instance: "2",
|
2021-11-04 07:42:55 +00:00
|
|
|
argv: []string{"--home", "h2"},
|
2015-05-10 09:23:29 +00:00
|
|
|
port: 8082,
|
|
|
|
apiKey: apiKey,
|
|
|
|
}
|
2018-09-17 10:37:54 +00:00
|
|
|
err = sendRecv.start()
|
2015-05-10 09:23:29 +00:00
|
|
|
if err != nil {
|
2018-09-17 10:37:54 +00:00
|
|
|
sendOnly.stop()
|
2015-05-10 09:23:29 +00:00
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2018-09-17 10:37:54 +00:00
|
|
|
defer sendRecv.stop()
|
2015-05-10 09:23:29 +00:00
|
|
|
|
|
|
|
log.Println("Syncing...")
|
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
err = awaitCompletion("default", sendOnly, sendRecv)
|
2015-05-23 20:56:43 +00:00
|
|
|
if err != nil {
|
2015-05-10 09:23:29 +00:00
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
log.Println("Verifying...")
|
|
|
|
|
|
|
|
actual, err := directoryContents("s2")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
err = compareDirectoryContents(actual, expected)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
log.Println("Ignoring testfile.txt on sendOnly...")
|
2015-05-10 09:23:29 +00:00
|
|
|
|
|
|
|
fd, err = os.Create("s1/.stignore")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
_, err = fd.WriteString("testfile.txt\n")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
err = fd.Close()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
log.Println("Modify testfile.txt on sendOnly...")
|
2015-05-10 09:23:29 +00:00
|
|
|
|
|
|
|
fd, err = os.Create("s1/testfile.txt")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2018-09-17 10:37:54 +00:00
|
|
|
_, err = fd.WriteString("updated on sendOnly but ignored\n")
|
2015-05-10 09:23:29 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
err = fd.Close()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
fd, err = os.Create("s1/testfile2.txt")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
_, err = fd.WriteString("sync me\n")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
err = fd.Close()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
err = sendOnly.rescan("default")
|
2015-05-10 09:23:29 +00:00
|
|
|
|
2015-05-23 20:56:43 +00:00
|
|
|
log.Println("Waiting for sync...")
|
|
|
|
time.Sleep(10 * time.Second)
|
2015-05-10 09:23:29 +00:00
|
|
|
|
|
|
|
// Verify that sync worked
|
|
|
|
|
|
|
|
fd, err = os.Open("s2/testfile.txt")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2021-11-22 07:59:47 +00:00
|
|
|
bs, err := io.ReadAll(fd)
|
2015-05-10 09:23:29 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
fd.Close()
|
|
|
|
|
|
|
|
if !strings.Contains(string(bs), "original text") {
|
2018-09-17 10:37:54 +00:00
|
|
|
t.Error("Changes should not have been synced to sendRecv")
|
2015-05-10 09:23:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fd, err = os.Open("s2/testfile2.txt")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2021-11-22 07:59:47 +00:00
|
|
|
bs, err = io.ReadAll(fd)
|
2015-05-10 09:23:29 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
fd.Close()
|
|
|
|
|
|
|
|
if !strings.Contains(string(bs), "sync me") {
|
2018-09-17 10:37:54 +00:00
|
|
|
t.Error("Changes should have been synced to sendRecv")
|
2015-05-10 09:23:29 +00:00
|
|
|
}
|
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
log.Println("Removing file on sendRecv side...")
|
2015-05-10 09:23:29 +00:00
|
|
|
|
|
|
|
os.Remove("s2/testfile.txt")
|
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
err = sendRecv.rescan("default")
|
2015-05-10 09:23:29 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2015-05-23 20:56:43 +00:00
|
|
|
log.Println("Waiting for sync...")
|
|
|
|
time.Sleep(10 * time.Second)
|
2015-05-10 09:23:29 +00:00
|
|
|
|
|
|
|
// Verify that nothing changed
|
|
|
|
|
|
|
|
fd, err = os.Open("s1/testfile.txt")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2021-11-22 07:59:47 +00:00
|
|
|
bs, err = io.ReadAll(fd)
|
2015-05-10 09:23:29 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
fd.Close()
|
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
if !strings.Contains(string(bs), "updated on sendOnly but ignored") {
|
|
|
|
t.Error("Changes should not have been synced to sendOnly")
|
2015-05-10 09:23:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fd, err = os.Open("s2/testfile.txt")
|
|
|
|
if err == nil {
|
2018-09-17 10:37:54 +00:00
|
|
|
t.Error("File should not exist on the sendRecv")
|
2015-05-10 09:23:29 +00:00
|
|
|
}
|
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
log.Println("Creating file on sendRecv...")
|
2015-05-10 09:23:29 +00:00
|
|
|
|
|
|
|
fd, err = os.Create("s2/testfile3.txt")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2018-09-17 10:37:54 +00:00
|
|
|
_, err = fd.WriteString("created on sendRecv, should be removed on override\n")
|
2015-05-10 09:23:29 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
err = fd.Close()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
log.Println("Hitting Override on sendOnly...")
|
2015-05-10 09:23:29 +00:00
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
resp, err := sendOnly.post("/rest/db/override?folder=default", nil)
|
2015-05-10 09:23:29 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
if resp.StatusCode != 200 {
|
|
|
|
t.Fatal(resp.Status)
|
|
|
|
}
|
|
|
|
|
2015-05-23 20:56:43 +00:00
|
|
|
log.Println("Waiting for sync...")
|
|
|
|
time.Sleep(10 * time.Second)
|
2015-05-10 09:23:29 +00:00
|
|
|
|
|
|
|
fd, err = os.Open("s2/testfile.txt")
|
|
|
|
if err == nil {
|
2018-09-17 10:37:54 +00:00
|
|
|
t.Error("File should not exist on the sendRecv")
|
2015-05-10 09:23:29 +00:00
|
|
|
}
|
|
|
|
fd, err = os.Open("s2/testfile2.txt")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2021-11-22 07:59:47 +00:00
|
|
|
bs, err = io.ReadAll(fd)
|
2015-05-10 09:23:29 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
fd.Close()
|
|
|
|
if !strings.Contains(string(bs), "sync me") {
|
2018-09-17 10:37:54 +00:00
|
|
|
t.Error("Changes should have been synced to sendRecv")
|
2015-05-10 09:23:29 +00:00
|
|
|
}
|
|
|
|
fd, err = os.Open("s2/testfile3.txt")
|
|
|
|
if err != nil {
|
2018-09-17 10:37:54 +00:00
|
|
|
t.Error("File should still exist on the sendRecv")
|
2015-05-10 09:23:29 +00:00
|
|
|
}
|
|
|
|
fd.Close()
|
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
log.Println("Hitting Override on sendOnly (again)...")
|
2015-05-10 09:23:29 +00:00
|
|
|
|
2018-09-17 10:37:54 +00:00
|
|
|
resp, err = sendOnly.post("/rest/db/override?folder=default", nil)
|
2015-05-10 09:23:29 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
if resp.StatusCode != 200 {
|
|
|
|
t.Fatal(resp.Status)
|
|
|
|
}
|
|
|
|
|
2015-05-23 20:56:43 +00:00
|
|
|
log.Println("Waiting for sync...")
|
|
|
|
time.Sleep(10 * time.Second)
|
2015-05-10 09:23:29 +00:00
|
|
|
|
|
|
|
fd, err = os.Open("s2/testfile.txt")
|
|
|
|
if err == nil {
|
2018-09-17 10:37:54 +00:00
|
|
|
t.Error("File should not exist on the sendRecv")
|
2015-05-10 09:23:29 +00:00
|
|
|
}
|
|
|
|
fd, err = os.Open("s2/testfile2.txt")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2021-11-22 07:59:47 +00:00
|
|
|
bs, err = io.ReadAll(fd)
|
2015-05-10 09:23:29 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
fd.Close()
|
|
|
|
if !strings.Contains(string(bs), "sync me") {
|
2018-09-17 10:37:54 +00:00
|
|
|
t.Error("Changes should have been synced to sendRecv")
|
2015-05-10 09:23:29 +00:00
|
|
|
}
|
|
|
|
fd, err = os.Open("s2/testfile3.txt")
|
|
|
|
if err != nil {
|
2018-09-17 10:37:54 +00:00
|
|
|
t.Error("File should still exist on the sendRecv")
|
2015-05-10 09:23:29 +00:00
|
|
|
}
|
|
|
|
fd.Close()
|
|
|
|
|
|
|
|
}
|
2015-05-23 20:56:43 +00:00
|
|
|
*/
|