Example #1
0
 def testLoopDevice(self):
     test_ld = False
     if test_ld:
         self.ld = LoopDevice()
         self.ld.read_partitions(test_mmap_file)
         self.ld.check_img_size(test_img_size_mb)
         self.assertRaises(DeviceException, self.ld.check_img_size, 1)
         self.ld.attach_device(test_img, test_img_size_mb)
         self.assertTrue(self.ld.size_cyl >= self.ld.min_cyl_size())
         self.ld.create_partitions()
         self.ld.attach_partitions(test_img)
         self.ld.format_partitions()
         self.ld.mount(test_work_dir)
         self.ld.unmount()
         self.ld.optimize_filesystems()
         self.ld.check_filesystems()
         self.ld.detach_partitions()
         self.ld.detach_device()