def _create_image(self): LOG.debug('Creating loop device (file: %s, size: %s)', self.path, self._size) devname = loop.mkloop(self.path, size=self._size, quick=True) LOG.debug('Created loop device %s associated with file %s', devname, self.path) return devname
def setUp(self): self.vg0_name = 'vgtest' self.lv0_name = 'data' self.file_name = '/tmp/ph%s' % randint(11, 99) self.ph_device = mkloop(self.file_name, size=self.PH_SIZE) self.vg0 = self.lv0 = self.lvs = None self.lvm = Lvm2() '''
def setUp(self): self.filenames = [] self.devices = [] self.mpoints = ('/mnt/storage', '/mnt/snapshot', '/mnt/storage2') self.vols = [None, None, None] for i in range(3): self.filenames.append('/tmp/pv%s' % randint(11, 99)) self.devices.append(mkloop(self.filenames[i], size=100, quick=False)) if not os.path.exists(self.mpoints[i]): os.makedirs(self.mpoints[i])
def setUp(self): self.filenames = [] self.devices = [] self.mpoints = ('/mnt/storage', '/mnt/snapshot', '/mnt/storage2') self.vols = [None, None, None] for i in range(3): self.filenames.append('/tmp/pv%s' % randint(11, 99)) self.devices.append( mkloop(self.filenames[i], size=100, quick=False)) if not os.path.exists(self.mpoints[i]): os.makedirs(self.mpoints[i])
def setUp(self): self.device = mkloop(self.img_file, size=50)
def setUp(self): self.device = mkloop('/tmp/testvolume', size=100) self.mpoint = '/mnt/storage' if not os.path.exists(self.mpoint): os.makedirs(self.mpoint)
def test_create_on_exiting_file(self): system('/bin/dd if=/dev/zero of=%s bs=1M seek=%d count=1' % (self.filename, self.SIZE-1), shell=True) self.loop = mkloop(self.filename) self.assert_size()
def test_create(self): t1 = time.time() self.loop = mkloop(self.filename, size=self.SIZE, quick=False) t2 = time.time() self.assertTrue(t2 - t1 > 0.1) self.assert_size()
def setUp(self): self.filename = '/tmp/pv%s' % randint(11, 99) self.device = mkloop(self.filename, size=50, quick=True) self.mpoint = '/mnt/ephstorage' if not os.path.exists(self.mpoint): os.makedirs(self.mpoint)