From 12844170ad33d96cb0c5fa411f4eb62fea6e3d5d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 10 Mar 2014 01:49:37 +0100 Subject: support very long mtab entries in mountpoint discovery MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Old code limited lines to 250 characters which is probably enough for everybody, but who knows… It also takes care of device nodes which start with the same prefix. --- test/libapt/cdromfindmountpointfordevice_test.cc | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/libapt/cdromfindmountpointfordevice_test.cc (limited to 'test/libapt/cdromfindmountpointfordevice_test.cc') diff --git a/test/libapt/cdromfindmountpointfordevice_test.cc b/test/libapt/cdromfindmountpointfordevice_test.cc new file mode 100644 index 000000000..26dcd1459 --- /dev/null +++ b/test/libapt/cdromfindmountpointfordevice_test.cc @@ -0,0 +1,26 @@ +#include + +#include +#include + +#include +#include + +#include "assert.h" + +int main(int argc, char const *argv[]) { + if (argc != 2) { + std::cout << "One parameter expected - given " << argc << std::endl; + return 100; + } + + _config->Set("Dir::state::Mountpoints", argv[1]); + equals("/", FindMountPointForDevice("rootfs")); + equals("/", FindMountPointForDevice("/dev/disk/by-uuid/fadcbc52-6284-4874-aaaa-dcee1f05fe21")); + equals("/sys", FindMountPointForDevice("sysfs")); + equals("/sys0", FindMountPointForDevice("sysfs0")); + equals("/boot/efi", FindMountPointForDevice("/dev/sda1")); + equals("/tmp", FindMountPointForDevice("tmpfs")); + + return 0; +} -- cgit v1.2.3