summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* libparted: Fix problem with creating 1s partitionsBrian C. Lane2023-02-063-0/+74
| | | | | | | | | 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: XFS requires a minimum size of 300MBrian C. Lane2022-12-133-3/+4
|
* parted: Add display of GPT UUIDs in JSON outputArvin Schnell2022-09-302-5/+10
| | | | | | | | | | | This adds 2 new disk type features, one for the whole disk UUID and another for the per-partition UUID. It adds ped_disk_get_uuid and ped_partition_get_uuid functions to retrieve them. It adds them to the JSON output on GPT disklabeled disks as "uuid" in the disk and partitions sections of the JSON output. Signed-off-by: Brian C. Lane <bcl@redhat.com>
* tests: t3200-type-change now passesBrian C. Lane2022-05-131-3/+0
|
* parted: add type commandArvin Schnell2022-05-1310-6/+227
| | | | | | | | | 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: Remove trailing blanksBrian C. Lane2022-03-251-1/+1
|
* maint: Update copyright statements to 2022Brian C. Lane2022-03-2388-88/+88
| | | | By running make update-copyright
* tests: Add a test to make sure GPT GUIDs default to filesystemBrian C. Lane2021-09-302-0/+108
| | | | | | | 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-233-1/+120
| | | | | | 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-253-0/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-252-0/+42
| | | | | | | | | | | 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: check for vfat kernel support and toolsRoss Burton2021-08-102-0/+5
| | | | | | | | | t1100-busy-label.sh and t1101-busy-partition.sh create and mount VFAT partitions, so check for both the tools and the kernel support. Fixes bug#49594. Signed-off-by: Brian C. Lane <bcl@redhat.com>
* tests: add a helper to check the kernel knows about a file systemRoss Burton2021-08-101-0/+10
| | | | | | | | | | | | | | | Some tests need both the file system tools (eg mkfs.vfat) and kernel support (eg vfat kernel module) to pass. There are already helpers such as require_fat_ which check for mkfs.vfat, but if the kernel doesn't support the filesystem then mounting the disk image will fail. Add require_filesystem_, which checks for either the filesystem name in /proc/filesystems (so it's built-in, or already loaded) or if the name is a valid module (so can be loaded on demand). Signed-off-by: Brian C. Lane <bcl@redhat.com>
* tests: add aarch64 and mips64 as a valid 64-bit machinesRoss Burton2021-08-101-1/+1
| | | | | | | | require_64_bit_ in t-lib-helpers.sh has a hard-coded list of uname machines that are 64-bit, so add aarch64 and mips64 to cover the major architectures. Signed-off-by: Brian C. Lane <bcl@redhat.com>
* tests/t3000: Use mkfs.hfsplus and fsck.hfsplus for resize testsBrian C. Lane2021-07-291-4/+4
|
* tests/t3000: Check for hfs and vfat support separatelyBrian C. Lane2021-07-151-3/+13
| | | | | | | Previously the whole test would be skipped if either mkfs.hfs or mkfs.vfat were not installed, leading to missing test coverage. This change checks for them individually so that the test will run with either or both of them installed
* tests/t6006: Change dev_size_mb to 10Brian C. Lane2021-07-141-6/+6
| | | | | This is backed by memory, so using more than is needed limits the size of the system it can run on.
* tests/t3200: Change dev_size_mb to 10Brian C. Lane2021-07-141-2/+2
| | | | | This is backed by memory, so using more than is needed limits the size of the system it can run on.
* tests/t3000: Change dev_size_mb to 267Brian C. Lane2021-07-141-2/+2
| | | | | | | | FAT32 needs a minimum partition size of 256MB so this is as small as we can make it. This is backed by memory, so using more than is needed limits the size of the system it can run on.
* tests/t1701: Change dev_size_mb to 10Brian C. Lane2021-07-121-2/+2
| | | | | This is backed by memory, so using more than is needed limits the size of the system it can run on.
* tests/t1102: Change dev_size_mb to 10Brian C. Lane2021-07-121-3/+3
| | | | | This is backed by memory, so using more than is needed limits the size of the system it can run on.
* tests/t1101: Change dev_size_mb to 10Brian C. Lane2021-07-121-3/+3
| | | | | This is backed by memory, so using more than is needed limits the size of the system it can run on.
* tests/t1100: Change dev_size_mb to 10Brian C. Lane2021-07-121-3/+3
| | | | | This is backed by memory, so using more than is needed limits the size of the system it can run on.
* tests: t9050 Use /dev/zero for temporary file and mkswapBrian C. Lane2021-06-141-4/+10
| | | | | and clean up the usage a little bit by giving it a proper name and removing the file when finished.
* tests: t0400 - Work around a mkswap bug by using /dev/zeroBrian C. Lane2021-06-141-1/+6
| | | | | | mkswap gets stuck, in some situations, when operating on a file full of holes (see https://bugzilla.redhat.com/show_bug.cgi?id=1971877) so work around that by using /dev/zero instead of /dev/null
* t0501-duplicate.sh: Add some more disk label types to the duplicate testBrian C. Lane2021-02-091-2/+7
| | | | | | | | | Add sun, atari, mac, and pc98 to the disklabels that we test ped_disk_duplicate on. aix isn't included because it doesn't support adding partitions. dvh doesn't support boot partition loop cannot be partitioned
* tests: Increase disk size for duplicate testBrian C. Lane2021-02-091-3/+3
| | | | | | Increase it from 8MiB to 32MiB and start the first partition at 2048 sector boundary instead of 32 so that no matter the sector size it will be aligned.
* tests: Fix t9041-undetected-in-use-16th-partitionCristian Klein2021-01-281-1/+1
| | | | | | | | | | | Sometimes fails with: ``` + mkfs.ext3 /dev/sda15 mke2fs 1.45.5 (07-Jan-2020) /dev/sda15: Not enough space to build proposed filesystem while setting up superblock ``` Signed-off-by: Brian C. Lane <bcl@redhat.com>
* tests: Fix test t1700-probe-fsCristian Klein2021-01-281-1/+1
| | | | | | | | | | | | | mkfs.ext3 (see version below) was complaining that the filesystem is too small for a journal, which made the test fail. ``` $ mkfs.ext3 -V mke2fs 1.45.5 (07-Jan-2020) Using EXT2FS Library version 1.45.5 ``` Signed-off-by: Brian C. Lane <bcl@redhat.com>
* tests: Add tests for --fixCristian Klein2021-01-282-1/+102
| | | | Signed-off-by: Brian C. Lane <bcl@redhat.com>
* maint: Update copyright statements to 2021Brian C. Lane2021-01-1886-86/+86
| | | | By running make update-copyright
* maint: Update copyright statements to 2020Brian C. Lane2020-12-1185-85/+85
| | | | By running make update-copyright
* tests: Fix unsigned warning in duplicate.cBrian C. Lane2020-11-201-1/+1
|
* tests: Update all the dmsetup tests to use ENABLE_DEVICE_MAPPERBrian C. Lane2020-11-053-3/+8
|
* t6001-psep: modify device manage support detectionJoe Slater2020-11-051-1/+2
| | | | | | | Use the method other tests use -- test an environment variable. Signed-off-by: Joe Slater <joe.slater@windriver.com> Signed-off-by: Brian C. Lane <bcl@redhat.com>
* tests: Add a test for resizepart on a busy partitionBrian C. Lane2020-09-011-4/+40
| | | | | This makes sure that the resizepart on a busy partition with the size on the cmdline will work.
* tests: Add f2fs to the fs probe testRomain Perier2020-05-041-1/+1
| | | | | Signed-off-by: Romain Perier <romain.perier@gmail.com> Signed-off-by: Brian C. Lane <bcl@redhat.com>
* tests: Test incomplete resizepart commandBrian C. Lane2019-12-161-0/+2
|
* Switch gpt-header-move and msdos-overlap to python3Brian C. Lane2019-10-112-2/+2
| | | | python2 is EOL on January 1, 2020 so it is time to switch to python3.
* maint: Update copyright statements to 2019Brian C. Lane2019-08-1286-86/+86
| | | | By running make update-copyright
* Fix syntax-check complaints about testsBrian C. Lane2019-08-094-4/+4
|
* Tests case for sigsegv when false nilfs2 superblock detected.Michael Small2019-04-093-0/+92
| | | | Signed-off-by: Brian C. Lane <bcl@redhat.com>
* Add udf to t1700-probe-fs and to the manpageBrian C. Lane2018-10-161-1/+1
| | | | | If mkfs.udf is installed this will test to make sure that the filesystem is detected.
* libparted: Add support for MBR id, GPT GUID and detection of UDF filesystemPali Rohár2018-10-162-0/+39
| | | | | | | | | | | | | | | 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>
* t6100-mdraid-partitions: Use v0.90 metadata for the testBrian C. Lane2018-08-221-2/+2
| | | | Newer metadata types use more disk space, causing the test to fail.
* Modify gpt-header-move and msdos-overlap to work with py2 or py3Brian C. Lane2018-08-222-10/+10
| | | | | | Distributions are starting to remove python2 and only use python3. Modify these test scripts so that they will work with either python 2.7 or python 3.X
* mkpart: Allow negative start value when FS-TYPE is not givenNiklas Hambüchen2018-06-052-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix set and disk_set to not crash when no flags are supportedPhillip Susi2018-06-051-0/+13
| | | | | | | | Loop labels and file images support no flags. set and disk_set would prompt for a flag and accept any string since the list of flags was empty, then fail to look up an actual flag value, then throw an exception with a null string for the name of the flag, which would bug.
* tests: fix t6100-mdraid-partitionsPhillip Susi2018-05-071-0/+1
| | | | | The test was failing because it didn't wait for the md device to appear after creating it.
* tests/t1701-rescue-fs wait for the device to appear.Brian C. Lane2017-05-021-0/+1
| | | | After mkpart it needs to wait for the new partition to appear.