Unlink mount points on tear-down.
parent
5a7e50daa6
commit
6cc47f10ed
|
@ -18,6 +18,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/googlecloudplatform/gcsfuse/timeutil"
|
"github.com/googlecloudplatform/gcsfuse/timeutil"
|
||||||
|
@ -129,5 +130,11 @@ func (t *SampleTest) destroy() (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Unlink the mount point.
|
||||||
|
if err = os.Remove(t.Dir); err != nil {
|
||||||
|
err = fmt.Errorf("Unlinking mount point: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -286,6 +286,7 @@ func (t *SubprocessTest) destroy() (err error) {
|
||||||
// Make sure we wait for the unmount, even if we've already returned early in
|
// Make sure we wait for the unmount, even if we've already returned early in
|
||||||
// error. Return its error if we haven't seen any other error.
|
// error. Return its error if we haven't seen any other error.
|
||||||
defer func() {
|
defer func() {
|
||||||
|
// Wait.
|
||||||
unmountErr := <-unmountErrChan
|
unmountErr := <-unmountErrChan
|
||||||
if unmountErr != nil {
|
if unmountErr != nil {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -294,7 +295,11 @@ func (t *SubprocessTest) destroy() (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
err = fmt.Errorf("unmount: %v", unmountErr)
|
err = fmt.Errorf("unmount: %v", unmountErr)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Attempt to unlink the mount point.
|
||||||
|
os.Remove(t.Dir)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// Wait for the subprocess.
|
// Wait for the subprocess.
|
||||||
|
|
Loading…
Reference in New Issue