summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWanlong Gao <gaowanlong@cn.fujitsu.com>2012-09-24 16:49:21 +0800
committerRichard W.M. Jones <rjones@redhat.com>2012-09-24 16:41:07 +0100
commit45d459f4023a581712c4441acb440c821342bdf6 (patch)
tree8f4d20d75bd92c886dc338ebd6b1e626b0334072
parent0c2aab966a9ecde8a23044877cb3123cd238100a (diff)
downloadlibguestfs-45d459f4023a581712c4441acb440c821342bdf6.tar.gz
libguestfs-45d459f4023a581712c4441acb440c821342bdf6.tar.xz
libguestfs-45d459f4023a581712c4441acb440c821342bdf6.zip
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.
-rw-r--r--TODO6
-rwxr-xr-xtests/bigdirs/test-big-dirs.pl18
2 files changed, 4 insertions, 20 deletions
diff --git a/TODO b/TODO
index 1ff661f0..1cde423b 100644
--- a/TODO
+++ b/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
-----
diff --git a/tests/bigdirs/test-big-dirs.pl b/tests/bigdirs/test-big-dirs.pl
index 052163bc..a5533aea 100755
--- a/tests/bigdirs/test-big-dirs.pl
+++ b/tests/bigdirs/test-big-dirs.pl
@@ -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 ("/");