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).
This commit is contained in:
Richard W.M. Jones
2014-03-14 09:15:49 +00:00
parent 8584c8cadf
commit 9b883d3c3e
3 changed files with 3 additions and 3 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;