X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=sidebyside;f=capitests%2Ftests.c;h=08f64ee1eadd674e68dae1a9ce9c188ae5f1c301;hb=b2ed0f4c55c2bd3d07341ba2207f0cb238eb4e18;hp=88098f4e509901e13c3e475bc5fb3ea81d0ca1da;hpb=4585b0bbceb3ff73fcf2fbee554000b135297c19;p=libguestfs.git diff --git a/capitests/tests.c b/capitests/tests.c index 88098f4..08f64ee 100644 --- a/capitests/tests.c +++ b/capitests/tests.c @@ -151,6 +151,1554 @@ static void no_test_warnings (void) fprintf (stderr, "warning: \"guestfs_sh\" has no tests\n"); fprintf (stderr, "warning: \"guestfs_sh_lines\" has no tests\n"); fprintf (stderr, "warning: \"guestfs_scrub_freespace\" has no tests\n"); + fprintf (stderr, "warning: \"guestfs_df\" has no tests\n"); + fprintf (stderr, "warning: \"guestfs_df_h\" has no tests\n"); +} + +static int test_tail_n_0_skip (void) +{ + const char *str; + + str = getenv ("TEST_ONLY"); + if (str) + return strstr (str, "tail_n") == NULL; + str = getenv ("SKIP_TEST_TAIL_N_0"); + if (str && strcmp (str, "1") == 0) return 1; + str = getenv ("SKIP_TEST_TAIL_N"); + if (str && strcmp (str, "1") == 0) return 1; + return 0; +} + +static int test_tail_n_0 (void) +{ + if (test_tail_n_0_skip ()) { + printf ("%s skipped (reason: environment variable set)\n", "test_tail_n_0"); + return 0; + } + + /* InitBasicFS for test_tail_n_0: create ext2 on /dev/sda1 */ + { + char device[] = "/dev/sda"; + int r; + suppress_error = 0; + r = guestfs_blockdev_setrw (g, device); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_umount_all (g); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_lvm_remove_all (g); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda"; + char lines_0[] = ","; + char *lines[] = { + lines_0, + NULL + }; + int r; + suppress_error = 0; + r = guestfs_sfdisk (g, device, 0, 0, 0, lines); + if (r == -1) + return -1; + } + { + char fstype[] = "ext2"; + char device[] = "/dev/sda1"; + int r; + suppress_error = 0; + r = guestfs_mkfs (g, fstype, device); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda1"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount (g, device, mountpoint); + if (r == -1) + return -1; + } + /* TestOutputList for tail_n (0) */ + { + char options[] = "ro"; + char vfstype[] = "squashfs"; + char device[] = "/dev/sdd"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount_vfs (g, options, vfstype, device, mountpoint); + if (r == -1) + return -1; + } + { + char path[] = "/10klines"; + char **r; + int i; + suppress_error = 0; + r = guestfs_tail_n (g, 3, path); + if (r == NULL) + return -1; + if (!r[0]) { + fprintf (stderr, "test_tail_n_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "9997abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[0], expected) != 0) { + fprintf (stderr, "test_tail_n_0: expected \"%s\" but got \"%s\"\n", expected, r[0]); + return -1; + } + } + if (!r[1]) { + fprintf (stderr, "test_tail_n_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "9998abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[1], expected) != 0) { + fprintf (stderr, "test_tail_n_0: expected \"%s\" but got \"%s\"\n", expected, r[1]); + return -1; + } + } + if (!r[2]) { + fprintf (stderr, "test_tail_n_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "9999abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[2], expected) != 0) { + fprintf (stderr, "test_tail_n_0: expected \"%s\" but got \"%s\"\n", expected, r[2]); + return -1; + } + } + if (r[3] != NULL) { + fprintf (stderr, "test_tail_n_0: extra elements returned from command\n"); + print_strings (r); + return -1; + } + for (i = 0; r[i] != NULL; ++i) + free (r[i]); + free (r); + } + return 0; +} + +static int test_tail_n_1_skip (void) +{ + const char *str; + + str = getenv ("TEST_ONLY"); + if (str) + return strstr (str, "tail_n") == NULL; + str = getenv ("SKIP_TEST_TAIL_N_1"); + if (str && strcmp (str, "1") == 0) return 1; + str = getenv ("SKIP_TEST_TAIL_N"); + if (str && strcmp (str, "1") == 0) return 1; + return 0; +} + +static int test_tail_n_1 (void) +{ + if (test_tail_n_1_skip ()) { + printf ("%s skipped (reason: environment variable set)\n", "test_tail_n_1"); + return 0; + } + + /* InitBasicFS for test_tail_n_1: create ext2 on /dev/sda1 */ + { + char device[] = "/dev/sda"; + int r; + suppress_error = 0; + r = guestfs_blockdev_setrw (g, device); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_umount_all (g); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_lvm_remove_all (g); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda"; + char lines_0[] = ","; + char *lines[] = { + lines_0, + NULL + }; + int r; + suppress_error = 0; + r = guestfs_sfdisk (g, device, 0, 0, 0, lines); + if (r == -1) + return -1; + } + { + char fstype[] = "ext2"; + char device[] = "/dev/sda1"; + int r; + suppress_error = 0; + r = guestfs_mkfs (g, fstype, device); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda1"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount (g, device, mountpoint); + if (r == -1) + return -1; + } + /* TestOutputList for tail_n (1) */ + { + char options[] = "ro"; + char vfstype[] = "squashfs"; + char device[] = "/dev/sdd"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount_vfs (g, options, vfstype, device, mountpoint); + if (r == -1) + return -1; + } + { + char path[] = "/10klines"; + char **r; + int i; + suppress_error = 0; + r = guestfs_tail_n (g, -9998, path); + if (r == NULL) + return -1; + if (!r[0]) { + fprintf (stderr, "test_tail_n_1: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "9997abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[0], expected) != 0) { + fprintf (stderr, "test_tail_n_1: expected \"%s\" but got \"%s\"\n", expected, r[0]); + return -1; + } + } + if (!r[1]) { + fprintf (stderr, "test_tail_n_1: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "9998abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[1], expected) != 0) { + fprintf (stderr, "test_tail_n_1: expected \"%s\" but got \"%s\"\n", expected, r[1]); + return -1; + } + } + if (!r[2]) { + fprintf (stderr, "test_tail_n_1: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "9999abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[2], expected) != 0) { + fprintf (stderr, "test_tail_n_1: expected \"%s\" but got \"%s\"\n", expected, r[2]); + return -1; + } + } + if (r[3] != NULL) { + fprintf (stderr, "test_tail_n_1: extra elements returned from command\n"); + print_strings (r); + return -1; + } + for (i = 0; r[i] != NULL; ++i) + free (r[i]); + free (r); + } + return 0; +} + +static int test_tail_n_2_skip (void) +{ + const char *str; + + str = getenv ("TEST_ONLY"); + if (str) + return strstr (str, "tail_n") == NULL; + str = getenv ("SKIP_TEST_TAIL_N_2"); + if (str && strcmp (str, "1") == 0) return 1; + str = getenv ("SKIP_TEST_TAIL_N"); + if (str && strcmp (str, "1") == 0) return 1; + return 0; +} + +static int test_tail_n_2 (void) +{ + if (test_tail_n_2_skip ()) { + printf ("%s skipped (reason: environment variable set)\n", "test_tail_n_2"); + return 0; + } + + /* InitBasicFS for test_tail_n_2: create ext2 on /dev/sda1 */ + { + char device[] = "/dev/sda"; + int r; + suppress_error = 0; + r = guestfs_blockdev_setrw (g, device); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_umount_all (g); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_lvm_remove_all (g); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda"; + char lines_0[] = ","; + char *lines[] = { + lines_0, + NULL + }; + int r; + suppress_error = 0; + r = guestfs_sfdisk (g, device, 0, 0, 0, lines); + if (r == -1) + return -1; + } + { + char fstype[] = "ext2"; + char device[] = "/dev/sda1"; + int r; + suppress_error = 0; + r = guestfs_mkfs (g, fstype, device); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda1"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount (g, device, mountpoint); + if (r == -1) + return -1; + } + /* TestOutputList for tail_n (2) */ + { + char options[] = "ro"; + char vfstype[] = "squashfs"; + char device[] = "/dev/sdd"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount_vfs (g, options, vfstype, device, mountpoint); + if (r == -1) + return -1; + } + { + char path[] = "/10klines"; + char **r; + int i; + suppress_error = 0; + r = guestfs_tail_n (g, 0, path); + if (r == NULL) + return -1; + if (r[0] != NULL) { + fprintf (stderr, "test_tail_n_2: extra elements returned from command\n"); + print_strings (r); + return -1; + } + for (i = 0; r[i] != NULL; ++i) + free (r[i]); + free (r); + } + return 0; +} + +static int test_tail_0_skip (void) +{ + const char *str; + + str = getenv ("TEST_ONLY"); + if (str) + return strstr (str, "tail") == NULL; + str = getenv ("SKIP_TEST_TAIL_0"); + if (str && strcmp (str, "1") == 0) return 1; + str = getenv ("SKIP_TEST_TAIL"); + if (str && strcmp (str, "1") == 0) return 1; + return 0; +} + +static int test_tail_0 (void) +{ + if (test_tail_0_skip ()) { + printf ("%s skipped (reason: environment variable set)\n", "test_tail_0"); + return 0; + } + + /* InitBasicFS for test_tail_0: create ext2 on /dev/sda1 */ + { + char device[] = "/dev/sda"; + int r; + suppress_error = 0; + r = guestfs_blockdev_setrw (g, device); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_umount_all (g); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_lvm_remove_all (g); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda"; + char lines_0[] = ","; + char *lines[] = { + lines_0, + NULL + }; + int r; + suppress_error = 0; + r = guestfs_sfdisk (g, device, 0, 0, 0, lines); + if (r == -1) + return -1; + } + { + char fstype[] = "ext2"; + char device[] = "/dev/sda1"; + int r; + suppress_error = 0; + r = guestfs_mkfs (g, fstype, device); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda1"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount (g, device, mountpoint); + if (r == -1) + return -1; + } + /* TestOutputList for tail (0) */ + { + char options[] = "ro"; + char vfstype[] = "squashfs"; + char device[] = "/dev/sdd"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount_vfs (g, options, vfstype, device, mountpoint); + if (r == -1) + return -1; + } + { + char path[] = "/10klines"; + char **r; + int i; + suppress_error = 0; + r = guestfs_tail (g, path); + if (r == NULL) + return -1; + if (!r[0]) { + fprintf (stderr, "test_tail_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "9990abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[0], expected) != 0) { + fprintf (stderr, "test_tail_0: expected \"%s\" but got \"%s\"\n", expected, r[0]); + return -1; + } + } + if (!r[1]) { + fprintf (stderr, "test_tail_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "9991abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[1], expected) != 0) { + fprintf (stderr, "test_tail_0: expected \"%s\" but got \"%s\"\n", expected, r[1]); + return -1; + } + } + if (!r[2]) { + fprintf (stderr, "test_tail_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "9992abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[2], expected) != 0) { + fprintf (stderr, "test_tail_0: expected \"%s\" but got \"%s\"\n", expected, r[2]); + return -1; + } + } + if (!r[3]) { + fprintf (stderr, "test_tail_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "9993abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[3], expected) != 0) { + fprintf (stderr, "test_tail_0: expected \"%s\" but got \"%s\"\n", expected, r[3]); + return -1; + } + } + if (!r[4]) { + fprintf (stderr, "test_tail_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "9994abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[4], expected) != 0) { + fprintf (stderr, "test_tail_0: expected \"%s\" but got \"%s\"\n", expected, r[4]); + return -1; + } + } + if (!r[5]) { + fprintf (stderr, "test_tail_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "9995abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[5], expected) != 0) { + fprintf (stderr, "test_tail_0: expected \"%s\" but got \"%s\"\n", expected, r[5]); + return -1; + } + } + if (!r[6]) { + fprintf (stderr, "test_tail_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "9996abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[6], expected) != 0) { + fprintf (stderr, "test_tail_0: expected \"%s\" but got \"%s\"\n", expected, r[6]); + return -1; + } + } + if (!r[7]) { + fprintf (stderr, "test_tail_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "9997abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[7], expected) != 0) { + fprintf (stderr, "test_tail_0: expected \"%s\" but got \"%s\"\n", expected, r[7]); + return -1; + } + } + if (!r[8]) { + fprintf (stderr, "test_tail_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "9998abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[8], expected) != 0) { + fprintf (stderr, "test_tail_0: expected \"%s\" but got \"%s\"\n", expected, r[8]); + return -1; + } + } + if (!r[9]) { + fprintf (stderr, "test_tail_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "9999abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[9], expected) != 0) { + fprintf (stderr, "test_tail_0: expected \"%s\" but got \"%s\"\n", expected, r[9]); + return -1; + } + } + if (r[10] != NULL) { + fprintf (stderr, "test_tail_0: extra elements returned from command\n"); + print_strings (r); + return -1; + } + for (i = 0; r[i] != NULL; ++i) + free (r[i]); + free (r); + } + return 0; +} + +static int test_head_n_0_skip (void) +{ + const char *str; + + str = getenv ("TEST_ONLY"); + if (str) + return strstr (str, "head_n") == NULL; + str = getenv ("SKIP_TEST_HEAD_N_0"); + if (str && strcmp (str, "1") == 0) return 1; + str = getenv ("SKIP_TEST_HEAD_N"); + if (str && strcmp (str, "1") == 0) return 1; + return 0; +} + +static int test_head_n_0 (void) +{ + if (test_head_n_0_skip ()) { + printf ("%s skipped (reason: environment variable set)\n", "test_head_n_0"); + return 0; + } + + /* InitBasicFS for test_head_n_0: create ext2 on /dev/sda1 */ + { + char device[] = "/dev/sda"; + int r; + suppress_error = 0; + r = guestfs_blockdev_setrw (g, device); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_umount_all (g); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_lvm_remove_all (g); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda"; + char lines_0[] = ","; + char *lines[] = { + lines_0, + NULL + }; + int r; + suppress_error = 0; + r = guestfs_sfdisk (g, device, 0, 0, 0, lines); + if (r == -1) + return -1; + } + { + char fstype[] = "ext2"; + char device[] = "/dev/sda1"; + int r; + suppress_error = 0; + r = guestfs_mkfs (g, fstype, device); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda1"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount (g, device, mountpoint); + if (r == -1) + return -1; + } + /* TestOutputList for head_n (0) */ + { + char options[] = "ro"; + char vfstype[] = "squashfs"; + char device[] = "/dev/sdd"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount_vfs (g, options, vfstype, device, mountpoint); + if (r == -1) + return -1; + } + { + char path[] = "/10klines"; + char **r; + int i; + suppress_error = 0; + r = guestfs_head_n (g, 3, path); + if (r == NULL) + return -1; + if (!r[0]) { + fprintf (stderr, "test_head_n_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "0abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[0], expected) != 0) { + fprintf (stderr, "test_head_n_0: expected \"%s\" but got \"%s\"\n", expected, r[0]); + return -1; + } + } + if (!r[1]) { + fprintf (stderr, "test_head_n_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "1abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[1], expected) != 0) { + fprintf (stderr, "test_head_n_0: expected \"%s\" but got \"%s\"\n", expected, r[1]); + return -1; + } + } + if (!r[2]) { + fprintf (stderr, "test_head_n_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "2abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[2], expected) != 0) { + fprintf (stderr, "test_head_n_0: expected \"%s\" but got \"%s\"\n", expected, r[2]); + return -1; + } + } + if (r[3] != NULL) { + fprintf (stderr, "test_head_n_0: extra elements returned from command\n"); + print_strings (r); + return -1; + } + for (i = 0; r[i] != NULL; ++i) + free (r[i]); + free (r); + } + return 0; +} + +static int test_head_n_1_skip (void) +{ + const char *str; + + str = getenv ("TEST_ONLY"); + if (str) + return strstr (str, "head_n") == NULL; + str = getenv ("SKIP_TEST_HEAD_N_1"); + if (str && strcmp (str, "1") == 0) return 1; + str = getenv ("SKIP_TEST_HEAD_N"); + if (str && strcmp (str, "1") == 0) return 1; + return 0; +} + +static int test_head_n_1 (void) +{ + if (test_head_n_1_skip ()) { + printf ("%s skipped (reason: environment variable set)\n", "test_head_n_1"); + return 0; + } + + /* InitBasicFS for test_head_n_1: create ext2 on /dev/sda1 */ + { + char device[] = "/dev/sda"; + int r; + suppress_error = 0; + r = guestfs_blockdev_setrw (g, device); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_umount_all (g); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_lvm_remove_all (g); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda"; + char lines_0[] = ","; + char *lines[] = { + lines_0, + NULL + }; + int r; + suppress_error = 0; + r = guestfs_sfdisk (g, device, 0, 0, 0, lines); + if (r == -1) + return -1; + } + { + char fstype[] = "ext2"; + char device[] = "/dev/sda1"; + int r; + suppress_error = 0; + r = guestfs_mkfs (g, fstype, device); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda1"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount (g, device, mountpoint); + if (r == -1) + return -1; + } + /* TestOutputList for head_n (1) */ + { + char options[] = "ro"; + char vfstype[] = "squashfs"; + char device[] = "/dev/sdd"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount_vfs (g, options, vfstype, device, mountpoint); + if (r == -1) + return -1; + } + { + char path[] = "/10klines"; + char **r; + int i; + suppress_error = 0; + r = guestfs_head_n (g, -9997, path); + if (r == NULL) + return -1; + if (!r[0]) { + fprintf (stderr, "test_head_n_1: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "0abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[0], expected) != 0) { + fprintf (stderr, "test_head_n_1: expected \"%s\" but got \"%s\"\n", expected, r[0]); + return -1; + } + } + if (!r[1]) { + fprintf (stderr, "test_head_n_1: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "1abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[1], expected) != 0) { + fprintf (stderr, "test_head_n_1: expected \"%s\" but got \"%s\"\n", expected, r[1]); + return -1; + } + } + if (!r[2]) { + fprintf (stderr, "test_head_n_1: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "2abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[2], expected) != 0) { + fprintf (stderr, "test_head_n_1: expected \"%s\" but got \"%s\"\n", expected, r[2]); + return -1; + } + } + if (r[3] != NULL) { + fprintf (stderr, "test_head_n_1: extra elements returned from command\n"); + print_strings (r); + return -1; + } + for (i = 0; r[i] != NULL; ++i) + free (r[i]); + free (r); + } + return 0; +} + +static int test_head_n_2_skip (void) +{ + const char *str; + + str = getenv ("TEST_ONLY"); + if (str) + return strstr (str, "head_n") == NULL; + str = getenv ("SKIP_TEST_HEAD_N_2"); + if (str && strcmp (str, "1") == 0) return 1; + str = getenv ("SKIP_TEST_HEAD_N"); + if (str && strcmp (str, "1") == 0) return 1; + return 0; +} + +static int test_head_n_2 (void) +{ + if (test_head_n_2_skip ()) { + printf ("%s skipped (reason: environment variable set)\n", "test_head_n_2"); + return 0; + } + + /* InitBasicFS for test_head_n_2: create ext2 on /dev/sda1 */ + { + char device[] = "/dev/sda"; + int r; + suppress_error = 0; + r = guestfs_blockdev_setrw (g, device); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_umount_all (g); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_lvm_remove_all (g); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda"; + char lines_0[] = ","; + char *lines[] = { + lines_0, + NULL + }; + int r; + suppress_error = 0; + r = guestfs_sfdisk (g, device, 0, 0, 0, lines); + if (r == -1) + return -1; + } + { + char fstype[] = "ext2"; + char device[] = "/dev/sda1"; + int r; + suppress_error = 0; + r = guestfs_mkfs (g, fstype, device); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda1"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount (g, device, mountpoint); + if (r == -1) + return -1; + } + /* TestOutputList for head_n (2) */ + { + char options[] = "ro"; + char vfstype[] = "squashfs"; + char device[] = "/dev/sdd"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount_vfs (g, options, vfstype, device, mountpoint); + if (r == -1) + return -1; + } + { + char path[] = "/10klines"; + char **r; + int i; + suppress_error = 0; + r = guestfs_head_n (g, 0, path); + if (r == NULL) + return -1; + if (r[0] != NULL) { + fprintf (stderr, "test_head_n_2: extra elements returned from command\n"); + print_strings (r); + return -1; + } + for (i = 0; r[i] != NULL; ++i) + free (r[i]); + free (r); + } + return 0; +} + +static int test_head_0_skip (void) +{ + const char *str; + + str = getenv ("TEST_ONLY"); + if (str) + return strstr (str, "head") == NULL; + str = getenv ("SKIP_TEST_HEAD_0"); + if (str && strcmp (str, "1") == 0) return 1; + str = getenv ("SKIP_TEST_HEAD"); + if (str && strcmp (str, "1") == 0) return 1; + return 0; +} + +static int test_head_0 (void) +{ + if (test_head_0_skip ()) { + printf ("%s skipped (reason: environment variable set)\n", "test_head_0"); + return 0; + } + + /* InitBasicFS for test_head_0: create ext2 on /dev/sda1 */ + { + char device[] = "/dev/sda"; + int r; + suppress_error = 0; + r = guestfs_blockdev_setrw (g, device); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_umount_all (g); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_lvm_remove_all (g); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda"; + char lines_0[] = ","; + char *lines[] = { + lines_0, + NULL + }; + int r; + suppress_error = 0; + r = guestfs_sfdisk (g, device, 0, 0, 0, lines); + if (r == -1) + return -1; + } + { + char fstype[] = "ext2"; + char device[] = "/dev/sda1"; + int r; + suppress_error = 0; + r = guestfs_mkfs (g, fstype, device); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda1"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount (g, device, mountpoint); + if (r == -1) + return -1; + } + /* TestOutputList for head (0) */ + { + char options[] = "ro"; + char vfstype[] = "squashfs"; + char device[] = "/dev/sdd"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount_vfs (g, options, vfstype, device, mountpoint); + if (r == -1) + return -1; + } + { + char path[] = "/10klines"; + char **r; + int i; + suppress_error = 0; + r = guestfs_head (g, path); + if (r == NULL) + return -1; + if (!r[0]) { + fprintf (stderr, "test_head_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "0abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[0], expected) != 0) { + fprintf (stderr, "test_head_0: expected \"%s\" but got \"%s\"\n", expected, r[0]); + return -1; + } + } + if (!r[1]) { + fprintf (stderr, "test_head_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "1abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[1], expected) != 0) { + fprintf (stderr, "test_head_0: expected \"%s\" but got \"%s\"\n", expected, r[1]); + return -1; + } + } + if (!r[2]) { + fprintf (stderr, "test_head_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "2abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[2], expected) != 0) { + fprintf (stderr, "test_head_0: expected \"%s\" but got \"%s\"\n", expected, r[2]); + return -1; + } + } + if (!r[3]) { + fprintf (stderr, "test_head_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "3abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[3], expected) != 0) { + fprintf (stderr, "test_head_0: expected \"%s\" but got \"%s\"\n", expected, r[3]); + return -1; + } + } + if (!r[4]) { + fprintf (stderr, "test_head_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "4abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[4], expected) != 0) { + fprintf (stderr, "test_head_0: expected \"%s\" but got \"%s\"\n", expected, r[4]); + return -1; + } + } + if (!r[5]) { + fprintf (stderr, "test_head_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "5abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[5], expected) != 0) { + fprintf (stderr, "test_head_0: expected \"%s\" but got \"%s\"\n", expected, r[5]); + return -1; + } + } + if (!r[6]) { + fprintf (stderr, "test_head_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "6abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[6], expected) != 0) { + fprintf (stderr, "test_head_0: expected \"%s\" but got \"%s\"\n", expected, r[6]); + return -1; + } + } + if (!r[7]) { + fprintf (stderr, "test_head_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "7abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[7], expected) != 0) { + fprintf (stderr, "test_head_0: expected \"%s\" but got \"%s\"\n", expected, r[7]); + return -1; + } + } + if (!r[8]) { + fprintf (stderr, "test_head_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "8abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[8], expected) != 0) { + fprintf (stderr, "test_head_0: expected \"%s\" but got \"%s\"\n", expected, r[8]); + return -1; + } + } + if (!r[9]) { + fprintf (stderr, "test_head_0: short list returned from command\n"); + print_strings (r); + return -1; + } + { + char expected[] = "9abcdefghijklmnopqrstuvwxyz"; + if (strcmp (r[9], expected) != 0) { + fprintf (stderr, "test_head_0: expected \"%s\" but got \"%s\"\n", expected, r[9]); + return -1; + } + } + if (r[10] != NULL) { + fprintf (stderr, "test_head_0: extra elements returned from command\n"); + print_strings (r); + return -1; + } + for (i = 0; r[i] != NULL; ++i) + free (r[i]); + free (r); + } + return 0; +} + +static int test_wc_c_0_skip (void) +{ + const char *str; + + str = getenv ("TEST_ONLY"); + if (str) + return strstr (str, "wc_c") == NULL; + str = getenv ("SKIP_TEST_WC_C_0"); + if (str && strcmp (str, "1") == 0) return 1; + str = getenv ("SKIP_TEST_WC_C"); + if (str && strcmp (str, "1") == 0) return 1; + return 0; +} + +static int test_wc_c_0 (void) +{ + if (test_wc_c_0_skip ()) { + printf ("%s skipped (reason: environment variable set)\n", "test_wc_c_0"); + return 0; + } + + /* InitBasicFS for test_wc_c_0: create ext2 on /dev/sda1 */ + { + char device[] = "/dev/sda"; + int r; + suppress_error = 0; + r = guestfs_blockdev_setrw (g, device); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_umount_all (g); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_lvm_remove_all (g); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda"; + char lines_0[] = ","; + char *lines[] = { + lines_0, + NULL + }; + int r; + suppress_error = 0; + r = guestfs_sfdisk (g, device, 0, 0, 0, lines); + if (r == -1) + return -1; + } + { + char fstype[] = "ext2"; + char device[] = "/dev/sda1"; + int r; + suppress_error = 0; + r = guestfs_mkfs (g, fstype, device); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda1"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount (g, device, mountpoint); + if (r == -1) + return -1; + } + /* TestOutputInt for wc_c (0) */ + { + char options[] = "ro"; + char vfstype[] = "squashfs"; + char device[] = "/dev/sdd"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount_vfs (g, options, vfstype, device, mountpoint); + if (r == -1) + return -1; + } + { + char path[] = "/100kallspaces"; + int r; + suppress_error = 0; + r = guestfs_wc_c (g, path); + if (r == -1) + return -1; + if (r != 102400) { + fprintf (stderr, "test_wc_c_0: expected 102400 but got %d\n", (int) r); + return -1; + } + } + return 0; +} + +static int test_wc_w_0_skip (void) +{ + const char *str; + + str = getenv ("TEST_ONLY"); + if (str) + return strstr (str, "wc_w") == NULL; + str = getenv ("SKIP_TEST_WC_W_0"); + if (str && strcmp (str, "1") == 0) return 1; + str = getenv ("SKIP_TEST_WC_W"); + if (str && strcmp (str, "1") == 0) return 1; + return 0; +} + +static int test_wc_w_0 (void) +{ + if (test_wc_w_0_skip ()) { + printf ("%s skipped (reason: environment variable set)\n", "test_wc_w_0"); + return 0; + } + + /* InitBasicFS for test_wc_w_0: create ext2 on /dev/sda1 */ + { + char device[] = "/dev/sda"; + int r; + suppress_error = 0; + r = guestfs_blockdev_setrw (g, device); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_umount_all (g); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_lvm_remove_all (g); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda"; + char lines_0[] = ","; + char *lines[] = { + lines_0, + NULL + }; + int r; + suppress_error = 0; + r = guestfs_sfdisk (g, device, 0, 0, 0, lines); + if (r == -1) + return -1; + } + { + char fstype[] = "ext2"; + char device[] = "/dev/sda1"; + int r; + suppress_error = 0; + r = guestfs_mkfs (g, fstype, device); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda1"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount (g, device, mountpoint); + if (r == -1) + return -1; + } + /* TestOutputInt for wc_w (0) */ + { + char options[] = "ro"; + char vfstype[] = "squashfs"; + char device[] = "/dev/sdd"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount_vfs (g, options, vfstype, device, mountpoint); + if (r == -1) + return -1; + } + { + char path[] = "/10klines"; + int r; + suppress_error = 0; + r = guestfs_wc_w (g, path); + if (r == -1) + return -1; + if (r != 10000) { + fprintf (stderr, "test_wc_w_0: expected 10000 but got %d\n", (int) r); + return -1; + } + } + return 0; +} + +static int test_wc_l_0_skip (void) +{ + const char *str; + + str = getenv ("TEST_ONLY"); + if (str) + return strstr (str, "wc_l") == NULL; + str = getenv ("SKIP_TEST_WC_L_0"); + if (str && strcmp (str, "1") == 0) return 1; + str = getenv ("SKIP_TEST_WC_L"); + if (str && strcmp (str, "1") == 0) return 1; + return 0; +} + +static int test_wc_l_0 (void) +{ + if (test_wc_l_0_skip ()) { + printf ("%s skipped (reason: environment variable set)\n", "test_wc_l_0"); + return 0; + } + + /* InitBasicFS for test_wc_l_0: create ext2 on /dev/sda1 */ + { + char device[] = "/dev/sda"; + int r; + suppress_error = 0; + r = guestfs_blockdev_setrw (g, device); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_umount_all (g); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_lvm_remove_all (g); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda"; + char lines_0[] = ","; + char *lines[] = { + lines_0, + NULL + }; + int r; + suppress_error = 0; + r = guestfs_sfdisk (g, device, 0, 0, 0, lines); + if (r == -1) + return -1; + } + { + char fstype[] = "ext2"; + char device[] = "/dev/sda1"; + int r; + suppress_error = 0; + r = guestfs_mkfs (g, fstype, device); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda1"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount (g, device, mountpoint); + if (r == -1) + return -1; + } + /* TestOutputInt for wc_l (0) */ + { + char options[] = "ro"; + char vfstype[] = "squashfs"; + char device[] = "/dev/sdd"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount_vfs (g, options, vfstype, device, mountpoint); + if (r == -1) + return -1; + } + { + char path[] = "/10klines"; + int r; + suppress_error = 0; + r = guestfs_wc_l (g, path); + if (r == -1) + return -1; + if (r != 10000) { + fprintf (stderr, "test_wc_l_0: expected 10000 but got %d\n", (int) r); + return -1; + } + } + return 0; } static int test_mkdtemp_0_skip (void) @@ -170,7 +1718,7 @@ static int test_mkdtemp_0_skip (void) static int test_mkdtemp_0 (void) { if (test_mkdtemp_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_mkdtemp_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_mkdtemp_0"); return 0; } @@ -266,7 +1814,7 @@ static int test_scrub_file_0_skip (void) static int test_scrub_file_0 (void) { if (test_scrub_file_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_scrub_file_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_scrub_file_0"); return 0; } @@ -362,7 +1910,7 @@ static int test_scrub_device_0_skip (void) static int test_scrub_device_0 (void) { if (test_scrub_device_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_scrub_device_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_scrub_device_0"); return 0; } @@ -418,7 +1966,7 @@ static int test_glob_expand_0_skip (void) static int test_glob_expand_0 (void) { if (test_glob_expand_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_glob_expand_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_glob_expand_0"); return 0; } @@ -562,7 +2110,7 @@ static int test_glob_expand_1_skip (void) static int test_glob_expand_1 (void) { if (test_glob_expand_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_glob_expand_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_glob_expand_1"); return 0; } @@ -706,7 +2254,7 @@ static int test_glob_expand_2_skip (void) static int test_glob_expand_2 (void) { if (test_glob_expand_2_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_glob_expand_2"); + printf ("%s skipped (reason: environment variable set)\n", "test_glob_expand_2"); return 0; } @@ -826,7 +2374,7 @@ static int test_ntfs_3g_probe_0_skip (void) static int test_ntfs_3g_probe_0 (void) { if (test_ntfs_3g_probe_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_ntfs_3g_probe_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_ntfs_3g_probe_0"); return 0; } @@ -908,7 +2456,7 @@ static int test_ntfs_3g_probe_1_skip (void) static int test_ntfs_3g_probe_1 (void) { if (test_ntfs_3g_probe_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_ntfs_3g_probe_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_ntfs_3g_probe_1"); return 0; } @@ -990,7 +2538,7 @@ static int test_sleep_0_skip (void) static int test_sleep_0 (void) { if (test_sleep_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_sleep_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_sleep_0"); return 0; } @@ -1045,7 +2593,7 @@ static int test_find_0_skip (void) static int test_find_0 (void) { if (test_find_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_find_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_find_0"); return 0; } @@ -1153,7 +2701,7 @@ static int test_find_1_skip (void) static int test_find_1 (void) { if (test_find_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_find_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_find_1"); return 0; } @@ -1321,7 +2869,7 @@ static int test_find_2_skip (void) static int test_find_2 (void) { if (test_find_2_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_find_2"); + printf ("%s skipped (reason: environment variable set)\n", "test_find_2"); return 0; } @@ -1457,7 +3005,7 @@ static int test_lvresize_0_skip (void) static int test_lvresize_0 (void) { if (test_lvresize_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_lvresize_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_lvresize_0"); return 0; } @@ -1630,7 +3178,7 @@ static int test_zerofree_0_skip (void) static int test_zerofree_0 (void) { if (test_zerofree_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_zerofree_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_zerofree_0"); return 0; } @@ -1757,7 +3305,7 @@ static int test_hexdump_0_skip (void) static int test_hexdump_0 (void) { if (test_hexdump_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_hexdump_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_hexdump_0"); return 0; } @@ -1859,7 +3407,7 @@ static int test_hexdump_1_skip (void) static int test_hexdump_1 (void) { if (test_hexdump_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_hexdump_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_hexdump_1"); return 0; } @@ -1958,7 +3506,7 @@ static int test_strings_e_0_skip (void) static int test_strings_e_0 (void) { if (test_strings_e_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_strings_e_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_strings_e_0"); return 0; } @@ -2064,7 +3612,7 @@ static int test_strings_e_1_skip (void) static int test_strings_e_1 (void) { if (test_strings_e_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_strings_e_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_strings_e_1"); return 0; } @@ -2089,7 +3637,7 @@ static int test_strings_0_skip (void) static int test_strings_0 (void) { if (test_strings_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_strings_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_strings_0"); return 0; } @@ -2218,7 +3766,7 @@ static int test_strings_1_skip (void) static int test_strings_1 (void) { if (test_strings_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_strings_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_strings_1"); return 0; } @@ -2322,7 +3870,7 @@ static int test_equal_0_skip (void) static int test_equal_0 (void) { if (test_equal_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_equal_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_equal_0"); return 0; } @@ -2432,7 +3980,7 @@ static int test_equal_1_skip (void) static int test_equal_1 (void) { if (test_equal_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_equal_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_equal_1"); return 0; } @@ -2542,7 +4090,7 @@ static int test_equal_2_skip (void) static int test_equal_2 (void) { if (test_equal_2_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_equal_2"); + printf ("%s skipped (reason: environment variable set)\n", "test_equal_2"); return 0; } @@ -2630,7 +4178,7 @@ static int test_ping_daemon_0_skip (void) static int test_ping_daemon_0 (void) { if (test_ping_daemon_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_ping_daemon_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_ping_daemon_0"); return 0; } @@ -2685,7 +4233,7 @@ static int test_dmesg_0_skip (void) static int test_dmesg_0 (void) { if (test_dmesg_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_dmesg_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_dmesg_0"); return 0; } @@ -2741,7 +4289,7 @@ static int test_drop_caches_0_skip (void) static int test_drop_caches_0 (void) { if (test_drop_caches_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_drop_caches_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_drop_caches_0"); return 0; } @@ -2796,7 +4344,7 @@ static int test_mv_0_skip (void) static int test_mv_0 (void) { if (test_mv_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_mv_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_mv_0"); return 0; } @@ -2907,7 +4455,7 @@ static int test_mv_1_skip (void) static int test_mv_1 (void) { if (test_mv_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_mv_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_mv_1"); return 0; } @@ -3016,7 +4564,7 @@ static int test_cp_a_0_skip (void) static int test_cp_a_0 (void) { if (test_cp_a_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_cp_a_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_cp_a_0"); return 0; } @@ -3143,7 +4691,7 @@ static int test_cp_0_skip (void) static int test_cp_0 (void) { if (test_cp_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_cp_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_cp_0"); return 0; } @@ -3254,7 +4802,7 @@ static int test_cp_1_skip (void) static int test_cp_1 (void) { if (test_cp_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_cp_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_cp_1"); return 0; } @@ -3363,7 +4911,7 @@ static int test_cp_2_skip (void) static int test_cp_2 (void) { if (test_cp_2_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_cp_2"); + printf ("%s skipped (reason: environment variable set)\n", "test_cp_2"); return 0; } @@ -3482,7 +5030,7 @@ static int test_grub_install_0_skip (void) static int test_grub_install_0 (void) { if (test_grub_install_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_grub_install_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_grub_install_0"); return 0; } @@ -3582,7 +5130,7 @@ static int test_zero_0_skip (void) static int test_zero_0 (void) { if (test_zero_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_zero_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_zero_0"); return 0; } @@ -3691,7 +5239,7 @@ static int test_fsck_0_skip (void) static int test_fsck_0 (void) { if (test_fsck_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_fsck_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_fsck_0"); return 0; } @@ -3791,7 +5339,7 @@ static int test_fsck_1_skip (void) static int test_fsck_1 (void) { if (test_fsck_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_fsck_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_fsck_1"); return 0; } @@ -3899,7 +5447,7 @@ static int test_set_e2uuid_0_skip (void) static int test_set_e2uuid_0 (void) { if (test_set_e2uuid_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_set_e2uuid_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_set_e2uuid_0"); return 0; } @@ -4001,7 +5549,7 @@ static int test_set_e2uuid_1_skip (void) static int test_set_e2uuid_1 (void) { if (test_set_e2uuid_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_set_e2uuid_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_set_e2uuid_1"); return 0; } @@ -4103,7 +5651,7 @@ static int test_set_e2uuid_2_skip (void) static int test_set_e2uuid_2 (void) { if (test_set_e2uuid_2_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_set_e2uuid_2"); + printf ("%s skipped (reason: environment variable set)\n", "test_set_e2uuid_2"); return 0; } @@ -4191,7 +5739,7 @@ static int test_set_e2uuid_3_skip (void) static int test_set_e2uuid_3 (void) { if (test_set_e2uuid_3_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_set_e2uuid_3"); + printf ("%s skipped (reason: environment variable set)\n", "test_set_e2uuid_3"); return 0; } @@ -4279,7 +5827,7 @@ static int test_set_e2label_0_skip (void) static int test_set_e2label_0 (void) { if (test_set_e2label_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_set_e2label_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_set_e2label_0"); return 0; } @@ -4381,7 +5929,7 @@ static int test_pvremove_0_skip (void) static int test_pvremove_0 (void) { if (test_pvremove_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_pvremove_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_pvremove_0"); return 0; } @@ -4513,7 +6061,7 @@ static int test_pvremove_1_skip (void) static int test_pvremove_1 (void) { if (test_pvremove_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_pvremove_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_pvremove_1"); return 0; } @@ -4645,7 +6193,7 @@ static int test_pvremove_2_skip (void) static int test_pvremove_2 (void) { if (test_pvremove_2_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_pvremove_2"); + printf ("%s skipped (reason: environment variable set)\n", "test_pvremove_2"); return 0; } @@ -4777,7 +6325,7 @@ static int test_vgremove_0_skip (void) static int test_vgremove_0 (void) { if (test_vgremove_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_vgremove_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_vgremove_0"); return 0; } @@ -4901,7 +6449,7 @@ static int test_vgremove_1_skip (void) static int test_vgremove_1 (void) { if (test_vgremove_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_vgremove_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_vgremove_1"); return 0; } @@ -5025,7 +6573,7 @@ static int test_lvremove_0_skip (void) static int test_lvremove_0 (void) { if (test_lvremove_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_lvremove_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_lvremove_0"); return 0; } @@ -5161,7 +6709,7 @@ static int test_lvremove_1_skip (void) static int test_lvremove_1 (void) { if (test_lvremove_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_lvremove_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_lvremove_1"); return 0; } @@ -5285,7 +6833,7 @@ static int test_lvremove_2_skip (void) static int test_lvremove_2 (void) { if (test_lvremove_2_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_lvremove_2"); + printf ("%s skipped (reason: environment variable set)\n", "test_lvremove_2"); return 0; } @@ -5421,7 +6969,7 @@ static int test_mount_ro_0_skip (void) static int test_mount_ro_0 (void) { if (test_mount_ro_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_mount_ro_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_mount_ro_0"); return 0; } @@ -5525,7 +7073,7 @@ static int test_mount_ro_1_skip (void) static int test_mount_ro_1 (void) { if (test_mount_ro_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_mount_ro_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_mount_ro_1"); return 0; } @@ -5644,7 +7192,7 @@ static int test_tgz_in_0_skip (void) static int test_tgz_in_0 (void) { if (test_tgz_in_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_tgz_in_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_tgz_in_0"); return 0; } @@ -5745,7 +7293,7 @@ static int test_tar_in_0_skip (void) static int test_tar_in_0 (void) { if (test_tar_in_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_tar_in_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_tar_in_0"); return 0; } @@ -5846,7 +7394,7 @@ static int test_checksum_0_skip (void) static int test_checksum_0 (void) { if (test_checksum_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_checksum_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_checksum_0"); return 0; } @@ -5949,7 +7497,7 @@ static int test_checksum_1_skip (void) static int test_checksum_1 (void) { if (test_checksum_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_checksum_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_checksum_1"); return 0; } @@ -6038,7 +7586,7 @@ static int test_checksum_2_skip (void) static int test_checksum_2 (void) { if (test_checksum_2_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_checksum_2"); + printf ("%s skipped (reason: environment variable set)\n", "test_checksum_2"); return 0; } @@ -6141,7 +7689,7 @@ static int test_checksum_3_skip (void) static int test_checksum_3 (void) { if (test_checksum_3_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_checksum_3"); + printf ("%s skipped (reason: environment variable set)\n", "test_checksum_3"); return 0; } @@ -6244,7 +7792,7 @@ static int test_checksum_4_skip (void) static int test_checksum_4 (void) { if (test_checksum_4_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_checksum_4"); + printf ("%s skipped (reason: environment variable set)\n", "test_checksum_4"); return 0; } @@ -6347,7 +7895,7 @@ static int test_checksum_5_skip (void) static int test_checksum_5 (void) { if (test_checksum_5_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_checksum_5"); + printf ("%s skipped (reason: environment variable set)\n", "test_checksum_5"); return 0; } @@ -6450,7 +7998,7 @@ static int test_checksum_6_skip (void) static int test_checksum_6 (void) { if (test_checksum_6_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_checksum_6"); + printf ("%s skipped (reason: environment variable set)\n", "test_checksum_6"); return 0; } @@ -6553,7 +8101,7 @@ static int test_checksum_7_skip (void) static int test_checksum_7 (void) { if (test_checksum_7_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_checksum_7"); + printf ("%s skipped (reason: environment variable set)\n", "test_checksum_7"); return 0; } @@ -6656,7 +8204,7 @@ static int test_checksum_8_skip (void) static int test_checksum_8 (void) { if (test_checksum_8_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_checksum_8"); + printf ("%s skipped (reason: environment variable set)\n", "test_checksum_8"); return 0; } @@ -6761,7 +8309,7 @@ static int test_download_0_skip (void) static int test_download_0 (void) { if (test_download_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_download_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_download_0"); return 0; } @@ -6879,7 +8427,7 @@ static int test_upload_0_skip (void) static int test_upload_0 (void) { if (test_upload_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_upload_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_upload_0"); return 0; } @@ -6981,7 +8529,7 @@ static int test_blockdev_rereadpt_0_skip (void) static int test_blockdev_rereadpt_0 (void) { if (test_blockdev_rereadpt_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_blockdev_rereadpt_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_blockdev_rereadpt_0"); return 0; } @@ -7037,7 +8585,7 @@ static int test_blockdev_flushbufs_0_skip (void) static int test_blockdev_flushbufs_0 (void) { if (test_blockdev_flushbufs_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_blockdev_flushbufs_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_blockdev_flushbufs_0"); return 0; } @@ -7093,7 +8641,7 @@ static int test_blockdev_getsize64_0_skip (void) static int test_blockdev_getsize64_0 (void) { if (test_blockdev_getsize64_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_blockdev_getsize64_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_blockdev_getsize64_0"); return 0; } @@ -7153,7 +8701,7 @@ static int test_blockdev_getsz_0_skip (void) static int test_blockdev_getsz_0 (void) { if (test_blockdev_getsz_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_blockdev_getsz_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_blockdev_getsz_0"); return 0; } @@ -7213,7 +8761,7 @@ static int test_blockdev_getbsz_0_skip (void) static int test_blockdev_getbsz_0 (void) { if (test_blockdev_getbsz_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_blockdev_getbsz_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_blockdev_getbsz_0"); return 0; } @@ -7273,7 +8821,7 @@ static int test_blockdev_getss_0_skip (void) static int test_blockdev_getss_0 (void) { if (test_blockdev_getss_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_blockdev_getss_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_blockdev_getss_0"); return 0; } @@ -7333,7 +8881,7 @@ static int test_blockdev_getro_0_skip (void) static int test_blockdev_getro_0 (void) { if (test_blockdev_getro_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_blockdev_getro_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_blockdev_getro_0"); return 0; } @@ -7401,7 +8949,7 @@ static int test_blockdev_setrw_0_skip (void) static int test_blockdev_setrw_0 (void) { if (test_blockdev_setrw_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_blockdev_setrw_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_blockdev_setrw_0"); return 0; } @@ -7469,7 +9017,7 @@ static int test_blockdev_setro_0_skip (void) static int test_blockdev_setro_0 (void) { if (test_blockdev_setro_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_blockdev_setro_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_blockdev_setro_0"); return 0; } @@ -7537,7 +9085,7 @@ static int test_statvfs_0_skip (void) static int test_statvfs_0 (void) { if (test_statvfs_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_statvfs_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_statvfs_0"); return 0; } @@ -7640,7 +9188,7 @@ static int test_lstat_0_skip (void) static int test_lstat_0 (void) { if (test_lstat_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_lstat_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_lstat_0"); return 0; } @@ -7741,7 +9289,7 @@ static int test_stat_0_skip (void) static int test_stat_0 (void) { if (test_stat_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_stat_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_stat_0"); return 0; } @@ -7842,7 +9390,7 @@ static int test_command_lines_0_skip (void) static int test_command_lines_0 (void) { if (test_command_lines_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_lines_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_lines_0"); return 0; } @@ -7972,7 +9520,7 @@ static int test_command_lines_1_skip (void) static int test_command_lines_1 (void) { if (test_command_lines_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_lines_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_lines_1"); return 0; } @@ -8102,7 +9650,7 @@ static int test_command_lines_2_skip (void) static int test_command_lines_2 (void) { if (test_command_lines_2_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_lines_2"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_lines_2"); return 0; } @@ -8244,7 +9792,7 @@ static int test_command_lines_3_skip (void) static int test_command_lines_3 (void) { if (test_command_lines_3_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_lines_3"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_lines_3"); return 0; } @@ -8386,7 +9934,7 @@ static int test_command_lines_4_skip (void) static int test_command_lines_4 (void) { if (test_command_lines_4_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_lines_4"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_lines_4"); return 0; } @@ -8540,7 +10088,7 @@ static int test_command_lines_5_skip (void) static int test_command_lines_5 (void) { if (test_command_lines_5_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_lines_5"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_lines_5"); return 0; } @@ -8706,7 +10254,7 @@ static int test_command_lines_6_skip (void) static int test_command_lines_6 (void) { if (test_command_lines_6_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_lines_6"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_lines_6"); return 0; } @@ -8824,7 +10372,7 @@ static int test_command_lines_7_skip (void) static int test_command_lines_7 (void) { if (test_command_lines_7_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_lines_7"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_lines_7"); return 0; } @@ -8954,7 +10502,7 @@ static int test_command_lines_8_skip (void) static int test_command_lines_8 (void) { if (test_command_lines_8_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_lines_8"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_lines_8"); return 0; } @@ -9096,7 +10644,7 @@ static int test_command_lines_9_skip (void) static int test_command_lines_9 (void) { if (test_command_lines_9_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_lines_9"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_lines_9"); return 0; } @@ -9238,7 +10786,7 @@ static int test_command_lines_10_skip (void) static int test_command_lines_10 (void) { if (test_command_lines_10_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_lines_10"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_lines_10"); return 0; } @@ -9380,7 +10928,7 @@ static int test_command_0_skip (void) static int test_command_0 (void) { if (test_command_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_0"); return 0; } @@ -9495,7 +11043,7 @@ static int test_command_1_skip (void) static int test_command_1 (void) { if (test_command_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_1"); return 0; } @@ -9610,7 +11158,7 @@ static int test_command_2_skip (void) static int test_command_2 (void) { if (test_command_2_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_2"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_2"); return 0; } @@ -9725,7 +11273,7 @@ static int test_command_3_skip (void) static int test_command_3 (void) { if (test_command_3_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_3"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_3"); return 0; } @@ -9840,7 +11388,7 @@ static int test_command_4_skip (void) static int test_command_4 (void) { if (test_command_4_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_4"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_4"); return 0; } @@ -9955,7 +11503,7 @@ static int test_command_5_skip (void) static int test_command_5 (void) { if (test_command_5_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_5"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_5"); return 0; } @@ -10070,7 +11618,7 @@ static int test_command_6_skip (void) static int test_command_6 (void) { if (test_command_6_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_6"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_6"); return 0; } @@ -10185,7 +11733,7 @@ static int test_command_7_skip (void) static int test_command_7 (void) { if (test_command_7_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_7"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_7"); return 0; } @@ -10300,7 +11848,7 @@ static int test_command_8_skip (void) static int test_command_8 (void) { if (test_command_8_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_8"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_8"); return 0; } @@ -10415,7 +11963,7 @@ static int test_command_9_skip (void) static int test_command_9 (void) { if (test_command_9_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_9"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_9"); return 0; } @@ -10530,7 +12078,7 @@ static int test_command_10_skip (void) static int test_command_10 (void) { if (test_command_10_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_10"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_10"); return 0; } @@ -10645,7 +12193,7 @@ static int test_command_11_skip (void) static int test_command_11 (void) { if (test_command_11_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_command_11"); + printf ("%s skipped (reason: environment variable set)\n", "test_command_11"); return 0; } @@ -10753,7 +12301,7 @@ static int test_file_0_skip (void) static int test_file_0 (void) { if (test_file_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_file_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_file_0"); return 0; } @@ -10854,7 +12402,7 @@ static int test_file_1_skip (void) static int test_file_1 (void) { if (test_file_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_file_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_file_1"); return 0; } @@ -10956,7 +12504,7 @@ static int test_file_2_skip (void) static int test_file_2 (void) { if (test_file_2_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_file_2"); + printf ("%s skipped (reason: environment variable set)\n", "test_file_2"); return 0; } @@ -11044,7 +12592,7 @@ static int test_umount_all_0_skip (void) static int test_umount_all_0 (void) { if (test_umount_all_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_umount_all_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_umount_all_0"); return 0; } @@ -11146,7 +12694,7 @@ static int test_umount_all_1_skip (void) static int test_umount_all_1 (void) { if (test_umount_all_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_umount_all_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_umount_all_1"); return 0; } @@ -11312,7 +12860,7 @@ static int test_mounts_0_skip (void) static int test_mounts_0 (void) { if (test_mounts_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_mounts_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_mounts_0"); return 0; } @@ -11420,7 +12968,7 @@ static int test_umount_0_skip (void) static int test_umount_0 (void) { if (test_umount_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_umount_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_umount_0"); return 0; } @@ -11528,7 +13076,7 @@ static int test_umount_1_skip (void) static int test_umount_1 (void) { if (test_umount_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_umount_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_umount_1"); return 0; } @@ -11631,7 +13179,7 @@ static int test_write_file_0_skip (void) static int test_write_file_0 (void) { if (test_write_file_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_write_file_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_write_file_0"); return 0; } @@ -11733,7 +13281,7 @@ static int test_write_file_1_skip (void) static int test_write_file_1 (void) { if (test_write_file_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_write_file_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_write_file_1"); return 0; } @@ -11835,7 +13383,7 @@ static int test_write_file_2_skip (void) static int test_write_file_2 (void) { if (test_write_file_2_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_write_file_2"); + printf ("%s skipped (reason: environment variable set)\n", "test_write_file_2"); return 0; } @@ -11937,7 +13485,7 @@ static int test_write_file_3_skip (void) static int test_write_file_3 (void) { if (test_write_file_3_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_write_file_3"); + printf ("%s skipped (reason: environment variable set)\n", "test_write_file_3"); return 0; } @@ -12039,7 +13587,7 @@ static int test_write_file_4_skip (void) static int test_write_file_4 (void) { if (test_write_file_4_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_write_file_4"); + printf ("%s skipped (reason: environment variable set)\n", "test_write_file_4"); return 0; } @@ -12141,7 +13689,7 @@ static int test_write_file_5_skip (void) static int test_write_file_5 (void) { if (test_write_file_5_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_write_file_5"); + printf ("%s skipped (reason: environment variable set)\n", "test_write_file_5"); return 0; } @@ -12243,7 +13791,7 @@ static int test_mkfs_0_skip (void) static int test_mkfs_0 (void) { if (test_mkfs_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_mkfs_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_mkfs_0"); return 0; } @@ -12345,7 +13893,7 @@ static int test_lvcreate_0_skip (void) static int test_lvcreate_0 (void) { if (test_lvcreate_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_lvcreate_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_lvcreate_0"); return 0; } @@ -12583,7 +14131,7 @@ static int test_vgcreate_0_skip (void) static int test_vgcreate_0 (void) { if (test_vgcreate_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_vgcreate_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_vgcreate_0"); return 0; } @@ -12740,7 +14288,7 @@ static int test_pvcreate_0_skip (void) static int test_pvcreate_0 (void) { if (test_pvcreate_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_pvcreate_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_pvcreate_0"); return 0; } @@ -12884,7 +14432,7 @@ static int test_is_dir_0_skip (void) static int test_is_dir_0 (void) { if (test_is_dir_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_is_dir_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_is_dir_0"); return 0; } @@ -12983,7 +14531,7 @@ static int test_is_dir_1_skip (void) static int test_is_dir_1 (void) { if (test_is_dir_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_is_dir_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_is_dir_1"); return 0; } @@ -13082,7 +14630,7 @@ static int test_is_file_0_skip (void) static int test_is_file_0 (void) { if (test_is_file_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_is_file_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_is_file_0"); return 0; } @@ -13181,7 +14729,7 @@ static int test_is_file_1_skip (void) static int test_is_file_1 (void) { if (test_is_file_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_is_file_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_is_file_1"); return 0; } @@ -13280,7 +14828,7 @@ static int test_exists_0_skip (void) static int test_exists_0 (void) { if (test_exists_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_exists_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_exists_0"); return 0; } @@ -13379,7 +14927,7 @@ static int test_exists_1_skip (void) static int test_exists_1 (void) { if (test_exists_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_exists_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_exists_1"); return 0; } @@ -13478,7 +15026,7 @@ static int test_mkdir_p_0_skip (void) static int test_mkdir_p_0 (void) { if (test_mkdir_p_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_mkdir_p_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_mkdir_p_0"); return 0; } @@ -13577,7 +15125,7 @@ static int test_mkdir_p_1_skip (void) static int test_mkdir_p_1 (void) { if (test_mkdir_p_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_mkdir_p_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_mkdir_p_1"); return 0; } @@ -13676,7 +15224,7 @@ static int test_mkdir_p_2_skip (void) static int test_mkdir_p_2 (void) { if (test_mkdir_p_2_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_mkdir_p_2"); + printf ("%s skipped (reason: environment variable set)\n", "test_mkdir_p_2"); return 0; } @@ -13775,7 +15323,7 @@ static int test_mkdir_p_3_skip (void) static int test_mkdir_p_3 (void) { if (test_mkdir_p_3_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_mkdir_p_3"); + printf ("%s skipped (reason: environment variable set)\n", "test_mkdir_p_3"); return 0; } @@ -13870,7 +15418,7 @@ static int test_mkdir_p_4_skip (void) static int test_mkdir_p_4 (void) { if (test_mkdir_p_4_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_mkdir_p_4"); + printf ("%s skipped (reason: environment variable set)\n", "test_mkdir_p_4"); return 0; } @@ -13965,7 +15513,7 @@ static int test_mkdir_0_skip (void) static int test_mkdir_0 (void) { if (test_mkdir_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_mkdir_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_mkdir_0"); return 0; } @@ -14064,7 +15612,7 @@ static int test_mkdir_1_skip (void) static int test_mkdir_1 (void) { if (test_mkdir_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_mkdir_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_mkdir_1"); return 0; } @@ -14151,7 +15699,7 @@ static int test_rm_rf_0_skip (void) static int test_rm_rf_0 (void) { if (test_rm_rf_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_rm_rf_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_rm_rf_0"); return 0; } @@ -14274,7 +15822,7 @@ static int test_rmdir_0_skip (void) static int test_rmdir_0 (void) { if (test_rmdir_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_rmdir_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_rmdir_0"); return 0; } @@ -14369,7 +15917,7 @@ static int test_rmdir_1_skip (void) static int test_rmdir_1 (void) { if (test_rmdir_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_rmdir_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_rmdir_1"); return 0; } @@ -14456,7 +16004,7 @@ static int test_rmdir_2_skip (void) static int test_rmdir_2 (void) { if (test_rmdir_2_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_rmdir_2"); + printf ("%s skipped (reason: environment variable set)\n", "test_rmdir_2"); return 0; } @@ -14551,7 +16099,7 @@ static int test_rm_0_skip (void) static int test_rm_0 (void) { if (test_rm_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_rm_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_rm_0"); return 0; } @@ -14646,7 +16194,7 @@ static int test_rm_1_skip (void) static int test_rm_1 (void) { if (test_rm_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_rm_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_rm_1"); return 0; } @@ -14733,7 +16281,7 @@ static int test_rm_2_skip (void) static int test_rm_2 (void) { if (test_rm_2_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_rm_2"); + printf ("%s skipped (reason: environment variable set)\n", "test_rm_2"); return 0; } @@ -14828,7 +16376,7 @@ static int test_read_lines_0_skip (void) static int test_read_lines_0 (void) { if (test_read_lines_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_read_lines_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_read_lines_0"); return 0; } @@ -14969,7 +16517,7 @@ static int test_read_lines_1_skip (void) static int test_read_lines_1 (void) { if (test_read_lines_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_read_lines_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_read_lines_1"); return 0; } @@ -15074,7 +16622,7 @@ static int test_lvs_0_skip (void) static int test_lvs_0 (void) { if (test_lvs_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_lvs_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_lvs_0"); return 0; } @@ -15211,7 +16759,7 @@ static int test_lvs_1_skip (void) static int test_lvs_1 (void) { if (test_lvs_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_lvs_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_lvs_1"); return 0; } @@ -15407,7 +16955,7 @@ static int test_vgs_0_skip (void) static int test_vgs_0 (void) { if (test_vgs_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_vgs_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_vgs_0"); return 0; } @@ -15544,7 +17092,7 @@ static int test_vgs_1_skip (void) static int test_vgs_1 (void) { if (test_vgs_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_vgs_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_vgs_1"); return 0; } @@ -15701,7 +17249,7 @@ static int test_pvs_0_skip (void) static int test_pvs_0 (void) { if (test_pvs_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_pvs_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_pvs_0"); return 0; } @@ -15839,7 +17387,7 @@ static int test_pvs_1_skip (void) static int test_pvs_1 (void) { if (test_pvs_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_pvs_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_pvs_1"); return 0; } @@ -15983,7 +17531,7 @@ static int test_list_partitions_0_skip (void) static int test_list_partitions_0 (void) { if (test_list_partitions_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_list_partitions_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_list_partitions_0"); return 0; } @@ -16091,7 +17639,7 @@ static int test_list_partitions_1_skip (void) static int test_list_partitions_1 (void) { if (test_list_partitions_1_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_list_partitions_1"); + printf ("%s skipped (reason: environment variable set)\n", "test_list_partitions_1"); return 0; } @@ -16211,7 +17759,7 @@ static int test_list_devices_0_skip (void) static int test_list_devices_0 (void) { if (test_list_devices_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_list_devices_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_list_devices_0"); return 0; } @@ -16327,7 +17875,7 @@ static int test_ls_0_skip (void) static int test_ls_0 (void) { if (test_ls_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_ls_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_ls_0"); return 0; } @@ -16495,7 +18043,7 @@ static int test_cat_0_skip (void) static int test_cat_0 (void) { if (test_cat_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_cat_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_cat_0"); return 0; } @@ -16597,7 +18145,7 @@ static int test_touch_0_skip (void) static int test_touch_0 (void) { if (test_touch_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_touch_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_touch_0"); return 0; } @@ -16696,7 +18244,7 @@ static int test_sync_0_skip (void) static int test_sync_0 (void) { if (test_sync_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_sync_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_sync_0"); return 0; } @@ -16751,7 +18299,7 @@ static int test_mount_0_skip (void) static int test_mount_0 (void) { if (test_mount_0_skip ()) { - printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_mount_0"); + printf ("%s skipped (reason: environment variable set)\n", "test_mount_0"); return 0; } @@ -16961,9 +18509,75 @@ int main (int argc, char *argv[]) /* Cancel previous alarm. */ alarm (0); - nr_tests = 153; + nr_tests = 164; test_num++; + printf ("%3d/%3d test_tail_n_0\n", test_num, nr_tests); + if (test_tail_n_0 () == -1) { + printf ("test_tail_n_0 FAILED\n"); + failed++; + } + test_num++; + printf ("%3d/%3d test_tail_n_1\n", test_num, nr_tests); + if (test_tail_n_1 () == -1) { + printf ("test_tail_n_1 FAILED\n"); + failed++; + } + test_num++; + printf ("%3d/%3d test_tail_n_2\n", test_num, nr_tests); + if (test_tail_n_2 () == -1) { + printf ("test_tail_n_2 FAILED\n"); + failed++; + } + test_num++; + printf ("%3d/%3d test_tail_0\n", test_num, nr_tests); + if (test_tail_0 () == -1) { + printf ("test_tail_0 FAILED\n"); + failed++; + } + test_num++; + printf ("%3d/%3d test_head_n_0\n", test_num, nr_tests); + if (test_head_n_0 () == -1) { + printf ("test_head_n_0 FAILED\n"); + failed++; + } + test_num++; + printf ("%3d/%3d test_head_n_1\n", test_num, nr_tests); + if (test_head_n_1 () == -1) { + printf ("test_head_n_1 FAILED\n"); + failed++; + } + test_num++; + printf ("%3d/%3d test_head_n_2\n", test_num, nr_tests); + if (test_head_n_2 () == -1) { + printf ("test_head_n_2 FAILED\n"); + failed++; + } + test_num++; + printf ("%3d/%3d test_head_0\n", test_num, nr_tests); + if (test_head_0 () == -1) { + printf ("test_head_0 FAILED\n"); + failed++; + } + test_num++; + printf ("%3d/%3d test_wc_c_0\n", test_num, nr_tests); + if (test_wc_c_0 () == -1) { + printf ("test_wc_c_0 FAILED\n"); + failed++; + } + test_num++; + printf ("%3d/%3d test_wc_w_0\n", test_num, nr_tests); + if (test_wc_w_0 () == -1) { + printf ("test_wc_w_0 FAILED\n"); + failed++; + } + test_num++; + printf ("%3d/%3d test_wc_l_0\n", test_num, nr_tests); + if (test_wc_l_0 () == -1) { + printf ("test_wc_l_0 FAILED\n"); + failed++; + } + test_num++; printf ("%3d/%3d test_mkdtemp_0\n", test_num, nr_tests); if (test_mkdtemp_0 () == -1) { printf ("test_mkdtemp_0 FAILED\n");