summaryrefslogtreecommitdiff
path: root/tests/Makefile.am
Commit message (Collapse)AuthorAgeFilesLines
* libparted: Fix problem with creating 1s partitionsBrian C. Lane2023-02-061-0/+2
| | | | | | | | | There was a 1-off error in _partition_get_overlap_constraint that prevented partitions from being created in 1s free space. You could create 1s partitions as long they were done in order, but not after leaving 'holes'. This fixes this and adds tests for it on msdos and gpt disklabels.
* tests: t3200-type-change now passesBrian C. Lane2022-05-131-3/+0
|
* parted: add type commandArvin Schnell2022-05-131-0/+4
| | | | | | | | | Include the partition type-id and type-uuid in the JSON output. Also add the the command 'type' to set them. Remove redundant flags from DosPartitionData and use only the system variable. Signed-off-by: Brian C. Lane <bcl@redhat.com>
* tests: Add a test to make sure GPT GUIDs default to filesystemBrian C. Lane2021-09-301-0/+1
| | | | | | | When no flag is set on a GPT partition the GUID should fall back to the filesystem type for fat32, swap, and hfs+ and if no filesystem is found it should default to linux filesystem data type, showing no filesystem and no flags.
* keep GUID specific attributesArvin Schnell2021-09-231-1/+2
| | | | | | Keep GUID specific attributes when writing GPT. Signed-off-by: Brian C. Lane <bcl@redhat.com>
* parted: Add --json cmdline switch to output JSONArvin Schnell2021-08-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This outputs the disk's details as a JSON object. eg. a disk image with a single partition from 1M to 100M: { "disk": { "path": "/root/disk1.img", "size": "2097152s", "model": "", "transport": "file", "logical-sector-size": 512, "physical-sector-size": 512, "label": "gpt", "max-partitions": 128, "partitions": [ { "number": 0, "start": "34s", "end": "2047s", "size": "2014s", "type": "free" },{ "number": 1, "start": "2048s", "end": "200703s", "size": "198656s", "type": "primary", "name": "root" },{ "number": 0, "start": "200704s", "end": "2097118s", "size": "1896415s", "type": "free" } ] } } Signed-off-by: Brian C. Lane <bcl@redhat.com>
* parted: Allow empty string for partition nameArvin Schnell2021-08-251-0/+1
| | | | | | | | | | | This makes it possible to pass an empty string in script mode e.g. to set no partition name (on GPT): parted -s ./disk.img mklabel gpt mkpart '""' ext2 1 100M Includes a new test for this feature. Signed-off-by: Brian C. Lane <bcl@redhat.com>
* tests: Add tests for --fixCristian Klein2021-01-281-1/+2
| | | | Signed-off-by: Brian C. Lane <bcl@redhat.com>
* Tests case for sigsegv when false nilfs2 superblock detected.Michael Small2019-04-091-0/+2
| | | | Signed-off-by: Brian C. Lane <bcl@redhat.com>
* libparted: Add support for MBR id, GPT GUID and detection of UDF filesystemPali Rohár2018-10-161-0/+1
| | | | | | | | | | | | | | | This is needed for libparted based applications (like Gparted) to correctly choose MBR id and GPT GUID for UDF filesystem. MBR id for UDF is 0x07 and GPT GUID is Microsoft Basic Data, see why: https://serverfault.com/a/829172 Without registering a new libparted fs code it is not possible to assign MBR id or GPT GUID. Detection of UDF filesystem is done by checking presence of UDF VSD (NSR02 or NSR03 identifier) and UDF AVDP at expected locations (blocks 256, -257, -1, 512). Signed-off-by: Brian C. Lane <bcl@redhat.com>
* mkpart: Allow negative start value when FS-TYPE is not givenNiklas Hambüchen2018-06-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The manual had long documented that negative values are allowed for both start and end values, but until now negative start values were rejected if FS-TYPE was not given. Example: # parted --script -a optimal /dev/loop0 -- mklabel gpt mkpart primary ext4 -5MiB 100% (succeeds) # parted --script -a optimal /dev/loop0 -- mklabel gpt mkpart primary -5MiB 100% parted: invalid token: -5MiB Error: Expecting a file system type. This commit fixes the latter error. The issue was an insufficient lookahead in command line parsing, looking only for digits when skipping over FS-TYPE. The fix is including the minus '-' in the lookahead. Originally reported as Debian bug #880035: "parted: fails to use negative start value for 'mkpart' command without specyfying FS-TYPE" https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=880035 Signed-off-by: Niklas Hambüchen <mail@nh2.me>
* tests: t3310-flags.sh: Query libparted for all flags to be testedMike Fleetwood2016-10-041-1/+2
| | | | | | | | | | | | | | | | | Replace scanning the documentation for an incomplete list of flags with querying libparted for the complete list of supported flags via the added helper print-flags. Correct $ME -> $ME_ in the warning messages. Improve the warning messages by including the table type and flag name not correctly set or cleared. Plus minor changes: (1) use slightly longer variable name primary_or_name; (2) use longer test partition name PTNNAME; and (3) stop shortening parted unit command to u. Signed-off-by: Brian C. Lane <bcl@redhat.com>
* parted: fix the rescue commandPhillip Susi2016-04-101-0/+1
| | | | | | | The rescue command often failed to locate a filesystem due to it leaving cylinder alignment on, which snapped the allowed bounds of the filesystem down to the next lower cylinder boundary, causing the detected filesystem to be rejected due to not fitting.
* tests: Make sure the extended partition length is correct (#1135493)Brian C. Lane2015-06-261-0/+1
| | | | | | parted tells the kernel the wrong length when reporting a resize of an extended partition. Make sure the length is 2 for 512b sectors and 1 sector for larger.
* tests: Add a test for device-mapper partition sizesBrian C. Lane2015-02-051-0/+1
| | | | | | device-mapper uses 512b sector units, not device specific sector sizes. This test ensures that the correct partition size is created, no matter what the device's sector size is.
* tests: excersise resize commandPetr Uzel2014-06-151-0/+1
| | | | a lot of TODOs
* Fix python test scripts for distributionBrian C. Lane2014-06-151-1/+2
| | | | | | | | | | | | | | | | make distcheck was failing because these scripts were not being included. Make them both executable and and add the path to the tests that use them. They also need to be included in the distribution so update Makefile.am * tests/Makefile.am: Add python test scripts * tests/gpt-header-move.py: rename to gpt-header-move and make it executable * tests/msdos-overlap.py: rename to overlap.py * tests/t0282-gpt-move-backup.sh: add path to scripts and use new name * tests/t0283-overlap-partitions.sh: same
* tests: test loop labelsPhillip Susi2014-05-221-0/+1
| | | | Verify previous fixes to loop labels.
* libparted: remove old partitions *first* before adding new onesPhillip Susi2014-05-221-0/+1
| | | | | | | | "libparted: avoid disturbing partitions" put the remove of the old partition in second pass. If you simultaneously removed partitions 1 and 2, and created a new partition #1 that overlapped the previous second partition, the sync would fail because it would try to create the new, larger partition #1 before removing the old partition #2.
* tests: Make sure dm UUIDs are not erasedBrian C. Lane2014-03-021-0/+1
| | | | * tests/t6005-dm-uuid.sh: Make sure dm UUIDs are not erased
* tests: test creating 20 device-mapper partitions (#803108)Brian C. Lane2014-02-251-0/+1
| | | | | * tests/t6004-dm-many-partitions.sh: Make sure > 17 partitions appear in device mapper.
* bug#15591: [PATCH] libparted: handle i18n gpt partition names correctlyPhillip Susi2013-12-231-0/+1
| | | | | | | | | | | gpt.c was simply truncating the UTF-16 characters stored in the partition name field to 8 bits. This corrupted non ascii characters which later resulted in parted crashing in strlist.c trying to convert the now invalid multi byte characters to wchar. gpt.c will now properly convert the UTF-16 to the current locale encoding.
* libparted: allow some common errors to be ignoredPhillip Susi2013-11-231-0/+1
| | | | | | | Partitions that overlap or extend beyond the end of the disk are common errors that usually result in people having to use other tools to correct because parted refuses to operate when it sees them. Change these errors to allow you to ignore them and use parted to correct the problem.
* libparted: fix gpt end of disk handlingPhillip Susi2013-11-231-0/+2
| | | | | | | | | | | | | | | There are two checks for problems with the end of disk. The first checks to make sure that the backup gpt is actually at the end of the disk as it should be. The second checks to see that the gpt's idea of where the disk ends is correct. The handling of the backup gpt location was wrong because if you chose not to fix the error, then as soon as you made any changes the backup would be written to the end of the disk anyhow, only the previous backup would not be zeroed. This patch fixes the write path to put the backup gpt where the gpt says it goes, not where we think the disk ends. This allows you to choose not to fix the problems, and the backup gpt will be written to the same place it was before, not the new end of disk.
* libparted: don't probe every dm device in probe_allPhillip Susi2012-10-291-0/+1
| | | | | | | | | | | | | | We were probing every dm device. Only probe dmraid whole disk (non-partition) devices instead. This removes the clutter of LVM logical volumes, and dmraid partitions from the list, which usually do not make sense to partition. * NEWS (Changes in behavior): Mention it. * libparted/arch/linux.c (_is_dmraid_device): New function. (_dm_is_part): Likewise. (_probe_dm_devices): Use the latter. * tests/t6003-dm-hide.sh: New test. * tests/Makefile.am (TESTS): Add it.
* libparted: refactor device-mapper partition sync codePhillip Susi2012-10-291-0/+1
| | | | | | | The device-mapper partition sync code was still using the remove all partitions, then add new partitions method. Refactor to use the same algorithm as regular disks: try to remove all, and ignore any that could not be removed but have not changed.
* build: do not rely on automake's AM_TESTS_ENVIRONMENTJim Meyering2012-10-091-1/+1
| | | | | | | | * tests/Makefile.am (TESTS_ENVIRONMENT): Rename from AM_TESTS_ENVIRONMENT, since it is not honored in automake-1.11.3 after all. This reverts commit v3.1-14-g2bd66d7. For now, I'll leave the following commit that made bootstrap.conf require 1.11.2. Prompted by a report of test failure from Phillip Susi.
* tests: clean up testsJim Meyering2012-09-291-1/+1
| | | | | | | | | | | | | | | Use warn_ and $ME_ in place of warn and $ME; remove definitions of the latter two. Remove unused code. * tests/lvm-utils.sh: Remove file. All functions were either unused or duplicated/better in t-lvm.sh. * tests/Makefile.am (EXTRA_DIST): Remove it. * tests/t-local.sh (scsi_debug_setup_): Use echo 1>&2, not warn_, to emit to log file only, not console. The diagnostic it emitted (in verbose mode) was more "informational" than a warning. * tests/t9030-align-check.sh: Use warn_, not warn. * tests/t-lvm.sh: Likewise, and use fail_, not error (undefined!). * tests/t-lib-helpers.sh (device_mapper_required_): Use t-lvm.sh and an explicit lvm_init_root_dir_ in place of lvm-utils.sh.
* tests: mac: exercise the just-fixed bugJim Meyering2012-09-201-0/+1
| | | | | * tests/t0350-mac-PT-increases-sector-size.sh: New test. * tests/Makefile.am (TESTS): Add it.
* tests: show that small dev now evokes "mklabel gpt" diagnosticJim Meyering2012-09-121-0/+1
| | | | | * tests/t0203-gpt-create-on-min-sized-device.sh: New test. * tests/Makefile.am (TESTS): Add it.
* tests: remove unused AM_TESTS_ENVIRONMENT entriesStefano Lattarini2012-08-301-5/+0
| | | | | | | | | | | Probably a copy&paste errors, likely from the TESTS_ENVIRONMENT definition in the 'tests/Makefile.am' in GNU coreutils. * tests/Makefile.am (AM_TESTS_ENVIRONMENT): Don't define nor export any of the variables PREFERABLY_POSIX_SHELL, REPLACE_GETCWD, CC, MAKE, PERL. Copyright-paperwork-exempt: yes
* tests: prefer AM_TESTS_ENVIRONMENT over TESTS_ENVIRONMENTStefano Lattarini2012-08-301-1/+1
| | | | | | | | | The latter should be reserved for user overrides. * tests/Makefile.am (TESTS_ENVIRONMENT): Rename ... (AM_TESTS_ENVIRONMENT): ... like this. Copyright-paperwork-exempt: yes
* tests: add t0301-overwrite-gpt-pmbr.shBrian C. Lane2012-03-241-0/+1
| | | | | | | | Make sure parted checks the PMBR before the GPT partition table. * NEWS: Update with new GPT behavior. * tests/overwrite-gpt-pmbr.sh: New test. * tests/Makefile.am (TESTS): Add it.
* tests: test FAT and HFS file system resizingJim Meyering2012-02-101-1/+6
| | | | | | | * tests/t3000-resize-fs.sh: New test. * tests/Makefile.am (TESTS): Add it. (check_PROGRAMS): Add fs-resize. (fs_resize_LDADD): Define, so it links with both libraries.
* tests: set PARTED_TEST_NAME, for valgrindJim Meyering2012-02-071-0/+1
| | | | | * tests/Makefile.am (PARTED_TEST_NAME): Define. * tests/t0211-gpt-rewrite-header.sh: Clarify a comment.
* tests: add test for GPT PMBR pmbr_boot flagBrian C. Lane2012-02-021-0/+1
| | | | | | * tests/t0209-gpt-pmbr_boot.sh: New test * tests/Makefile.am: Add new test * NEWS: Add information about the GPT PMBR pmbr_boot flag
* tests: exercise today's bug fix, creating a GPT table with 128 entriesJim Meyering2012-01-231-0/+1
| | | | | * tests/t0212-gpt-many-partitions.sh: New test. * tests/Makefile.am (TESTS): Add it.
* tests: test for yesterday's bug fixJim Meyering2012-01-221-0/+1
| | | | | * tests/Makefile.am (TESTS): Add it. * tests/t0211-gpt-rewrite-header.sh: New test.
* libparted: enforce dos partition limitPhillip Susi2012-01-181-0/+1
| | | | | | | | | | | | | | | | The msdos partition table claimed a maximum partition count of 16 but would allow you to go beyond that. This resulted in the kernel not being informed of those partitions. Corrected to enforce the limit. * NEWS (Bug fixes): Mention it. * libparted/labels/dos.c (next_primary): Return -1 upon failure. (next_logical): Stop no later than MAX_TOTAL_PART. Throw exception and return -1 upon failure. (msdos_partition_enumerate): Convert a negative partition number return value from either of the above two to failure (return 0). * tests/t9042-dos-partition-limit.sh: New file. * tests/Makefile.am (TESTS): Add it.
* build: insert -I$(top_builddir)/include before -I$(top_srcdir)/includeKeshav P R2012-01-101-0/+1
| | | | | | | | | | | | | everywhere, for those who perform non-srcdir builds from a pristine cloned directory. There is no problem when building from a tarball, since that includes include/parted/*.h files under $(top_srcdir). * libparted/Makefile.am: Insert it. * libparted/fs/Makefile.am: Likewise. * libparted/labels/Makefile.am: Likewise. * libparted/tests/Makefile.am: Likewise. * parted/Makefile.am: Likewise. * partprobe/Makefile.am: Likewise. * tests/Makefile.am: Likewise.
* libparted: gpt: a smaller device need not render both headers invalidJim Meyering2012-01-091-0/+1
| | | | | | | | | | | | | | | Putting a valid GPT-labeled image on a smaller device, (i.e., one that truncates the backup GPT header, but that does not impact the primary one) should not render the primary header invalid. * libparted/labels/gpt.c (_header_is_valid): Do *not* reject a header when its last_usable value is larger than the device length. This reverts part of commit v3.0-10-g99f9c6a, "gpt: don't abort for a truncated GPT-formatted device". With this change, running parted in interactive mode with such an image/device combination will recognize that only the backup header is corrupt, and will offer to correct it. Before, it would report that both headers were corrupt. * tests/t0203-gpt-shortened-device-primary-valid.sh: New file. * tests/Makefile.am (TESTS): Add it.
* Add partition separator only when requiredPhillip Susi2011-12-121-0/+1
| | | | | | | | Device mapper type should not automatically mean add 'p' before the partition number. Fall back to adding it only if the previous character is a digit. This complies with kpartx behavior and linux behavior "since the dawn of time".
* tests: test for partitions on mdraidPetr Uzel2011-11-271-0/+1
| | | | | * tests/t6100-mdraid-partitions.sh: New file. * tests/Makefile.am: Run this test.
* tests: exercise and document the HFS-probe bug fixJim Meyering2011-11-051-0/+1
| | | | | | | | | Simply zeroing out the total_blocks and block_size members of the on-disk _HfsMasterDirectoryBlock would provoke a failed assertion any time parted tried to probe that partition. * tests/t2500-probe-corrupt-hfs.sh: New script. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention this.
* tests: exercise the "GPT vs other-sized partition entry arrays" fixesJim Meyering2011-11-041-1/+2
| | | | | | * tests/t0210-gpt-resized-partition-entry-array.sh: New file. * tests/Makefile.am (TESTS): Add it. (EXTRA_DIST): Add gpt-header-munge.
* tests: add new test to check ped_disk_duplicateBrian C. Lane2011-11-021-1/+2
| | | | | | | * tests/duplicate.c: New test. * tests/t0501-duplicate.sh: New test program. * tests/Makefile.am (TEST): Add new test. (check_PROGRAMS): Add new test program.
* tests: exercise the new featurePetr Uzel2011-11-021-0/+1
| | | | | * tests/t0208-mkpart-end-in-IEC.sh: New file. * tests/Makefile.am: Add it.
* tests: add tests for new pc98 signatures (#646053)Brian C. Lane2011-10-191-0/+1
| | | | | * tests/t2201-pc98-label-recog.sh: New file * tests/Makefile.am: Add test
* tests: use more portable fd redirection in TESTS_ENVIRONMENTStefano Lattarini2011-10-151-2/+1
| | | | | | | | * tests/Makefile.am (TESTS_ENVIRONMENT): Redirection with `exec 9>&2' is not portable to various Korn shells, and to (at least) HP-UX 11 /bin/sh. Use a more portable idiom. See <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/22488> for lots of discussion.
* tests: TEST_ENVIRONMENT simplified and made more robustStefano Lattarini2011-10-151-17/+5
| | | | | | | | | | | | | | | | | | | | | The test scripts in tests/ are shell scripts, so the current definition of TESTS_ENVIRONMENT, which adaptively run tests using either perl or the shell depending on their kind, is overkill. Moreover, this change is required in order for the testsuite to continue to work with the new testsuite harness that is planned to be introduced in Automake 1.12 (which, as of the writing date, is still under development and in late alpha state). See also related discussion on bug-coreutils: <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8887> * tests/help-version: Moved ... * tests/help-version.sh: ... to this. * tests/Makefile.am (TESTS): Update. (TESTS_ENVIRONMENT): Remove definition of the `shell_or_perl_' shell function, which is not required anymore. (SH_LOG_COMPILER): New, define to `$(SHELL)'.