File: lvm-utils.cc

package info (click to toggle)
snapper 0.10.6-1.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,136 kB
  • sloc: cpp: 24,846; ansic: 1,466; sh: 1,410; makefile: 511; python: 127; ruby: 90
file content (25 lines) | stat: -rw-r--r-- 733 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE basename1

#include <boost/test/unit_test.hpp>

#include <snapper/LvmUtils.h>

using namespace snapper;


BOOST_AUTO_TEST_CASE(split_device_name)
{
    std::pair<string, string> n1 = LvmUtils::split_device_name("/dev/mapper/system-root");
    BOOST_CHECK_EQUAL(n1.first, "system");
    BOOST_CHECK_EQUAL(n1.second, "root");

    std::pair<string, string> n2 = LvmUtils::split_device_name("/dev/mapper/vg--system-lv--root");
    BOOST_CHECK_EQUAL(n2.first, "vg-system");
    BOOST_CHECK_EQUAL(n2.second, "lv-root");

    std::pair<string, string> n3 = LvmUtils::split_device_name("/dev/mapper/s-r");
    BOOST_CHECK_EQUAL(n3.first, "s");
    BOOST_CHECK_EQUAL(n3.second, "r");
}