[Libguestfs] [PATCH v2 9/9] tests: Add a test of btrfs-qgroup-show using the captive daemon.

Richard W.M. Jones rjones at redhat.com
Thu Jun 25 14:57:01 UTC 2015


---
 tests/daemon/test-btrfs.pl | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/daemon/test-btrfs.pl b/tests/daemon/test-btrfs.pl
index fff927e..815ab1d 100755
--- a/tests/daemon/test-btrfs.pl
+++ b/tests/daemon/test-btrfs.pl
@@ -62,6 +62,19 @@ EOF
     die unless $r[2]->{btrfssubvolume_top_level_id} == 5;
     die unless $r[2]->{btrfssubvolume_path} eq "test3";
 
+    # Test btrfs_qgroup_show.
+    my $output = <<EOF;
+qgroupid rfer excl 
+-------- ---- ---- 
+0/5      4096 4096 
+EOF
+    set_btrfs_output ($output);
+    my @r = $g->btrfs_qgroup_show ("/");
+    die unless @r == 1;
+    die unless $r[0]->{btrfsqgroup_id} == "0/5";
+    die unless $r[0]->{btrfsqgroup_rfer} == 4096;
+    die unless $r[0]->{btrfsqgroup_excl} == 4096;
+
     # Return true to indicate the test succeeded.
     1;
 }
-- 
2.3.1




More information about the Libguestfs mailing list