mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user