mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
Fix tests/bigdirs/test-big-dirs.pl to use mke2fs
Let tests/bigdirs/test-big-dirs.pl uses mke2fs to create small inode ratio files. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> RWMJ: - Fix invocation of mke2fs with optional arguments. - Run the test to check it works.
This commit is contained in:
committed by
Richard W.M. Jones
parent
0c2aab966a
commit
45d459f402
6
TODO
6
TODO
@@ -565,12 +565,6 @@ the p.o.v of the API and ABI.
|
||||
|
||||
- guestfs_readdir
|
||||
|
||||
mke2fs
|
||||
------
|
||||
|
||||
Add a mke2fs API call allowing full configuration of filesystems.
|
||||
Then fix tests/bigdirs/test-big-dirs.pl to use it.
|
||||
|
||||
hivex
|
||||
-----
|
||||
|
||||
|
||||
@@ -22,23 +22,12 @@ use warnings;
|
||||
|
||||
use Sys::Guestfs;
|
||||
|
||||
# Skip this test on 32 bit machines, since we cannot create a large
|
||||
# enough file below.
|
||||
if (~1 == 4294967294) {
|
||||
print STDERR "$0: tested skipped because this is a 32 bit machine\n";
|
||||
exit 77
|
||||
}
|
||||
|
||||
my $g = Sys::Guestfs->new ();
|
||||
|
||||
# Create a 16 GB test file. Don't worry, it's sparse.
|
||||
#
|
||||
# It has to be this big because the 'defaults' configuration of mke2fs
|
||||
# will choose a default inode ratio of 16K, and in order to create a
|
||||
# million files that means we have to have the disk be >= 16K * 1000000
|
||||
# bytes in size.
|
||||
# Create a 2 GB test file. Don't worry, it's sparse.
|
||||
|
||||
my $nr_files = 1000000;
|
||||
my $image_size = 16*1024*1024*1024;
|
||||
my $image_size = 2*1024*1024*1024;
|
||||
|
||||
unlink "test.img";
|
||||
open FILE, ">test.img" or die "test.img: $!";
|
||||
@@ -51,6 +40,7 @@ $g->launch ();
|
||||
|
||||
$g->part_disk ("/dev/sda", "mbr");
|
||||
$g->mkfs ("ext4", "/dev/sda1");
|
||||
$g->mke2fs ("/dev/sda1", fstype => "ext4", bytesperinode => 2048);
|
||||
$g->mount ("/dev/sda1", "/");
|
||||
|
||||
my %df = $g->statvfs ("/");
|
||||
|
||||
Reference in New Issue
Block a user