Merge pull request #2296 from tophj-ibm/cleanup-loopback-devices
testing: cleanup loopback devices on test skip
This commit is contained in:
commit
0a978d0b82
@ -61,10 +61,12 @@ func testLookup(t *testing.T, fsType string) {
|
||||
}
|
||||
if out, err := exec.Command("mkfs", "-t", fsType, deviceName).CombinedOutput(); err != nil {
|
||||
// not fatal
|
||||
cleanupDevice()
|
||||
t.Skipf("could not mkfs (%s) %s: %v (out: %q)", fsType, deviceName, err, string(out))
|
||||
}
|
||||
if out, err := exec.Command("mount", deviceName, mnt).CombinedOutput(); err != nil {
|
||||
// not fatal
|
||||
cleanupDevice()
|
||||
t.Skipf("could not mount %s: %v (out: %q)", deviceName, err, string(out))
|
||||
}
|
||||
defer func() {
|
||||
|
@ -41,10 +41,12 @@ func testOverlaySupported(t testing.TB, expected bool, mkfs ...string) {
|
||||
}
|
||||
if out, err := exec.Command(mkfs[0], append(mkfs[1:], deviceName)...).CombinedOutput(); err != nil {
|
||||
// not fatal
|
||||
cleanupDevice()
|
||||
t.Skipf("could not mkfs (%v) %s: %v (out: %q)", mkfs, deviceName, err, string(out))
|
||||
}
|
||||
if out, err := exec.Command("mount", deviceName, mnt).CombinedOutput(); err != nil {
|
||||
// not fatal
|
||||
cleanupDevice()
|
||||
t.Skipf("could not mount %s: %v (out: %q)", deviceName, err, string(out))
|
||||
}
|
||||
defer func() {
|
||||
|
Loading…
Reference in New Issue
Block a user