[Pkg-libvirt-commits] [libguestfs] 40/59: tests/discard: Ensure a significant number of blocks are freed up on the host.
Hilko Bengen
bengen at moszumanska.debian.org
Thu Mar 20 23:05:39 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch experimental
in repository libguestfs.
commit 9b883d3c3ec0ff93bbea776572afb54d2a9b3524
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Fri Mar 14 09:15:49 2014 +0000
tests/discard: Ensure a significant number of blocks are freed up on the host.
It's reasonable to expect megabytes will be freed up and given back to
the host. Previously we just tested that at least 1 block was
released. This test checks that at least 1000 blocks are released
(since stat(2) returns blocks of 512 bytes: 512 bytes * 1000 = approx 0.5 MB).
---
tests/discard/test-blkdiscard.pl | 2 +-
tests/discard/test-discard.pl | 2 +-
tests/discard/test-fstrim.pl | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/discard/test-blkdiscard.pl b/tests/discard/test-blkdiscard.pl
index 77b72b9..e080350 100755
--- a/tests/discard/test-blkdiscard.pl
+++ b/tests/discard/test-blkdiscard.pl
@@ -114,4 +114,4 @@ my $trimmed_size = (stat ($disk))[12];
print "trimmed size:\t$trimmed_size (blocks)\n";
die "$0: looks like the blkdiscard operation did not work\n"
- if $trimmed_size >= $full_size;
+ if $full_size - $trimmed_size < 1000;
diff --git a/tests/discard/test-discard.pl b/tests/discard/test-discard.pl
index 3f350b3..5e2f879 100755
--- a/tests/discard/test-discard.pl
+++ b/tests/discard/test-discard.pl
@@ -114,4 +114,4 @@ print "trimmed size:\t$trimmed_size (blocks)\n";
#system "du -sh $disk";
die "$0: looks like the -o discard mount option did not work\n"
- if $trimmed_size >= $full_size;
+ if $full_size - $trimmed_size < 1000;
diff --git a/tests/discard/test-fstrim.pl b/tests/discard/test-fstrim.pl
index 54451b8..30bb855 100755
--- a/tests/discard/test-fstrim.pl
+++ b/tests/discard/test-fstrim.pl
@@ -122,4 +122,4 @@ print "trimmed size:\t$trimmed_size (blocks)\n";
#system "du -sh $disk";
die "$0: looks like the fstrim operation did not work\n"
- if $trimmed_size >= $full_size;
+ if $full_size - $trimmed_size < 1000;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list