summaryrefslogtreecommitdiff
path: root/libparted/tests/symlink.c
Commit message (Collapse)AuthorAgeFilesLines
* tests: Fix formatting and snprintf warnings in tests.Brian C. Lane2023-02-151-1/+1
| | | | | | | | | | The assert message includes sector values, which are long long int, so use the proper formatting of %lld. The snprintf warning complained about trying to write 258 bytes so I bumped the buffer size up to 259. The return value is already being checked for truncation so this is just to keep the compiler happy without having to suppress the warning.
* tests: Fixing libparted test framework usageBrian C. Lane2023-02-071-10/+21
| | | | | | The fail and fail_if functions from libcheck are deprecated, replace them with ck_abort_msg and ck_assert_msg. Note that the logic of assert is the opposite of fail_if.
* libparted: add test for /dev/mapper symlink issueHans de Goede2010-04-061-0/+135
Sometimes, libparted operates on device mapper files with a path of /dev/mapper/foo. With newer lvm versions /dev/mapper/foo is a symlink to /dev/dm-#. However some storage administration programs (anaconda, for example) may do the following: 1) Create a ped_device for /dev/mapper/foo 2) ped_get_device resolves the symlink to /dev/dm-#, and the path in the PedDevice struct points to /dev/dm-# 3) The program does some things to lvm, causing the symlink to point to a different /dev/dm-# node 4) The program does something with the PedDevice, which results in an operation on the wrong device Newer libparted versions do not suffer from this problem, as they do not canonicalize device names under /dev/mapper. This test checks for this bug. * libparted/tests/symlink.c: New test which tests for this issue. * libparted/tests/t3000-symlink.sh: New file. * libparted/tests/Makefile.am: Include the new files. Run the new test.