コード例 #1
0
ファイル: fakelib_test.py プロジェクト: xin49/vdsm
 def test_lv_size_rounding(self):
     vg_name = 'foo'
     lv_name = 'bar'
     devices = ['360014054d75cb132d474c0eae9825766']
     with namedTemporaryDir() as tmpdir:
         lvm = FakeLVM(tmpdir)
         lvm.createVG(vg_name, devices, blockSD.STORAGE_UNREADY_DOMAIN_TAG,
                      blockSD.VG_METADATASIZE)
         lvm.createLV(vg_name, lv_name, sc.VG_EXTENT_SIZE_MB - 1)
         lv = lvm.getLV(vg_name, lv_name)
         self.assertEqual(sc.VG_EXTENT_SIZE_MB * MB, int(lv.size))
コード例 #2
0
ファイル: fakelib_test.py プロジェクト: nirs/vdsm
 def test_lv_size_rounding(self):
     vg_name = 'foo'
     lv_name = 'bar'
     devices = ['360014054d75cb132d474c0eae9825766']
     with namedTemporaryDir() as tmpdir:
         lvm = FakeLVM(tmpdir)
         lvm.createVG(vg_name, devices, blockSD.STORAGE_UNREADY_DOMAIN_TAG,
                      blockSD.VG_METADATASIZE)
         lvm.createLV(vg_name, lv_name, sc.VG_EXTENT_SIZE_MB - 1)
         lv = lvm.getLV(vg_name, lv_name)
         self.assertEqual(sc.VG_EXTENT_SIZE_MB * MB, int(lv.size))
コード例 #3
0
ファイル: fakelib_test.py プロジェクト: xin49/vdsm
    def base_config(self):
        """
        Create a simple volume group from a single 10G LUN.

        lvm.createVG('1ffead52-7363-4968-a8c7-3bc34504d452',
                     ['360014054d75cb132d474c0eae9825766'],
                     blockSD.STORAGE_UNREADY_DOMAIN_TAG,
                     blockSD.VG_METADATASIZE)

        print lvm.getVG('1ffead52-7363-4968-a8c7-3bc34504d452')
        VG(uuid='15hlPF-V3eG-F9Cp-SGtu-4Mq0-28Do-HC806y',
           name='1ffead52-7363-4968-a8c7-3bc34504d452',
           attr=VG_ATTR(permission='w', resizeable='z', exported='-',
                        partial='-', allocation='n', clustered='-'),
           size='10334765056', free='10334765056', extent_size='134217728',
           extent_count='77', free_count='77',
           tags=('RHAT_storage_domain_UNREADY',), vg_mda_size='134217728',
           vg_mda_free='67107328', lv_count='0', pv_count='1',
           pv_name=('/dev/mapper/360014054d75cb132d474c0eae9825766',),
           writeable=True, partial='OK')

        print lvm.getPV('360014054d75cb132d474c0eae9825766')
        PV(uuid='fIRjbD-usOA-tYgW-b2Uz-oUly-AJ49-bMMjYe',
           name='/dev/mapper/360014054d75cb132d474c0eae9825766',
           size='10334765056', vg_name='1ffead52-7363-4968-a8c7-3bc34504d452',
           vg_uuid='15hlPF-V3eG-F9Cp-SGtu-4Mq0-28Do-HC806y',
           pe_start='138412032', pe_count='77', pe_alloc_count='0',
           mda_count='2', dev_size='10737418240',
           guid='360014054d75cb132d474c0eae9825766')
        """
        with namedTemporaryDir() as tmpdir:
            lvm = FakeLVM(tmpdir)
            lvm.createVG(self.VG_NAME, self.DEVICES,
                         blockSD.STORAGE_UNREADY_DOMAIN_TAG,
                         blockSD.VG_METADATASIZE)
            yield lvm
コード例 #4
0
ファイル: fakelib_test.py プロジェクト: nirs/vdsm
    def base_config(self):
        """
        Create a simple volume group from a single 10G LUN.

        lvm.createVG('1ffead52-7363-4968-a8c7-3bc34504d452',
                     ['360014054d75cb132d474c0eae9825766'],
                     blockSD.STORAGE_UNREADY_DOMAIN_TAG,
                     blockSD.VG_METADATASIZE)

        print lvm.getVG('1ffead52-7363-4968-a8c7-3bc34504d452')
        VG(uuid='15hlPF-V3eG-F9Cp-SGtu-4Mq0-28Do-HC806y',
           name='1ffead52-7363-4968-a8c7-3bc34504d452',
           attr=VG_ATTR(permission='w', resizeable='z', exported='-',
                        partial='-', allocation='n', clustered='-'),
           size='10334765056', free='10334765056', extent_size='134217728',
           extent_count='77', free_count='77',
           tags=('RHAT_storage_domain_UNREADY',), vg_mda_size='134217728',
           vg_mda_free='67107328', lv_count='0', pv_count='1',
           pv_name=('/dev/mapper/360014054d75cb132d474c0eae9825766',),
           writeable=True, partial='OK')

        print lvm.getPV('360014054d75cb132d474c0eae9825766')
        PV(uuid='fIRjbD-usOA-tYgW-b2Uz-oUly-AJ49-bMMjYe',
           name='/dev/mapper/360014054d75cb132d474c0eae9825766',
           size='10334765056', vg_name='1ffead52-7363-4968-a8c7-3bc34504d452',
           vg_uuid='15hlPF-V3eG-F9Cp-SGtu-4Mq0-28Do-HC806y',
           pe_start='138412032', pe_count='77', pe_alloc_count='0',
           mda_count='2', dev_size='10737418240',
           guid='360014054d75cb132d474c0eae9825766')
        """
        with namedTemporaryDir() as tmpdir:
            lvm = FakeLVM(tmpdir)
            lvm.createVG(self.VG_NAME, self.DEVICES,
                         blockSD.STORAGE_UNREADY_DOMAIN_TAG,
                         blockSD.VG_METADATASIZE)
            yield lvm