forked from TrueCloudLab/restic
test helpers: add RemoveAll and ResetReadOnly
This is mainly needed in Windows, where files and dirs cannot be removed unless they are writeable.
This commit is contained in:
parent
36ed3add3a
commit
1a47ea4ab8
5 changed files with 36 additions and 7 deletions
|
@ -56,7 +56,7 @@ func cmdMount(t testing.TB, global GlobalOptions, dir string, ready, done chan s
|
|||
cmd := &CmdMount{global: &global, ready: ready, done: done}
|
||||
OK(t, cmd.Execute([]string{dir}))
|
||||
if TestCleanup {
|
||||
OK(t, os.RemoveAll(dir))
|
||||
RemoveAll(t, dir)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ func TestMount(t *testing.T) {
|
|||
OK(t, err)
|
||||
|
||||
// We remove the mountpoint now to check that cmdMount creates it
|
||||
OK(t, os.RemoveAll(mountpoint))
|
||||
RemoveAll(t, mountpoint)
|
||||
|
||||
ready := make(chan struct{}, 1)
|
||||
done := make(chan struct{})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue