summaryrefslogtreecommitdiff
path: root/test/libapt/cdromfindmountpointfordevice_test.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-06-12 08:36:58 +0200
committerMichael Vogt <mvo@debian.org>2014-06-12 08:36:58 +0200
commitcfc7f735774ba30dbee1897248f8dfedf0229a4c (patch)
treeb4e0ac29a6b398045a803e890f5cdabcca189d6a /test/libapt/cdromfindmountpointfordevice_test.cc
parenta0187f0f82a184b850b05b62e5a59b6a2055a506 (diff)
parent7701680af12a2c1a65121533c6ebcd635c013c25 (diff)
Merge tag '1.0.1ubuntu2' into ubuntu/trusty
Conflicts: configure.ac debian/changelog debian/control test/integration/framework
Diffstat (limited to 'test/libapt/cdromfindmountpointfordevice_test.cc')
-rw-r--r--test/libapt/cdromfindmountpointfordevice_test.cc26
1 files changed, 26 insertions, 0 deletions
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 <config.h>
+
+#include <apt-pkg/cdromutl.h>
+#include <apt-pkg/configuration.h>
+
+#include <string>
+#include <vector>
+
+#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;
+}