1 /* libguestfs generated file
2 * WARNING: THIS FILE IS GENERATED BY 'src/generator.ml'.
3 * ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
5 * Copyright (C) 2009 Red Hat Inc.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #include <sys/types.h>
32 static int suppress_error = 0;
34 static void print_error (guestfs_h *g, void *data, const char *msg)
37 fprintf (stderr, "%s\n", msg);
40 static void print_strings (char * const * const argv)
44 for (argc = 0; argv[argc] != NULL; ++argc)
45 printf ("\t%s\n", argv[argc]);
48 static int test_mount_0 (void)
50 /* InitEmpty for mount (0) */
54 r = guestfs_umount_all (g);
61 r = guestfs_lvm_remove_all (g);
65 /* TestOutput for mount (0) */
73 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
80 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
87 r = guestfs_mount (g, "/dev/sda1", "/");
94 r = guestfs_write_file (g, "/new", "new file contents", 0);
101 r = guestfs_cat (g, "/new");
104 if (strcmp (r, "new file contents") != 0) {
105 fprintf (stderr, "test_mount_0: expected \"new file contents\" but got \"%s\"\n", r);
113 static int test_sync_0 (void)
115 /* InitEmpty for sync (0) */
119 r = guestfs_umount_all (g);
126 r = guestfs_lvm_remove_all (g);
130 /* TestRun for sync (0) */
134 r = guestfs_sync (g);
141 static int test_touch_0 (void)
143 /* InitBasicFS for touch (0): create ext2 on /dev/sda1 */
147 r = guestfs_umount_all (g);
154 r = guestfs_lvm_remove_all (g);
165 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
172 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
179 r = guestfs_mount (g, "/dev/sda1", "/");
183 /* TestOutputTrue for touch (0) */
187 r = guestfs_touch (g, "/new");
194 r = guestfs_exists (g, "/new");
198 fprintf (stderr, "test_touch_0: expected true, got false\n");
205 static int test_cat_0 (void)
207 /* InitBasicFS for cat (0): create ext2 on /dev/sda1 */
211 r = guestfs_umount_all (g);
218 r = guestfs_lvm_remove_all (g);
229 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
236 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
243 r = guestfs_mount (g, "/dev/sda1", "/");
247 /* TestOutput for cat (0) */
251 r = guestfs_write_file (g, "/new", "new file contents", 0);
258 r = guestfs_cat (g, "/new");
261 if (strcmp (r, "new file contents") != 0) {
262 fprintf (stderr, "test_cat_0: expected \"new file contents\" but got \"%s\"\n", r);
270 static int test_ls_0 (void)
272 /* InitBasicFS for ls (0): create ext2 on /dev/sda1 */
276 r = guestfs_umount_all (g);
283 r = guestfs_lvm_remove_all (g);
294 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
301 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
308 r = guestfs_mount (g, "/dev/sda1", "/");
312 /* TestOutputList for ls (0) */
316 r = guestfs_touch (g, "/new");
323 r = guestfs_touch (g, "/newer");
330 r = guestfs_touch (g, "/newest");
338 r = guestfs_ls (g, "/");
342 fprintf (stderr, "test_ls_0: short list returned from command\n");
346 if (strcmp (r[0], "lost+found") != 0) {
347 fprintf (stderr, "test_ls_0: expected \"lost+found\" but got \"%s\"\n", r[0]);
351 fprintf (stderr, "test_ls_0: short list returned from command\n");
355 if (strcmp (r[1], "new") != 0) {
356 fprintf (stderr, "test_ls_0: expected \"new\" but got \"%s\"\n", r[1]);
360 fprintf (stderr, "test_ls_0: short list returned from command\n");
364 if (strcmp (r[2], "newer") != 0) {
365 fprintf (stderr, "test_ls_0: expected \"newer\" but got \"%s\"\n", r[2]);
369 fprintf (stderr, "test_ls_0: short list returned from command\n");
373 if (strcmp (r[3], "newest") != 0) {
374 fprintf (stderr, "test_ls_0: expected \"newest\" but got \"%s\"\n", r[3]);
378 fprintf (stderr, "test_ls_0: extra elements returned from command\n");
382 for (i = 0; r[i] != NULL; ++i)
389 static int test_list_devices_0 (void)
391 /* InitEmpty for list_devices (0) */
395 r = guestfs_umount_all (g);
402 r = guestfs_lvm_remove_all (g);
406 /* TestOutputList for list_devices (0) */
411 r = guestfs_list_devices (g);
415 fprintf (stderr, "test_list_devices_0: short list returned from command\n");
419 if (strcmp (r[0], "/dev/sda") != 0) {
420 fprintf (stderr, "test_list_devices_0: expected \"/dev/sda\" but got \"%s\"\n", r[0]);
424 fprintf (stderr, "test_list_devices_0: short list returned from command\n");
428 if (strcmp (r[1], "/dev/sdb") != 0) {
429 fprintf (stderr, "test_list_devices_0: expected \"/dev/sdb\" but got \"%s\"\n", r[1]);
433 fprintf (stderr, "test_list_devices_0: short list returned from command\n");
437 if (strcmp (r[2], "/dev/sdc") != 0) {
438 fprintf (stderr, "test_list_devices_0: expected \"/dev/sdc\" but got \"%s\"\n", r[2]);
442 fprintf (stderr, "test_list_devices_0: extra elements returned from command\n");
446 for (i = 0; r[i] != NULL; ++i)
453 static int test_list_partitions_0 (void)
455 /* InitBasicFS for list_partitions (0): create ext2 on /dev/sda1 */
459 r = guestfs_umount_all (g);
466 r = guestfs_lvm_remove_all (g);
477 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
484 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
491 r = guestfs_mount (g, "/dev/sda1", "/");
495 /* TestOutputList for list_partitions (0) */
500 r = guestfs_list_partitions (g);
504 fprintf (stderr, "test_list_partitions_0: short list returned from command\n");
508 if (strcmp (r[0], "/dev/sda1") != 0) {
509 fprintf (stderr, "test_list_partitions_0: expected \"/dev/sda1\" but got \"%s\"\n", r[0]);
513 fprintf (stderr, "test_list_partitions_0: extra elements returned from command\n");
517 for (i = 0; r[i] != NULL; ++i)
524 static int test_list_partitions_1 (void)
526 /* InitEmpty for list_partitions (1) */
530 r = guestfs_umount_all (g);
537 r = guestfs_lvm_remove_all (g);
541 /* TestOutputList for list_partitions (1) */
551 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
559 r = guestfs_list_partitions (g);
563 fprintf (stderr, "test_list_partitions_1: short list returned from command\n");
567 if (strcmp (r[0], "/dev/sda1") != 0) {
568 fprintf (stderr, "test_list_partitions_1: expected \"/dev/sda1\" but got \"%s\"\n", r[0]);
572 fprintf (stderr, "test_list_partitions_1: short list returned from command\n");
576 if (strcmp (r[1], "/dev/sda2") != 0) {
577 fprintf (stderr, "test_list_partitions_1: expected \"/dev/sda2\" but got \"%s\"\n", r[1]);
581 fprintf (stderr, "test_list_partitions_1: short list returned from command\n");
585 if (strcmp (r[2], "/dev/sda3") != 0) {
586 fprintf (stderr, "test_list_partitions_1: expected \"/dev/sda3\" but got \"%s\"\n", r[2]);
590 fprintf (stderr, "test_list_partitions_1: extra elements returned from command\n");
594 for (i = 0; r[i] != NULL; ++i)
601 static int test_pvs_0 (void)
603 /* InitBasicFSonLVM for pvs (0): create ext2 on /dev/VG/LV */
607 r = guestfs_umount_all (g);
614 r = guestfs_lvm_remove_all (g);
625 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
632 r = guestfs_pvcreate (g, "/dev/sda1");
643 r = guestfs_vgcreate (g, "VG", physvols);
650 r = guestfs_lvcreate (g, "LV", "VG", 8);
657 r = guestfs_mkfs (g, "ext2", "/dev/VG/LV");
664 r = guestfs_mount (g, "/dev/VG/LV", "/");
668 /* TestOutputList for pvs (0) */
677 fprintf (stderr, "test_pvs_0: short list returned from command\n");
681 if (strcmp (r[0], "/dev/sda1") != 0) {
682 fprintf (stderr, "test_pvs_0: expected \"/dev/sda1\" but got \"%s\"\n", r[0]);
686 fprintf (stderr, "test_pvs_0: extra elements returned from command\n");
690 for (i = 0; r[i] != NULL; ++i)
697 static int test_pvs_1 (void)
699 /* InitEmpty for pvs (1) */
703 r = guestfs_umount_all (g);
710 r = guestfs_lvm_remove_all (g);
714 /* TestOutputList for pvs (1) */
724 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
731 r = guestfs_pvcreate (g, "/dev/sda1");
738 r = guestfs_pvcreate (g, "/dev/sda2");
745 r = guestfs_pvcreate (g, "/dev/sda3");
757 fprintf (stderr, "test_pvs_1: short list returned from command\n");
761 if (strcmp (r[0], "/dev/sda1") != 0) {
762 fprintf (stderr, "test_pvs_1: expected \"/dev/sda1\" but got \"%s\"\n", r[0]);
766 fprintf (stderr, "test_pvs_1: short list returned from command\n");
770 if (strcmp (r[1], "/dev/sda2") != 0) {
771 fprintf (stderr, "test_pvs_1: expected \"/dev/sda2\" but got \"%s\"\n", r[1]);
775 fprintf (stderr, "test_pvs_1: short list returned from command\n");
779 if (strcmp (r[2], "/dev/sda3") != 0) {
780 fprintf (stderr, "test_pvs_1: expected \"/dev/sda3\" but got \"%s\"\n", r[2]);
784 fprintf (stderr, "test_pvs_1: extra elements returned from command\n");
788 for (i = 0; r[i] != NULL; ++i)
795 static int test_vgs_0 (void)
797 /* InitBasicFSonLVM for vgs (0): create ext2 on /dev/VG/LV */
801 r = guestfs_umount_all (g);
808 r = guestfs_lvm_remove_all (g);
819 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
826 r = guestfs_pvcreate (g, "/dev/sda1");
837 r = guestfs_vgcreate (g, "VG", physvols);
844 r = guestfs_lvcreate (g, "LV", "VG", 8);
851 r = guestfs_mkfs (g, "ext2", "/dev/VG/LV");
858 r = guestfs_mount (g, "/dev/VG/LV", "/");
862 /* TestOutputList for vgs (0) */
871 fprintf (stderr, "test_vgs_0: short list returned from command\n");
875 if (strcmp (r[0], "VG") != 0) {
876 fprintf (stderr, "test_vgs_0: expected \"VG\" but got \"%s\"\n", r[0]);
880 fprintf (stderr, "test_vgs_0: extra elements returned from command\n");
884 for (i = 0; r[i] != NULL; ++i)
891 static int test_vgs_1 (void)
893 /* InitEmpty for vgs (1) */
897 r = guestfs_umount_all (g);
904 r = guestfs_lvm_remove_all (g);
908 /* TestOutputList for vgs (1) */
918 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
925 r = guestfs_pvcreate (g, "/dev/sda1");
932 r = guestfs_pvcreate (g, "/dev/sda2");
939 r = guestfs_pvcreate (g, "/dev/sda3");
951 r = guestfs_vgcreate (g, "VG1", physvols);
962 r = guestfs_vgcreate (g, "VG2", physvols);
974 fprintf (stderr, "test_vgs_1: short list returned from command\n");
978 if (strcmp (r[0], "VG1") != 0) {
979 fprintf (stderr, "test_vgs_1: expected \"VG1\" but got \"%s\"\n", r[0]);
983 fprintf (stderr, "test_vgs_1: short list returned from command\n");
987 if (strcmp (r[1], "VG2") != 0) {
988 fprintf (stderr, "test_vgs_1: expected \"VG2\" but got \"%s\"\n", r[1]);
992 fprintf (stderr, "test_vgs_1: extra elements returned from command\n");
996 for (i = 0; r[i] != NULL; ++i)
1003 static int test_lvs_0 (void)
1005 /* InitBasicFSonLVM for lvs (0): create ext2 on /dev/VG/LV */
1009 r = guestfs_umount_all (g);
1016 r = guestfs_lvm_remove_all (g);
1027 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
1034 r = guestfs_pvcreate (g, "/dev/sda1");
1039 char *physvols[] = {
1045 r = guestfs_vgcreate (g, "VG", physvols);
1052 r = guestfs_lvcreate (g, "LV", "VG", 8);
1059 r = guestfs_mkfs (g, "ext2", "/dev/VG/LV");
1066 r = guestfs_mount (g, "/dev/VG/LV", "/");
1070 /* TestOutputList for lvs (0) */
1075 r = guestfs_lvs (g);
1079 fprintf (stderr, "test_lvs_0: short list returned from command\n");
1083 if (strcmp (r[0], "/dev/VG/LV") != 0) {
1084 fprintf (stderr, "test_lvs_0: expected \"/dev/VG/LV\" but got \"%s\"\n", r[0]);
1088 fprintf (stderr, "test_lvs_0: extra elements returned from command\n");
1092 for (i = 0; r[i] != NULL; ++i)
1099 static int test_lvs_1 (void)
1101 /* InitEmpty for lvs (1) */
1105 r = guestfs_umount_all (g);
1112 r = guestfs_lvm_remove_all (g);
1116 /* TestOutputList for lvs (1) */
1126 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
1133 r = guestfs_pvcreate (g, "/dev/sda1");
1140 r = guestfs_pvcreate (g, "/dev/sda2");
1147 r = guestfs_pvcreate (g, "/dev/sda3");
1152 char *physvols[] = {
1159 r = guestfs_vgcreate (g, "VG1", physvols);
1164 char *physvols[] = {
1170 r = guestfs_vgcreate (g, "VG2", physvols);
1177 r = guestfs_lvcreate (g, "LV1", "VG1", 50);
1184 r = guestfs_lvcreate (g, "LV2", "VG1", 50);
1191 r = guestfs_lvcreate (g, "LV3", "VG2", 50);
1199 r = guestfs_lvs (g);
1203 fprintf (stderr, "test_lvs_1: short list returned from command\n");
1207 if (strcmp (r[0], "/dev/VG1/LV1") != 0) {
1208 fprintf (stderr, "test_lvs_1: expected \"/dev/VG1/LV1\" but got \"%s\"\n", r[0]);
1212 fprintf (stderr, "test_lvs_1: short list returned from command\n");
1216 if (strcmp (r[1], "/dev/VG1/LV2") != 0) {
1217 fprintf (stderr, "test_lvs_1: expected \"/dev/VG1/LV2\" but got \"%s\"\n", r[1]);
1221 fprintf (stderr, "test_lvs_1: short list returned from command\n");
1225 if (strcmp (r[2], "/dev/VG2/LV3") != 0) {
1226 fprintf (stderr, "test_lvs_1: expected \"/dev/VG2/LV3\" but got \"%s\"\n", r[2]);
1230 fprintf (stderr, "test_lvs_1: extra elements returned from command\n");
1234 for (i = 0; r[i] != NULL; ++i)
1241 static int test_pvs_full_0 (void)
1243 /* InitBasicFSonLVM for pvs_full (0): create ext2 on /dev/VG/LV */
1247 r = guestfs_umount_all (g);
1254 r = guestfs_lvm_remove_all (g);
1265 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
1272 r = guestfs_pvcreate (g, "/dev/sda1");
1277 char *physvols[] = {
1283 r = guestfs_vgcreate (g, "VG", physvols);
1290 r = guestfs_lvcreate (g, "LV", "VG", 8);
1297 r = guestfs_mkfs (g, "ext2", "/dev/VG/LV");
1304 r = guestfs_mount (g, "/dev/VG/LV", "/");
1308 /* TestOutputLength for pvs_full (0) */
1313 r = guestfs_pvs (g);
1317 for (j = 0; j < 1; ++j)
1319 fprintf (stderr, "test_pvs_full_0: short list returned\n");
1324 fprintf (stderr, "test_pvs_full_0: long list returned\n");
1328 for (i = 0; r[i] != NULL; ++i)
1335 static int test_vgs_full_0 (void)
1337 /* InitBasicFSonLVM for vgs_full (0): create ext2 on /dev/VG/LV */
1341 r = guestfs_umount_all (g);
1348 r = guestfs_lvm_remove_all (g);
1359 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
1366 r = guestfs_pvcreate (g, "/dev/sda1");
1371 char *physvols[] = {
1377 r = guestfs_vgcreate (g, "VG", physvols);
1384 r = guestfs_lvcreate (g, "LV", "VG", 8);
1391 r = guestfs_mkfs (g, "ext2", "/dev/VG/LV");
1398 r = guestfs_mount (g, "/dev/VG/LV", "/");
1402 /* TestOutputLength for vgs_full (0) */
1407 r = guestfs_pvs (g);
1411 for (j = 0; j < 1; ++j)
1413 fprintf (stderr, "test_vgs_full_0: short list returned\n");
1418 fprintf (stderr, "test_vgs_full_0: long list returned\n");
1422 for (i = 0; r[i] != NULL; ++i)
1429 static int test_lvs_full_0 (void)
1431 /* InitBasicFSonLVM for lvs_full (0): create ext2 on /dev/VG/LV */
1435 r = guestfs_umount_all (g);
1442 r = guestfs_lvm_remove_all (g);
1453 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
1460 r = guestfs_pvcreate (g, "/dev/sda1");
1465 char *physvols[] = {
1471 r = guestfs_vgcreate (g, "VG", physvols);
1478 r = guestfs_lvcreate (g, "LV", "VG", 8);
1485 r = guestfs_mkfs (g, "ext2", "/dev/VG/LV");
1492 r = guestfs_mount (g, "/dev/VG/LV", "/");
1496 /* TestOutputLength for lvs_full (0) */
1501 r = guestfs_pvs (g);
1505 for (j = 0; j < 1; ++j)
1507 fprintf (stderr, "test_lvs_full_0: short list returned\n");
1512 fprintf (stderr, "test_lvs_full_0: long list returned\n");
1516 for (i = 0; r[i] != NULL; ++i)
1523 static int test_read_lines_0 (void)
1525 /* InitBasicFS for read_lines (0): create ext2 on /dev/sda1 */
1529 r = guestfs_umount_all (g);
1536 r = guestfs_lvm_remove_all (g);
1547 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
1554 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
1561 r = guestfs_mount (g, "/dev/sda1", "/");
1565 /* TestOutputList for read_lines (0) */
1569 r = guestfs_write_file (g, "/new", "line1\r\nline2\nline3", 0);
1577 r = guestfs_read_lines (g, "/new");
1581 fprintf (stderr, "test_read_lines_0: short list returned from command\n");
1585 if (strcmp (r[0], "line1") != 0) {
1586 fprintf (stderr, "test_read_lines_0: expected \"line1\" but got \"%s\"\n", r[0]);
1590 fprintf (stderr, "test_read_lines_0: short list returned from command\n");
1594 if (strcmp (r[1], "line2") != 0) {
1595 fprintf (stderr, "test_read_lines_0: expected \"line2\" but got \"%s\"\n", r[1]);
1599 fprintf (stderr, "test_read_lines_0: short list returned from command\n");
1603 if (strcmp (r[2], "line3") != 0) {
1604 fprintf (stderr, "test_read_lines_0: expected \"line3\" but got \"%s\"\n", r[2]);
1608 fprintf (stderr, "test_read_lines_0: extra elements returned from command\n");
1612 for (i = 0; r[i] != NULL; ++i)
1619 static int test_read_lines_1 (void)
1621 /* InitBasicFS for read_lines (1): create ext2 on /dev/sda1 */
1625 r = guestfs_umount_all (g);
1632 r = guestfs_lvm_remove_all (g);
1643 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
1650 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
1657 r = guestfs_mount (g, "/dev/sda1", "/");
1661 /* TestOutputList for read_lines (1) */
1665 r = guestfs_write_file (g, "/new", "", 0);
1673 r = guestfs_read_lines (g, "/new");
1677 fprintf (stderr, "test_read_lines_1: extra elements returned from command\n");
1681 for (i = 0; r[i] != NULL; ++i)
1688 static int test_rm_0 (void)
1690 /* InitBasicFS for rm (0): create ext2 on /dev/sda1 */
1694 r = guestfs_umount_all (g);
1701 r = guestfs_lvm_remove_all (g);
1712 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
1719 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
1726 r = guestfs_mount (g, "/dev/sda1", "/");
1730 /* TestRun for rm (0) */
1734 r = guestfs_touch (g, "/new");
1741 r = guestfs_rm (g, "/new");
1748 static int test_rm_1 (void)
1750 /* InitBasicFS for rm (1): create ext2 on /dev/sda1 */
1754 r = guestfs_umount_all (g);
1761 r = guestfs_lvm_remove_all (g);
1772 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
1779 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
1786 r = guestfs_mount (g, "/dev/sda1", "/");
1790 /* TestLastFail for rm (1) */
1794 r = guestfs_rm (g, "/new");
1801 static int test_rm_2 (void)
1803 /* InitBasicFS for rm (2): create ext2 on /dev/sda1 */
1807 r = guestfs_umount_all (g);
1814 r = guestfs_lvm_remove_all (g);
1825 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
1832 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
1839 r = guestfs_mount (g, "/dev/sda1", "/");
1843 /* TestLastFail for rm (2) */
1847 r = guestfs_mkdir (g, "/new");
1854 r = guestfs_rm (g, "/new");
1861 static int test_rmdir_0 (void)
1863 /* InitBasicFS for rmdir (0): create ext2 on /dev/sda1 */
1867 r = guestfs_umount_all (g);
1874 r = guestfs_lvm_remove_all (g);
1885 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
1892 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
1899 r = guestfs_mount (g, "/dev/sda1", "/");
1903 /* TestRun for rmdir (0) */
1907 r = guestfs_mkdir (g, "/new");
1914 r = guestfs_rmdir (g, "/new");
1921 static int test_rmdir_1 (void)
1923 /* InitBasicFS for rmdir (1): create ext2 on /dev/sda1 */
1927 r = guestfs_umount_all (g);
1934 r = guestfs_lvm_remove_all (g);
1945 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
1952 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
1959 r = guestfs_mount (g, "/dev/sda1", "/");
1963 /* TestLastFail for rmdir (1) */
1967 r = guestfs_rmdir (g, "/new");
1974 static int test_rmdir_2 (void)
1976 /* InitBasicFS for rmdir (2): create ext2 on /dev/sda1 */
1980 r = guestfs_umount_all (g);
1987 r = guestfs_lvm_remove_all (g);
1998 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
2005 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
2012 r = guestfs_mount (g, "/dev/sda1", "/");
2016 /* TestLastFail for rmdir (2) */
2020 r = guestfs_touch (g, "/new");
2027 r = guestfs_rmdir (g, "/new");
2034 static int test_rm_rf_0 (void)
2036 /* InitBasicFS for rm_rf (0): create ext2 on /dev/sda1 */
2040 r = guestfs_umount_all (g);
2047 r = guestfs_lvm_remove_all (g);
2058 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
2065 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
2072 r = guestfs_mount (g, "/dev/sda1", "/");
2076 /* TestOutputFalse for rm_rf (0) */
2080 r = guestfs_mkdir (g, "/new");
2087 r = guestfs_mkdir (g, "/new/foo");
2094 r = guestfs_touch (g, "/new/foo/bar");
2101 r = guestfs_rm_rf (g, "/new");
2108 r = guestfs_exists (g, "/new");
2112 fprintf (stderr, "test_rm_rf_0: expected false, got true\n");
2119 static int test_mkdir_0 (void)
2121 /* InitBasicFS for mkdir (0): create ext2 on /dev/sda1 */
2125 r = guestfs_umount_all (g);
2132 r = guestfs_lvm_remove_all (g);
2143 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
2150 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
2157 r = guestfs_mount (g, "/dev/sda1", "/");
2161 /* TestOutputTrue for mkdir (0) */
2165 r = guestfs_mkdir (g, "/new");
2172 r = guestfs_is_dir (g, "/new");
2176 fprintf (stderr, "test_mkdir_0: expected true, got false\n");
2183 static int test_mkdir_1 (void)
2185 /* InitBasicFS for mkdir (1): create ext2 on /dev/sda1 */
2189 r = guestfs_umount_all (g);
2196 r = guestfs_lvm_remove_all (g);
2207 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
2214 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
2221 r = guestfs_mount (g, "/dev/sda1", "/");
2225 /* TestLastFail for mkdir (1) */
2229 r = guestfs_mkdir (g, "/new/foo/bar");
2236 static int test_mkdir_p_0 (void)
2238 /* InitBasicFS for mkdir_p (0): create ext2 on /dev/sda1 */
2242 r = guestfs_umount_all (g);
2249 r = guestfs_lvm_remove_all (g);
2260 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
2267 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
2274 r = guestfs_mount (g, "/dev/sda1", "/");
2278 /* TestOutputTrue for mkdir_p (0) */
2282 r = guestfs_mkdir_p (g, "/new/foo/bar");
2289 r = guestfs_is_dir (g, "/new/foo/bar");
2293 fprintf (stderr, "test_mkdir_p_0: expected true, got false\n");
2300 static int test_mkdir_p_1 (void)
2302 /* InitBasicFS for mkdir_p (1): create ext2 on /dev/sda1 */
2306 r = guestfs_umount_all (g);
2313 r = guestfs_lvm_remove_all (g);
2324 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
2331 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
2338 r = guestfs_mount (g, "/dev/sda1", "/");
2342 /* TestOutputTrue for mkdir_p (1) */
2346 r = guestfs_mkdir_p (g, "/new/foo/bar");
2353 r = guestfs_is_dir (g, "/new/foo");
2357 fprintf (stderr, "test_mkdir_p_1: expected true, got false\n");
2364 static int test_mkdir_p_2 (void)
2366 /* InitBasicFS for mkdir_p (2): create ext2 on /dev/sda1 */
2370 r = guestfs_umount_all (g);
2377 r = guestfs_lvm_remove_all (g);
2388 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
2395 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
2402 r = guestfs_mount (g, "/dev/sda1", "/");
2406 /* TestOutputTrue for mkdir_p (2) */
2410 r = guestfs_mkdir_p (g, "/new/foo/bar");
2417 r = guestfs_is_dir (g, "/new");
2421 fprintf (stderr, "test_mkdir_p_2: expected true, got false\n");
2428 static int test_exists_0 (void)
2430 /* InitBasicFS for exists (0): create ext2 on /dev/sda1 */
2434 r = guestfs_umount_all (g);
2441 r = guestfs_lvm_remove_all (g);
2452 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
2459 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
2466 r = guestfs_mount (g, "/dev/sda1", "/");
2470 /* TestOutputTrue for exists (0) */
2474 r = guestfs_touch (g, "/new");
2481 r = guestfs_exists (g, "/new");
2485 fprintf (stderr, "test_exists_0: expected true, got false\n");
2492 static int test_exists_1 (void)
2494 /* InitBasicFS for exists (1): create ext2 on /dev/sda1 */
2498 r = guestfs_umount_all (g);
2505 r = guestfs_lvm_remove_all (g);
2516 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
2523 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
2530 r = guestfs_mount (g, "/dev/sda1", "/");
2534 /* TestOutputTrue for exists (1) */
2538 r = guestfs_mkdir (g, "/new");
2545 r = guestfs_exists (g, "/new");
2549 fprintf (stderr, "test_exists_1: expected true, got false\n");
2556 static int test_is_file_0 (void)
2558 /* InitBasicFS for is_file (0): create ext2 on /dev/sda1 */
2562 r = guestfs_umount_all (g);
2569 r = guestfs_lvm_remove_all (g);
2580 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
2587 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
2594 r = guestfs_mount (g, "/dev/sda1", "/");
2598 /* TestOutputTrue for is_file (0) */
2602 r = guestfs_touch (g, "/new");
2609 r = guestfs_is_file (g, "/new");
2613 fprintf (stderr, "test_is_file_0: expected true, got false\n");
2620 static int test_is_file_1 (void)
2622 /* InitBasicFS for is_file (1): create ext2 on /dev/sda1 */
2626 r = guestfs_umount_all (g);
2633 r = guestfs_lvm_remove_all (g);
2644 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
2651 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
2658 r = guestfs_mount (g, "/dev/sda1", "/");
2662 /* TestOutputFalse for is_file (1) */
2666 r = guestfs_mkdir (g, "/new");
2673 r = guestfs_is_file (g, "/new");
2677 fprintf (stderr, "test_is_file_1: expected false, got true\n");
2684 static int test_is_dir_0 (void)
2686 /* InitBasicFS for is_dir (0): create ext2 on /dev/sda1 */
2690 r = guestfs_umount_all (g);
2697 r = guestfs_lvm_remove_all (g);
2708 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
2715 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
2722 r = guestfs_mount (g, "/dev/sda1", "/");
2726 /* TestOutputFalse for is_dir (0) */
2730 r = guestfs_touch (g, "/new");
2737 r = guestfs_is_dir (g, "/new");
2741 fprintf (stderr, "test_is_dir_0: expected false, got true\n");
2748 static int test_is_dir_1 (void)
2750 /* InitBasicFS for is_dir (1): create ext2 on /dev/sda1 */
2754 r = guestfs_umount_all (g);
2761 r = guestfs_lvm_remove_all (g);
2772 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
2779 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
2786 r = guestfs_mount (g, "/dev/sda1", "/");
2790 /* TestOutputTrue for is_dir (1) */
2794 r = guestfs_mkdir (g, "/new");
2801 r = guestfs_is_dir (g, "/new");
2805 fprintf (stderr, "test_is_dir_1: expected true, got false\n");
2812 static int test_pvcreate_0 (void)
2814 /* InitEmpty for pvcreate (0) */
2818 r = guestfs_umount_all (g);
2825 r = guestfs_lvm_remove_all (g);
2829 /* TestOutputList for pvcreate (0) */
2839 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
2846 r = guestfs_pvcreate (g, "/dev/sda1");
2853 r = guestfs_pvcreate (g, "/dev/sda2");
2860 r = guestfs_pvcreate (g, "/dev/sda3");
2868 r = guestfs_pvs (g);
2872 fprintf (stderr, "test_pvcreate_0: short list returned from command\n");
2876 if (strcmp (r[0], "/dev/sda1") != 0) {
2877 fprintf (stderr, "test_pvcreate_0: expected \"/dev/sda1\" but got \"%s\"\n", r[0]);
2881 fprintf (stderr, "test_pvcreate_0: short list returned from command\n");
2885 if (strcmp (r[1], "/dev/sda2") != 0) {
2886 fprintf (stderr, "test_pvcreate_0: expected \"/dev/sda2\" but got \"%s\"\n", r[1]);
2890 fprintf (stderr, "test_pvcreate_0: short list returned from command\n");
2894 if (strcmp (r[2], "/dev/sda3") != 0) {
2895 fprintf (stderr, "test_pvcreate_0: expected \"/dev/sda3\" but got \"%s\"\n", r[2]);
2899 fprintf (stderr, "test_pvcreate_0: extra elements returned from command\n");
2903 for (i = 0; r[i] != NULL; ++i)
2910 static int test_vgcreate_0 (void)
2912 /* InitEmpty for vgcreate (0) */
2916 r = guestfs_umount_all (g);
2923 r = guestfs_lvm_remove_all (g);
2927 /* TestOutputList for vgcreate (0) */
2937 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
2944 r = guestfs_pvcreate (g, "/dev/sda1");
2951 r = guestfs_pvcreate (g, "/dev/sda2");
2958 r = guestfs_pvcreate (g, "/dev/sda3");
2963 char *physvols[] = {
2970 r = guestfs_vgcreate (g, "VG1", physvols);
2975 char *physvols[] = {
2981 r = guestfs_vgcreate (g, "VG2", physvols);
2989 r = guestfs_vgs (g);
2993 fprintf (stderr, "test_vgcreate_0: short list returned from command\n");
2997 if (strcmp (r[0], "VG1") != 0) {
2998 fprintf (stderr, "test_vgcreate_0: expected \"VG1\" but got \"%s\"\n", r[0]);
3002 fprintf (stderr, "test_vgcreate_0: short list returned from command\n");
3006 if (strcmp (r[1], "VG2") != 0) {
3007 fprintf (stderr, "test_vgcreate_0: expected \"VG2\" but got \"%s\"\n", r[1]);
3011 fprintf (stderr, "test_vgcreate_0: extra elements returned from command\n");
3015 for (i = 0; r[i] != NULL; ++i)
3022 static int test_lvcreate_0 (void)
3024 /* InitEmpty for lvcreate (0) */
3028 r = guestfs_umount_all (g);
3035 r = guestfs_lvm_remove_all (g);
3039 /* TestOutputList for lvcreate (0) */
3049 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
3056 r = guestfs_pvcreate (g, "/dev/sda1");
3063 r = guestfs_pvcreate (g, "/dev/sda2");
3070 r = guestfs_pvcreate (g, "/dev/sda3");
3075 char *physvols[] = {
3082 r = guestfs_vgcreate (g, "VG1", physvols);
3087 char *physvols[] = {
3093 r = guestfs_vgcreate (g, "VG2", physvols);
3100 r = guestfs_lvcreate (g, "LV1", "VG1", 50);
3107 r = guestfs_lvcreate (g, "LV2", "VG1", 50);
3114 r = guestfs_lvcreate (g, "LV3", "VG2", 50);
3121 r = guestfs_lvcreate (g, "LV4", "VG2", 50);
3128 r = guestfs_lvcreate (g, "LV5", "VG2", 50);
3136 r = guestfs_lvs (g);
3140 fprintf (stderr, "test_lvcreate_0: short list returned from command\n");
3144 if (strcmp (r[0], "/dev/VG1/LV1") != 0) {
3145 fprintf (stderr, "test_lvcreate_0: expected \"/dev/VG1/LV1\" but got \"%s\"\n", r[0]);
3149 fprintf (stderr, "test_lvcreate_0: short list returned from command\n");
3153 if (strcmp (r[1], "/dev/VG1/LV2") != 0) {
3154 fprintf (stderr, "test_lvcreate_0: expected \"/dev/VG1/LV2\" but got \"%s\"\n", r[1]);
3158 fprintf (stderr, "test_lvcreate_0: short list returned from command\n");
3162 if (strcmp (r[2], "/dev/VG2/LV3") != 0) {
3163 fprintf (stderr, "test_lvcreate_0: expected \"/dev/VG2/LV3\" but got \"%s\"\n", r[2]);
3167 fprintf (stderr, "test_lvcreate_0: short list returned from command\n");
3171 if (strcmp (r[3], "/dev/VG2/LV4") != 0) {
3172 fprintf (stderr, "test_lvcreate_0: expected \"/dev/VG2/LV4\" but got \"%s\"\n", r[3]);
3176 fprintf (stderr, "test_lvcreate_0: short list returned from command\n");
3180 if (strcmp (r[4], "/dev/VG2/LV5") != 0) {
3181 fprintf (stderr, "test_lvcreate_0: expected \"/dev/VG2/LV5\" but got \"%s\"\n", r[4]);
3185 fprintf (stderr, "test_lvcreate_0: extra elements returned from command\n");
3189 for (i = 0; r[i] != NULL; ++i)
3196 static int test_mkfs_0 (void)
3198 /* InitEmpty for mkfs (0) */
3202 r = guestfs_umount_all (g);
3209 r = guestfs_lvm_remove_all (g);
3213 /* TestOutput for mkfs (0) */
3221 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
3228 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
3235 r = guestfs_mount (g, "/dev/sda1", "/");
3242 r = guestfs_write_file (g, "/new", "new file contents", 0);
3249 r = guestfs_cat (g, "/new");
3252 if (strcmp (r, "new file contents") != 0) {
3253 fprintf (stderr, "test_mkfs_0: expected \"new file contents\" but got \"%s\"\n", r);
3261 static int test_write_file_0 (void)
3263 /* InitEmpty for write_file (0) */
3267 r = guestfs_umount_all (g);
3274 r = guestfs_lvm_remove_all (g);
3278 /* TestOutput for write_file (0) */
3286 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
3293 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
3300 r = guestfs_mount (g, "/dev/sda1", "/");
3307 r = guestfs_write_file (g, "/new", "new file contents", 0);
3314 r = guestfs_cat (g, "/new");
3317 if (strcmp (r, "new file contents") != 0) {
3318 fprintf (stderr, "test_write_file_0: expected \"new file contents\" but got \"%s\"\n", r);
3326 static int test_umount_0 (void)
3328 /* InitEmpty for umount (0) */
3332 r = guestfs_umount_all (g);
3339 r = guestfs_lvm_remove_all (g);
3343 /* TestOutputList for umount (0) */
3351 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
3358 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
3365 r = guestfs_mount (g, "/dev/sda1", "/");
3373 r = guestfs_mounts (g);
3377 fprintf (stderr, "test_umount_0: short list returned from command\n");
3381 if (strcmp (r[0], "/dev/sda1") != 0) {
3382 fprintf (stderr, "test_umount_0: expected \"/dev/sda1\" but got \"%s\"\n", r[0]);
3386 fprintf (stderr, "test_umount_0: extra elements returned from command\n");
3390 for (i = 0; r[i] != NULL; ++i)
3397 static int test_umount_1 (void)
3399 /* InitEmpty for umount (1) */
3403 r = guestfs_umount_all (g);
3410 r = guestfs_lvm_remove_all (g);
3414 /* TestOutputList for umount (1) */
3422 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
3429 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
3436 r = guestfs_mount (g, "/dev/sda1", "/");
3443 r = guestfs_umount (g, "/");
3451 r = guestfs_mounts (g);
3455 fprintf (stderr, "test_umount_1: extra elements returned from command\n");
3459 for (i = 0; r[i] != NULL; ++i)
3466 static int test_mounts_0 (void)
3468 /* InitBasicFS for mounts (0): create ext2 on /dev/sda1 */
3472 r = guestfs_umount_all (g);
3479 r = guestfs_lvm_remove_all (g);
3490 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
3497 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
3504 r = guestfs_mount (g, "/dev/sda1", "/");
3508 /* TestOutputList for mounts (0) */
3513 r = guestfs_mounts (g);
3517 fprintf (stderr, "test_mounts_0: short list returned from command\n");
3521 if (strcmp (r[0], "/dev/sda1") != 0) {
3522 fprintf (stderr, "test_mounts_0: expected \"/dev/sda1\" but got \"%s\"\n", r[0]);
3526 fprintf (stderr, "test_mounts_0: extra elements returned from command\n");
3530 for (i = 0; r[i] != NULL; ++i)
3537 static int test_umount_all_0 (void)
3539 /* InitBasicFS for umount_all (0): create ext2 on /dev/sda1 */
3543 r = guestfs_umount_all (g);
3550 r = guestfs_lvm_remove_all (g);
3561 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
3568 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
3575 r = guestfs_mount (g, "/dev/sda1", "/");
3579 /* TestOutputList for umount_all (0) */
3583 r = guestfs_umount_all (g);
3591 r = guestfs_mounts (g);
3595 fprintf (stderr, "test_umount_all_0: extra elements returned from command\n");
3599 for (i = 0; r[i] != NULL; ++i)
3606 static int test_file_0 (void)
3608 /* InitBasicFS for file (0): create ext2 on /dev/sda1 */
3612 r = guestfs_umount_all (g);
3619 r = guestfs_lvm_remove_all (g);
3630 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
3637 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
3644 r = guestfs_mount (g, "/dev/sda1", "/");
3648 /* TestOutput for file (0) */
3652 r = guestfs_touch (g, "/new");
3659 r = guestfs_file (g, "/new");
3662 if (strcmp (r, "empty") != 0) {
3663 fprintf (stderr, "test_file_0: expected \"empty\" but got \"%s\"\n", r);
3671 static int test_file_1 (void)
3673 /* InitBasicFS for file (1): create ext2 on /dev/sda1 */
3677 r = guestfs_umount_all (g);
3684 r = guestfs_lvm_remove_all (g);
3695 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
3702 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
3709 r = guestfs_mount (g, "/dev/sda1", "/");
3713 /* TestOutput for file (1) */
3717 r = guestfs_write_file (g, "/new", "some content\n", 0);
3724 r = guestfs_file (g, "/new");
3727 if (strcmp (r, "ASCII text") != 0) {
3728 fprintf (stderr, "test_file_1: expected \"ASCII text\" but got \"%s\"\n", r);
3736 static int test_file_2 (void)
3738 /* InitBasicFS for file (2): create ext2 on /dev/sda1 */
3742 r = guestfs_umount_all (g);
3749 r = guestfs_lvm_remove_all (g);
3760 r = guestfs_sfdisk (g, "/dev/sda", 0, 0, 0, lines);
3767 r = guestfs_mkfs (g, "ext2", "/dev/sda1");
3774 r = guestfs_mount (g, "/dev/sda1", "/");
3778 /* TestLastFail for file (2) */
3782 r = guestfs_file (g, "/nofile");
3790 int main (int argc, char *argv[])
3798 g = guestfs_create ();
3800 printf ("guestfs_create FAILED\n");
3804 guestfs_set_error_handler (g, print_error, NULL);
3806 srcdir = getenv ("srcdir");
3807 if (!srcdir) srcdir = ".";
3808 guestfs_set_path (g, srcdir);
3810 snprintf (buf, sizeof buf, "%s/test1.img", srcdir);
3811 fd = open (buf, O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK|O_TRUNC, 0666);
3816 if (lseek (fd, 524288000, SEEK_SET) == -1) {
3822 if (write (fd, &c, 1) == -1) {
3828 if (close (fd) == -1) {
3833 if (guestfs_add_drive (g, buf) == -1) {
3834 printf ("guestfs_add_drive %s FAILED\n", buf);
3838 snprintf (buf, sizeof buf, "%s/test2.img", srcdir);
3839 fd = open (buf, O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK|O_TRUNC, 0666);
3844 if (lseek (fd, 52428800, SEEK_SET) == -1) {
3850 if (write (fd, &c, 1) == -1) {
3856 if (close (fd) == -1) {
3861 if (guestfs_add_drive (g, buf) == -1) {
3862 printf ("guestfs_add_drive %s FAILED\n", buf);
3866 snprintf (buf, sizeof buf, "%s/test3.img", srcdir);
3867 fd = open (buf, O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK|O_TRUNC, 0666);
3872 if (lseek (fd, 10485760, SEEK_SET) == -1) {
3878 if (write (fd, &c, 1) == -1) {
3884 if (close (fd) == -1) {
3889 if (guestfs_add_drive (g, buf) == -1) {
3890 printf ("guestfs_add_drive %s FAILED\n", buf);
3894 if (guestfs_launch (g) == -1) {
3895 printf ("guestfs_launch FAILED\n");
3898 if (guestfs_wait_ready (g) == -1) {
3899 printf ("guestfs_wait_ready FAILED\n");
3903 printf (" 1/ 49 test_mount_0\n");
3904 if (test_mount_0 () == -1) {
3905 printf ("test_mount_0 FAILED\n");
3908 printf (" 2/ 49 test_sync_0\n");
3909 if (test_sync_0 () == -1) {
3910 printf ("test_sync_0 FAILED\n");
3913 printf (" 3/ 49 test_touch_0\n");
3914 if (test_touch_0 () == -1) {
3915 printf ("test_touch_0 FAILED\n");
3918 printf (" 4/ 49 test_cat_0\n");
3919 if (test_cat_0 () == -1) {
3920 printf ("test_cat_0 FAILED\n");
3923 printf (" 5/ 49 test_ls_0\n");
3924 if (test_ls_0 () == -1) {
3925 printf ("test_ls_0 FAILED\n");
3928 printf (" 6/ 49 test_list_devices_0\n");
3929 if (test_list_devices_0 () == -1) {
3930 printf ("test_list_devices_0 FAILED\n");
3933 printf (" 7/ 49 test_list_partitions_0\n");
3934 if (test_list_partitions_0 () == -1) {
3935 printf ("test_list_partitions_0 FAILED\n");
3938 printf (" 8/ 49 test_list_partitions_1\n");
3939 if (test_list_partitions_1 () == -1) {
3940 printf ("test_list_partitions_1 FAILED\n");
3943 printf (" 9/ 49 test_pvs_0\n");
3944 if (test_pvs_0 () == -1) {
3945 printf ("test_pvs_0 FAILED\n");
3948 printf (" 10/ 49 test_pvs_1\n");
3949 if (test_pvs_1 () == -1) {
3950 printf ("test_pvs_1 FAILED\n");
3953 printf (" 11/ 49 test_vgs_0\n");
3954 if (test_vgs_0 () == -1) {
3955 printf ("test_vgs_0 FAILED\n");
3958 printf (" 12/ 49 test_vgs_1\n");
3959 if (test_vgs_1 () == -1) {
3960 printf ("test_vgs_1 FAILED\n");
3963 printf (" 13/ 49 test_lvs_0\n");
3964 if (test_lvs_0 () == -1) {
3965 printf ("test_lvs_0 FAILED\n");
3968 printf (" 14/ 49 test_lvs_1\n");
3969 if (test_lvs_1 () == -1) {
3970 printf ("test_lvs_1 FAILED\n");
3973 printf (" 15/ 49 test_pvs_full_0\n");
3974 if (test_pvs_full_0 () == -1) {
3975 printf ("test_pvs_full_0 FAILED\n");
3978 printf (" 16/ 49 test_vgs_full_0\n");
3979 if (test_vgs_full_0 () == -1) {
3980 printf ("test_vgs_full_0 FAILED\n");
3983 printf (" 17/ 49 test_lvs_full_0\n");
3984 if (test_lvs_full_0 () == -1) {
3985 printf ("test_lvs_full_0 FAILED\n");
3988 printf (" 18/ 49 test_read_lines_0\n");
3989 if (test_read_lines_0 () == -1) {
3990 printf ("test_read_lines_0 FAILED\n");
3993 printf (" 19/ 49 test_read_lines_1\n");
3994 if (test_read_lines_1 () == -1) {
3995 printf ("test_read_lines_1 FAILED\n");
3998 printf (" 20/ 49 test_rm_0\n");
3999 if (test_rm_0 () == -1) {
4000 printf ("test_rm_0 FAILED\n");
4003 printf (" 21/ 49 test_rm_1\n");
4004 if (test_rm_1 () == -1) {
4005 printf ("test_rm_1 FAILED\n");
4008 printf (" 22/ 49 test_rm_2\n");
4009 if (test_rm_2 () == -1) {
4010 printf ("test_rm_2 FAILED\n");
4013 printf (" 23/ 49 test_rmdir_0\n");
4014 if (test_rmdir_0 () == -1) {
4015 printf ("test_rmdir_0 FAILED\n");
4018 printf (" 24/ 49 test_rmdir_1\n");
4019 if (test_rmdir_1 () == -1) {
4020 printf ("test_rmdir_1 FAILED\n");
4023 printf (" 25/ 49 test_rmdir_2\n");
4024 if (test_rmdir_2 () == -1) {
4025 printf ("test_rmdir_2 FAILED\n");
4028 printf (" 26/ 49 test_rm_rf_0\n");
4029 if (test_rm_rf_0 () == -1) {
4030 printf ("test_rm_rf_0 FAILED\n");
4033 printf (" 27/ 49 test_mkdir_0\n");
4034 if (test_mkdir_0 () == -1) {
4035 printf ("test_mkdir_0 FAILED\n");
4038 printf (" 28/ 49 test_mkdir_1\n");
4039 if (test_mkdir_1 () == -1) {
4040 printf ("test_mkdir_1 FAILED\n");
4043 printf (" 29/ 49 test_mkdir_p_0\n");
4044 if (test_mkdir_p_0 () == -1) {
4045 printf ("test_mkdir_p_0 FAILED\n");
4048 printf (" 30/ 49 test_mkdir_p_1\n");
4049 if (test_mkdir_p_1 () == -1) {
4050 printf ("test_mkdir_p_1 FAILED\n");
4053 printf (" 31/ 49 test_mkdir_p_2\n");
4054 if (test_mkdir_p_2 () == -1) {
4055 printf ("test_mkdir_p_2 FAILED\n");
4058 printf (" 32/ 49 test_exists_0\n");
4059 if (test_exists_0 () == -1) {
4060 printf ("test_exists_0 FAILED\n");
4063 printf (" 33/ 49 test_exists_1\n");
4064 if (test_exists_1 () == -1) {
4065 printf ("test_exists_1 FAILED\n");
4068 printf (" 34/ 49 test_is_file_0\n");
4069 if (test_is_file_0 () == -1) {
4070 printf ("test_is_file_0 FAILED\n");
4073 printf (" 35/ 49 test_is_file_1\n");
4074 if (test_is_file_1 () == -1) {
4075 printf ("test_is_file_1 FAILED\n");
4078 printf (" 36/ 49 test_is_dir_0\n");
4079 if (test_is_dir_0 () == -1) {
4080 printf ("test_is_dir_0 FAILED\n");
4083 printf (" 37/ 49 test_is_dir_1\n");
4084 if (test_is_dir_1 () == -1) {
4085 printf ("test_is_dir_1 FAILED\n");
4088 printf (" 38/ 49 test_pvcreate_0\n");
4089 if (test_pvcreate_0 () == -1) {
4090 printf ("test_pvcreate_0 FAILED\n");
4093 printf (" 39/ 49 test_vgcreate_0\n");
4094 if (test_vgcreate_0 () == -1) {
4095 printf ("test_vgcreate_0 FAILED\n");
4098 printf (" 40/ 49 test_lvcreate_0\n");
4099 if (test_lvcreate_0 () == -1) {
4100 printf ("test_lvcreate_0 FAILED\n");
4103 printf (" 41/ 49 test_mkfs_0\n");
4104 if (test_mkfs_0 () == -1) {
4105 printf ("test_mkfs_0 FAILED\n");
4108 printf (" 42/ 49 test_write_file_0\n");
4109 if (test_write_file_0 () == -1) {
4110 printf ("test_write_file_0 FAILED\n");
4113 printf (" 43/ 49 test_umount_0\n");
4114 if (test_umount_0 () == -1) {
4115 printf ("test_umount_0 FAILED\n");
4118 printf (" 44/ 49 test_umount_1\n");
4119 if (test_umount_1 () == -1) {
4120 printf ("test_umount_1 FAILED\n");
4123 printf (" 45/ 49 test_mounts_0\n");
4124 if (test_mounts_0 () == -1) {
4125 printf ("test_mounts_0 FAILED\n");
4128 printf (" 46/ 49 test_umount_all_0\n");
4129 if (test_umount_all_0 () == -1) {
4130 printf ("test_umount_all_0 FAILED\n");
4133 printf (" 47/ 49 test_file_0\n");
4134 if (test_file_0 () == -1) {
4135 printf ("test_file_0 FAILED\n");
4138 printf (" 48/ 49 test_file_1\n");
4139 if (test_file_1 () == -1) {
4140 printf ("test_file_1 FAILED\n");
4143 printf (" 49/ 49 test_file_2\n");
4144 if (test_file_2 () == -1) {
4145 printf ("test_file_2 FAILED\n");
4150 snprintf (buf, sizeof buf, "%s/test1.img", srcdir);
4152 snprintf (buf, sizeof buf, "%s/test2.img", srcdir);
4154 snprintf (buf, sizeof buf, "%s/test3.img", srcdir);
4158 printf ("***** %d / 49 tests FAILED *****\n", failed);