move "link or copy" functionality to moxio

and add a bit more logging for unexpected failures when closing files.
and make tests pass with a TMPDIR on a different filesystem than the testdata directory.
This commit is contained in:
Mechiel Lukkien
2023-07-23 12:15:29 +02:00
parent 4a4d337ab4
commit 3e9b4107fd
12 changed files with 165 additions and 144 deletions

View File

@ -491,20 +491,6 @@ func TestQueueStart(t *testing.T) {
time.Sleep(100 * time.Millisecond) // Racy... we won't get notified when work is done...
}
func TestWriteFile(t *testing.T) {
name := "../testdata/queue.test"
os.Remove(name)
defer os.Remove(name)
err := writeFile(name, strings.NewReader("test"))
if err != nil {
t.Fatalf("writeFile, unexpected error %v", err)
}
buf, err := os.ReadFile(name)
if err != nil || string(buf) != "test" {
t.Fatalf("writeFile, read file, got err %v, data %q", err, buf)
}
}
func TestGatherHosts(t *testing.T) {
mox.Context = ctxbg