summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* tests: better quoting to avoid failure with poorly-named src directoryJim Meyering2009-07-091-3/+3
| | | | | | | | | * libparted/tests/Makefile.am (init.sh): Quote, in case $(abs_top_srcdir) contains e.g., spaces. * tests/Makefile.am (init.sh): Likewise. * libparted/tests/t2000-disk.sh: Better quoting here, too. * libparted/tests/t1000-label.sh: Likewise. Reported by Joel Granados
* tests: ensure that we preserve the first 446 byts of a GPT pmbrJoel Granados Moreno2009-06-172-0/+47
| | | | | * tests/t0202-gpt-pmbr.sh: Ensure that the first 446 bytes are unchanged after creating a GPT partition.
* linux-swap: generate UUIDs for fresh swap spacesColin Watson2009-06-161-0/+43
| | | | | | | * libparted/fs/linux_swap/linux_swap.c: Generate a UUID when creating a fresh swap space. * tests/t2100-mkswap.sh: Test that two fresh swap spaces get different UUIDs, and that 'check' preserves the swap UUID.
* tests: simplify t6001-dm-ignoremd.shJoel Granados Moreno2009-06-111-28/+5
| | | | | | * tests/t6001-dm-ignoremd.sh (md_dev_create_): Use functions in test-util.sh for mdadm commands. Move mddev_ to the top of the file. Remove unneeded comment.
* tests: add mdadm specific functionsJoel Granados Moreno2009-06-111-0/+29
| | | | | * tests/test-lib.sh (require_mdadm_): New function. (mdadm_create_linear_device_): New function.
* parted-ui: ensure cmd-line buffer is empty before ped_exception_throwJoel Granados Moreno2009-06-101-3/+1
| | | | | | | | | | | | | | When ped_exception_throw requires input from the user and there are leftover strings in the command line, there is an "invalid token" error from parted. This happens because the ped_exception expects some input that is, most likely, different from the leftover string(s). To address this, one must make sure that all the argument strings are parsed before invoking any exception that requires input. * parted/parted.c (do_mklabel): Call command_line_get_disk_type call before the disk checks (_disk_warn_loss will call ped_exception_throw). * tests/t0000-basic.sh: Adjust, now that the output need not include the error message.
* tests: verify that "md" devices are not listedJoel Granados Moreno2009-06-102-0/+86
| | | | | * tests/t6001-dm-ignored.sh: New test file. * tests/Makefile.am (TESTS): Add it.
* tests: adjust t4100-msdos-starting-sector.shJim Meyering2009-05-261-22/+14
| | | | | | | * tests/t4100-msdos-starting-sector.sh: Use parted's -m option when printing, and adjust expected output to match. Filter out "Disk...:" part to avoid false-positive failures due to mount-point- related differences.
* Add test for msdos starting sector.Joel Granados Moreno2009-05-262-0/+92
| | | | | * tests/t4100-msdos-starting-sector.sh : Make sure we are consistent when displaying starting sector for msdos lables.
* adjust "parted -s dev print" not to emit trailing spacesJim Meyering2009-03-051-3/+3
| | | | | | * parted/table.c (table_render_row): Don't append trailing spaces or delimiter after final field, and trim any other trailing spaces. * tests/t5000-tags.sh: Remove trailing spaces from expected output.
* test for the gpt_read failed-assertion fixPetr Uzel2009-02-182-0/+43
| | | | | * tests/t0201-gpt.sh: New file. * tests/Makefile.am (TESTS): Add it.
* gpt: add a test: printing a partition table must not modify itJim Meyering2009-02-172-0/+57
| | | | | * tests/t0200-gpt.sh: New file. * tests/Makefile.am (TESTS): Add the new test.
* tests: use "compare", not "$compare"Jim Meyering2009-02-1617-51/+51
| | | | | * test-lib.sh (compare): Define "compare" as a function, not a variable. * tests/t*.sh: use "compare", not "$compare"
* Differentiate between Ext4 and Ext3 file systems.Debarshi Ray2009-01-082-0/+43
| | | | | | | | | | | | | | | | | | Fixes http://parted.alioth.debian.org/cgi-bin/trac.cgi/ticket/188 * libparted/fs/ext2/ext2_fs.h (EXT4_FEATURE_RO_COMPAT_HUGE_FILE, EXT4_FEATURE_RO_COMPAT_DIR_NLINK, EXT4_FEATURE_INCOMPAT_EXTENTS, EXT4_FEATURE_INCOMPAT_64BIT): New constants. * libparted/fs/ext2/interface.c (_ext2_generic_probe): Ext4 file systems will have EXT4_FEATURE_* bits set, while Ext3 will not. (_ext2_probe, _ext3_probe): Pass 2 and 3 respectively, instead of 0 and 1, to _ext2_generic_probe. (_ext4_probe): New function. (_ext4_ops, _ext4_type): New structures. (ped_file_system_ext2_init): Register Ext4 file system type. (ped_file_system_ext2_done): Likewise. * tests/Makefile.am (TESTS): Add t1700-ext-probe.sh. * tests/t1700-ext-probe.sh: New file.
* sun partition tables: add support for RAID partition typesTom "spot" Callaway2008-12-232-0/+69
| | | | | | | | | | | | | | | | | | | | | This patch enables RAID as a supported partition type on Sun disk layouts, commonly found/used on SPARC hardware. It has been tested on Aurora SPARC Linux (and Fedora SPARC). I have no idea if Solaris supports Software RAID or not... Along with the code change, I wrote a test case that checks if the RAID partition type is supported on sun disk labels. * libparted/labels/sun.c [_SunPartitionData] (is_raid): New member. (sun_read): Initialize the ->is_raid member. (sun_partition_new): Clear is_raid, like all the other members. (sun_partition_duplicate): Propagate the is_raid member. (sun_partition_set_system): Make sun_data->type reflect is_raid. (sun_partition_set_flag): Also initialize ->is_raid. (sun_partition_get_flag): Handle PED_PARTITION_RAID. (sun_partition_is_flag_available): Likewise. * tests/t4000-sun-raid-type.sh: New file. * tests/Makefile.am (TESTS): Add t4000-sun-raid-type.sh.
* add a test for recently introduced loop-dev-based bugSoren Hansen2008-08-072-1/+57
| | | | | | | This also checks for the current behavior when trying to partition a device that may not be partitioned, like loop devices. * tests/Makefile.am (TESTS): Add tests/t8000-loop.sh. * tests/t8000-loop.sh: New file. Test for the above fix.
* test for the s/PED_MAX/PED_MIN/ partition-number fixJim Meyering2008-07-083-1/+81
| | | | | | | | | * tests/t4200-partprobe.sh: New file. Test for today's fix. * tests/Makefile.am (TESTS): Add t4200-partprobe.sh. (init.sh): Now that we test partprobe, add $(abs_top_builddir)/partprobe to PATH. * tests/test-lib.sh: Honor new dvhtool_required_ variable. Based on a reproducer from Petr Uzel.
* tests: avoid test failure due to added newline in diagnosticJim Meyering2008-06-201-3/+3
| | | | * tests/t3000-constraints.sh: Adapt to changed output syntax.
* tests: factor out duplicationJim Meyering2008-06-201-70/+38
| | | | | * tests/t7000-scripting.sh: Use a loop rather than two copies of each of 7 tests.
* tests: use consistent output normalization codeJim Meyering2008-06-201-9/+9
| | | | | * tests/t7000-scripting.sh: same as in e.g., t3000-constraints.sh. Use the same name for all output files, "out", not "out1".
* tests: avoid failure when run as non-rootJim Meyering2008-06-201-7/+4
| | | | * tests/t7000-scripting.sh: and avoid some duplication
* Fix the script mode for mkpart and mkpartfs.Joel Andres Granados2008-06-202-1/+108
| | | | | | | | | | | | | | | | To: parted-devel@lists.alioth.debian.org Date: Fri, 20 Jun 2008 11:37:41 +0200 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on rho.meyering.net X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.2 tests=AWL,BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.5 In scripting mode, parted used to ask the user for confirmation when the values to be used where not the ones specified by the user. * parted/parted.c (do_mkpart, do_mkpartfs): if opt_script_mode is. set fail, if it's not, warn and ask for intervention. * tests/Makefile.am : include the new test in the TEST list. * tests/t7000-scripting.sh : Distribute new test case.
* skip device-mapper test if support is not enabledJim Meyering2008-06-062-1/+9
| | | | | | * configure.ac: Revamp test; also set ENABLE_DEVICE_MAPPER shell var. * tests/Makefile.am (ENABLE_DEVICE_MAPPER): Propagate to tests. * tests/t6000-dm.sh: Skip all tests w/o device-mapper support.
* * tests/Makefile.am (EXTRA_DIST): Add lvm-utils.sh.Jim Meyering2008-06-061-1/+1
|
* reflect renaming: dm-utils.sh -> lvm-utils.shJim Meyering2008-06-062-1/+1
| | | | | | * tests/test-lib.sh: s/dm-utils.sh/lvm-utils.sh/ * tests/dm-utils.sh: Rename this... * tests/lvm-utils.sh: ...to this.
* protect against bogus absolute srcdir nameJim Meyering2008-06-061-2/+3
| | | | | * test-lib.sh: add quotes to protect against $abs_top_srcdir containing shell meta-characters
* * test-lib.sh: Guard against bogus $device_mapper_required value in env.Jim Meyering2008-06-061-1/+1
|
* sync from lvm-utils.shJim Meyering2008-06-061-1/+49
|
* source test-lib.sh (not init.sh) from each testJim Meyering2008-06-0616-22/+40
| | | | | | | | | | | | | | | | | | | | | | | | * tests/test-lib.sh: Source init.sh early. Use $test_dir_rand_, as done in LVM test framework. Source lvm-utils.sh _after_ defining test_dir_rand_. * tests/Makefile.am (init.sh): Don't emit code to source test-lib.sh, since each test now sources that file directly. * tests/t0000-basic.sh: Source test-lib.sh, not init.sh. Default srcdir=. in each test, so it may be run independently of "make". * tests/t0100-print.sh: Likewise. * tests/t1000-mkpartfs.sh: Likewise. * tests/t1100-busy-label.sh: Likewise. * tests/t1500-small-ext2.sh: Likewise. * tests/t2000-mkfs.sh: Likewise. * tests/t2100-mkswap.sh: Likewise. * tests/t2200-dos-label-recog.sh: Likewise. * tests/t3000-constraints.sh: Likewise. * tests/t3100-resize-ext2-partion.sh: Likewise. * tests/t4100-dvh-partition-limits.sh: Likewise. * tests/t4100-msdos-partition-limits.sh: Likewise. * tests/t5000-tags.sh: Likewise. * tests/t6000-dm.sh: Likewise. * tests/Makefile.am (TESTS_ENVIRONMENT): Pass srcdir to tests.
* * dm-utils: Restore uses of $test_dir_rand_.Jim Meyering2008-06-061-3/+3
|
* add basic device mapper testsGuido Günther2008-06-064-1/+222
| | | | | | | * tests/dm-utils.sh: New file. Copied from lvm's tests/lvm-utils.sh. * tests/t6000-dm.sh: New file. * tests/test-lib.sh: FIXME * tests/Makefile.am: FIXME
* use gnulib's mktempd module/scriptJim Meyering2008-06-053-109/+2
| | | | | | | * bootstrap.conf (gnulib_modules): Add mktempd. * tests/test-lib.sh: Use build-aux/mktempd, not mkdtemp. * tests/mkdtemp: Remove file. * tests/Makefile.am (EXTRA_DIST): Remove mkdtemp.
* test for improved DOS-partition-table recognitionJim Meyering2008-05-292-0/+62
| | | | | * tests/t2200-dos-label-recog.sh: New file. * tests/Makefile.am (TESTS): Add t2200-dos-label-recog.sh.
* Add support for GRUB / BIOS partition in GPT.Robert Millan2008-04-122-1/+83
|
* Enforce inherent limitations of dos and dvh partition table formats.Jim Meyering2008-02-043-1/+340
| | | | | | | | | | | | | * libparted/disk.c (_check_partition): Enforce the 32-bit limitation on a partition's starting sector number and length (in sectors). With the usual 512-byte sector size, this limits the maximum partition size to just under 2TB. (_partition_max_start, _partition_max_len): New functions. (_check_partition): Use them. * tests/t4100-msdos-partition-limits.sh: New file. Test vs. msdos. * tests/t4100-dvh-partition-limits.sh: New file. Test vs. dvh. * tests/Makefile.am (TESTS): Add t4100-msdos-partition-limits.sh and t4100-dvh-partition-limits.sh.
* Fix mkpart linux-swap bug: would use 0x83 rather than 0x82Jim Meyering2007-08-142-0/+55
| | | | | | | | | | | | | | | | * libparted/labels/bsd.c (bsd_partition_set_system): Include "misc.h". Use is_linux_swap to test whether the type string matches. * libparted/labels/dasd.c (dasd_read, dasd_partition_set_system): Likewise. * libparted/labels/dos.c (msdos_partition_set_system): Likewise. * libparted/labels/mac.c (mac_partition_set_system): Likewise. * libparted/labels/rdb.c (amiga_partition_set_system): Likewise. * libparted/labels/sun.c (sun_partition_set_system): Likewise. Based on a patch by Kenneth MacDonald, from <http://lists.gnu.org/archive/html/bug-parted/2007-07/msg00012.html>. * libparted/labels/misc.h (is_linux_swap): New function/file. * libparted/labels/Makefile.am (liblabels_la_SOURCES): Add misc.h. * tests/t2100-mkswap.sh: New file, test for the above fix. * tests/Makefile.am (TESTS): Add t2100-mkswap.sh.
* Avoid test failure with dash's builtin printf.Jim Meyering2007-08-141-1/+3
| | | | | * tests/t0100-print.sh (msdos_magic): Use more-portable octal escapes, not hexadecimal ones.
* Updated GPL license boilerplate.David Cantrell2007-07-238-32/+16
|
* Flip the switch (expected-failure -> expected-success) in tests/t3100-Jim Meyering2007-07-101-6/+2
| | | | resize-ext2-partion.sh, now that this bug is fixed.
* Avoid test failure on Linux-2.6.8 due to too small underlying file.Jim Meyering2007-06-221-1/+1
| | | | | Overwrite the label creating a 4KB file; 1KB was too small and would trigger the failure. Reported by Bob Proulx.
* Avoid mklabel test failure with very small file on Linux-2.6.8.Jim Meyering2007-06-221-2/+8
| | | | Signed-off-by: Jim Meyering <jim@meyering.net>
* Fix the mkfs final-block-group-too-short bug.Jim Meyering2007-06-121-13/+36
| | | | | | | | | | | mkfs would fail for certain sizes resulting in a final block-group that was too small to accommodate the minimum number of admin blocks. There was already work-around code for when a decremented "numgroups" was 1. This change applies that work-around code for larger values of numgroups, too. Also, there was an off-by-one error in the guard test that would allow a few too-small partition sizes to slip through and provoke the error (see tests/t2000-mkfs.sh for two examples). This change fixes that, too.
* Fix two "make check"-as-root failures.Jim Meyering2007-06-122-2/+2
| | | | | t1100-busy-label.sh: Remove extra copy of "o2" temporary file name. test-lib.sh (emit_superuser_warning): Exit successfully when run as root, too.
* Add a test to record the current EXT2 mkpartfs failure for some sizes.Jim Meyering2007-06-111-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | Run this: dev=F dd if=/dev/null of=$dev bs=1 seek=20M ./parted -s $dev mklabel gpt ./parted -s $dev mkpartfs primary ext2 0 16796160B It fails with this diagnostic: Error: Attempt to write sectors 32772-32773 outside of partition on /t/F. But if you choose a size that's one byte smaller, it works: ./parted -s $dev mkpartfs primary ext2 0 16796159B The difference is in how ext2_mkfs_write_meta computes the number of block groups. In the former case, it computes numgroups = 3. In the latter, numgroups = 2. The trouble with the first case is that there isn't enough space for 3 full block groups in a file system of that size. Hence the eventual attempt to write beyond the initially- established end-of-file-system mark.
* Avoid unnecessary writes in test scripts.Jim Meyering2007-06-115-9/+9
| | | | | | | | This changes the tests to create sparse files for some test inputs rather than zero-filled non-sparse ones. Doing this cuts more than 50% off the run time of "make check" in the tests/ directory. Signed-off-by: Jim Meyering <jim@meyering.net>
* Add a test for an ext2-resize failure.Matt Davis2007-06-112-1/+60
| | | | | | | | | This patch is based on the change from Matt Davis: http://thread.gmane.org/gmane.comp.gnu.parted.devel/1695/focus=1704 Demonstrate an ext2-resize failure in parted-1.8.7, based on the report in http://parted.alioth.debian.org/cgi-bin/trac.cgi/ticket/22
* Avoid a leak.Jim Meyering2007-05-292-0/+59
| | | | | | | | | | * parted/parted.c (do_print): Use separate variables for the header and for individual rows. Free each when done. * parted/table.c (table_add_row_from_strlist): Insert a newly allocated copy of each string, so that the caller can free the argument corresponding to the "list" parameter. * tests/t0100-print.sh: New test for this. * tests/Makefile.am (TESTS): Add t0100-print.sh.
* Move a test/utility function into test-lib.sh.Jim Meyering2007-05-293-11/+9
| | | | | | | | | * tests/t3000-constraints.sh (emit_superuser_warning): Move this function to... * tests/test-lib.sh (emit_superuser_warning): ...here. * tests/t0000-basic.sh: Use the function instead of open-coding it. Signed-off-by: Jim Meyering <jim@meyering.net>
* On IRC, xeos reported test failures in t0000 and t2000Jim Meyering2007-05-293-3/+10
| | | | | | | | | | | | | with diffs like this: -/home/xeos/projects/parted/parted/.libs/lt-parted: invalid token: msdos +parted: invalid token: msdos Here's the patch I expect to apply. It also removes an inter-part dependency by moving the creation of the "o2" temporary file into the test where it's used. Some of this duplication should be factored out, eventually...
* Diagnose invalid command arguments.Jim Meyering2007-05-263-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This started because I objected to parted failing with no diagnostic when given an invalid file system type: $ /sbin/parted -s $dev mklabel loop mkpartfs hfsplus 0 1.4 WARNING: You are not superuser. Watch out for permissions. [Exit 1] With the changes below, it does this: $ ./parted -s $dev mklabel loop mkpartfs hfsplus 0 1.4 ./parted: invalid token: hfsplus [Exit 1] The following may look like a simple change, but looks are deceptive... For example, if you try to diagnose via ped_exception_throw instead of "error", you'll find that the mere fact of diagnosing the problem introduces new ones because of how the exception handler manipulates the global command line buffer containing the token we're complaining about. But this isn't library code, so using error() is fine. Diagnose invalid command arguments. When a command argument doesn't match the expected candidate values, parted would silently exit (in script mode) or simply act as if that value and any following ones had not been specified (in interactive mode). With this change, it complains about the "invalid token", and in script mode (where there hasn't been a prompt to give context) sometimes tells what type of token it was expecting. * parted/ui.c: Include "error.h". (command_line_get_word): If the user's "token" wasn't a good enough match, give a diagnostic. In script mode, return NULL so that the callers can give additional information. * tests/t2000-mkfs.sh: New test for the above. * tests/t0000-basic.sh: Expect the new diagnostic when "msdos" is treated as an unrecognized first token after "mklabel". This happens when trying to label a disk that already has a label. * tests/t1100-busy-label.sh: Likewise.