mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
tests/mountable: skip if btrfs is not available
This test uses btrfs, so skip it if either the "btrfs" feature or the btrfs filesystem is not available.
This commit is contained in:
@@ -33,6 +33,7 @@ main (int argc, char *argv[])
|
||||
guestfs_h *g;
|
||||
struct guestfs_internal_mountable *mountable;
|
||||
const char *devices[] = { "/dev/VG/LV", NULL };
|
||||
const char *feature[] = { "btrfs", NULL };
|
||||
|
||||
g = guestfs_create ();
|
||||
if (g == NULL) {
|
||||
@@ -48,6 +49,18 @@ main (int argc, char *argv[])
|
||||
|
||||
if (guestfs_launch (g) == -1) goto error;
|
||||
|
||||
if (!guestfs_feature_available (g, (char **) feature)) {
|
||||
printf ("skipping test because btrfs is not available\n");
|
||||
guestfs_close (g);
|
||||
exit (77);
|
||||
}
|
||||
|
||||
if (!guestfs_filesystem_available (g, "btrfs")) {
|
||||
printf ("skipping test because btrfs filesystem is not available\n");
|
||||
guestfs_close (g);
|
||||
exit (77);
|
||||
}
|
||||
|
||||
if (guestfs_part_disk (g, "/dev/sda", "mbr") == -1) goto error;
|
||||
|
||||
if (guestfs_pvcreate (g, "/dev/sda1") == -1) goto error;
|
||||
|
||||
Reference in New Issue
Block a user