diff options
author | Roger Leigh <rleigh@debian.org> | 2013-04-28 12:24:04 +0100 |
---|---|---|
committer | Roger Leigh <rleigh@debian.org> | 2013-05-04 17:17:17 +0100 |
commit | dc6bdbc920d8b3e141447453aeeecd6970cd68d2 (patch) | |
tree | bcd7656fe10eeaf386f776c6adfebfdbc8de2c3f /test | |
parent | 176be0c58ce22af68b6661d1fe384ad8a59c5c9f (diff) | |
download | schroot-dc6bdbc920d8b3e141447453aeeecd6970cd68d2.tar.gz |
sbuild::chroot: Migrate btrfs-snapshot to storage facet
Diffstat (limited to 'test')
-rw-r--r-- | test/sbuild/chroot/btrfs-snapshot.cc | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/test/sbuild/chroot/btrfs-snapshot.cc b/test/sbuild/chroot/btrfs-snapshot.cc index b2d6b589..164f5c90 100644 --- a/test/sbuild/chroot/btrfs-snapshot.cc +++ b/test/sbuild/chroot/btrfs-snapshot.cc @@ -19,6 +19,7 @@ #include <config.h> #include <sbuild/chroot/btrfs-snapshot.h> +#include <sbuild/chroot/facet/btrfs-snapshot.h> #include <sbuild/i18n.h> #include <sbuild/keyfile-writer.h> #include <sbuild/util.h> @@ -89,8 +90,9 @@ public: std::shared_ptr<sbuild::chroot::btrfs_snapshot> c = std::dynamic_pointer_cast<sbuild::chroot::btrfs_snapshot>(chroot); - c->set_source_subvolume("/srv/chroot/sid"); - c->set_snapshot_directory("/srv/chroot/snapshot"); + sbuild::chroot::facet::btrfs_snapshot::ptr bfac = chroot->get_facet_strict<sbuild::chroot::facet::btrfs_snapshot>(); + bfac->set_source_subvolume("/srv/chroot/sid"); + bfac->set_snapshot_directory("/srv/chroot/snapshot"); } void @@ -98,8 +100,9 @@ public: { std::shared_ptr<sbuild::chroot::btrfs_snapshot> c = std::dynamic_pointer_cast<sbuild::chroot::btrfs_snapshot>(chroot); CPPUNIT_ASSERT(c); - c->set_source_subvolume("/srv/chroot/chroot"); - CPPUNIT_ASSERT(c->get_source_subvolume() == "/srv/chroot/chroot"); + sbuild::chroot::facet::btrfs_snapshot::ptr bfac = chroot->get_facet_strict<sbuild::chroot::facet::btrfs_snapshot>(); + bfac->set_source_subvolume("/srv/chroot/chroot"); + CPPUNIT_ASSERT(bfac->get_source_subvolume() == "/srv/chroot/chroot"); } void @@ -107,8 +110,9 @@ public: { std::shared_ptr<sbuild::chroot::btrfs_snapshot> c = std::dynamic_pointer_cast<sbuild::chroot::btrfs_snapshot>(chroot); CPPUNIT_ASSERT(c); - c->set_snapshot_directory("/srv/chroot/snapshot2"); - CPPUNIT_ASSERT(c->get_snapshot_directory() == "/srv/chroot/snapshot2"); + sbuild::chroot::facet::btrfs_snapshot::ptr bfac = chroot->get_facet_strict<sbuild::chroot::facet::btrfs_snapshot>(); + bfac->set_snapshot_directory("/srv/chroot/snapshot2"); + CPPUNIT_ASSERT(bfac->get_snapshot_directory() == "/srv/chroot/snapshot2"); } void @@ -116,8 +120,9 @@ public: { std::shared_ptr<sbuild::chroot::btrfs_snapshot> c = std::dynamic_pointer_cast<sbuild::chroot::btrfs_snapshot>(chroot); CPPUNIT_ASSERT(c); - c->set_snapshot_directory("/srv/chroot/snapshot2/test-session-id"); - CPPUNIT_ASSERT(c->get_snapshot_directory() == "/srv/chroot/snapshot2/test-session-id"); + sbuild::chroot::facet::btrfs_snapshot::ptr bfac = chroot->get_facet_strict<sbuild::chroot::facet::btrfs_snapshot>(); + bfac->set_snapshot_directory("/srv/chroot/snapshot2/test-session-id"); + CPPUNIT_ASSERT(bfac->get_snapshot_directory() == "/srv/chroot/snapshot2/test-session-id"); } void @@ -125,7 +130,8 @@ public: { std::shared_ptr<sbuild::chroot::btrfs_snapshot> c = std::dynamic_pointer_cast<sbuild::chroot::btrfs_snapshot>(chroot); CPPUNIT_ASSERT(c); - c->set_source_subvolume("chroot/invalid"); + sbuild::chroot::facet::btrfs_snapshot::ptr bfac = chroot->get_facet_strict<sbuild::chroot::facet::btrfs_snapshot>(); + bfac->set_source_subvolume("chroot/invalid"); } void @@ -133,7 +139,8 @@ public: { std::shared_ptr<sbuild::chroot::btrfs_snapshot> c = std::dynamic_pointer_cast<sbuild::chroot::btrfs_snapshot>(chroot); CPPUNIT_ASSERT(c); - c->set_snapshot_directory("chroot/invalid"); + sbuild::chroot::facet::btrfs_snapshot::ptr bfac = chroot->get_facet_strict<sbuild::chroot::facet::btrfs_snapshot>(); + bfac->set_snapshot_directory("chroot/invalid"); } void @@ -141,7 +148,8 @@ public: { std::shared_ptr<sbuild::chroot::btrfs_snapshot> c = std::dynamic_pointer_cast<sbuild::chroot::btrfs_snapshot>(chroot); CPPUNIT_ASSERT(c); - c->set_snapshot_name("invalid"); + sbuild::chroot::facet::btrfs_snapshot::ptr bfac = chroot->get_facet_strict<sbuild::chroot::facet::btrfs_snapshot>(); + bfac->set_snapshot_name("invalid"); } void test_chroot_type() |