summaryrefslogtreecommitdiff
path: root/tests/root_test
diff options
context:
space:
mode:
authorJakob Unterwurzacher2022-01-27 18:35:45 +0100
committerJakob Unterwurzacher2022-01-27 18:36:51 +0100
commita2b54cfccd7d67529f87309c84ab7c00a8b6a4b0 (patch)
tree72a2fc3146729382696ffff65edff9a501ca3c36 /tests/root_test
parentba75aa1ab0dcef8ad8c8fbb11e8895413ad26787 (diff)
root_test: fix leftover loop mount
After running "make root_test" a few times df would look like this, no good: $ df Filesystem 1K-blocks Used Available Use% Mounted on [...] /dev/loop11 8729 8525 0 100% /tmp/gocryptfs-test-parent-0/4081611019/TestDiskFull.ext4.mnt /dev/loop12 8729 8525 0 100% /tmp/gocryptfs-test-parent-0/1959939106/TestDiskFull.ext4.mnt /dev/loop13 8729 8525 0 100% /tmp/gocryptfs-test-parent-0/2455888382/TestDiskFull.ext4.mnt /dev/loop14 8729 8525 0 100% /tmp/gocryptfs-test-parent-0/2002998275/TestDiskFull.ext4.mnt /dev/loop15 8729 8525 0 100% /var/tmp/gocryptfs-test-parent-0/806736609/TestDiskFull.ext4.mnt /dev/loop16 8729 8525 0 100% /tmp/gocryptfs-test-parent-0/4050106930/TestDiskFull.ext4.mnt /dev/loop17 8729 8525 0 100% /tmp/gocryptfs-test-parent-0/1661931756/TestDiskFull.ext4.mnt /dev/loop18 8729 8525 0 100% /tmp/gocryptfs-test-parent-0/617990718/TestDiskFull.ext4.mnt /dev/loop19 8729 8525 0 100% /tmp/gocryptfs-test-parent-0/3194420338/TestDiskFull.ext4.mnt /dev/loop20 8729 8525 0 100% /tmp/gocryptfs-test-parent-0/2180745159/TestDiskFull.ext4.mnt Turns out the unmount failed with EBUSY, so use lazy unmount.
Diffstat (limited to 'tests/root_test')
-rw-r--r--tests/root_test/root_test.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/root_test/root_test.go b/tests/root_test/root_test.go
index 462aaeb..7d1e296 100644
--- a/tests/root_test/root_test.go
+++ b/tests/root_test/root_test.go
@@ -179,7 +179,13 @@ func TestDiskFull(t *testing.T) {
t.Fatal(err)
}
defer syscall.Unlink(ext4img)
- defer syscall.Unmount(ext4mnt, 0)
+ defer func() {
+ const MNT_DETACH = 2
+ err := syscall.Unmount(ext4mnt, MNT_DETACH)
+ if err != nil {
+ t.Log(err)
+ }
+ }()
// gocryptfs -init
cipherdir := ext4mnt + "/a"