示例#1
0
 def test_map_partitions(self):
     self.disk.add_part(1, 1023, 'ext3', '/')
     self.disk.partition()
     self.disk.map_partitions()
     try:
         from VMBuilder.disk import detect_size
         self.assertEqual(detect_size(self.disk.partitions[0].filename), 1023000576)
     except:
         raise
     finally:
         self.disk.unmap()
示例#2
0
 def test_detect_size_loopback_dev(self):
     self.imgdev = run_cmd('losetup', '-f', '--show', self.tmpfile).strip()
     self.assertTrue(detect_size(self.imgdev), 5*1024)
示例#3
0
 def test_detect_size_file(self):
     self.assertTrue(detect_size(self.tmpfile), 5*1024)