예제 #1
0
파일: sriov_test.py 프로젝트: nirs/vdsm
    def test_upgrade_devices_sriov_config(self):
        old_cfg = {PCI1: 2, PCI2: 5}

        new_cfg = sriov.upgrade_devices_sriov_config(old_cfg)

        expected_new_cfg = {DEV0: {'sriov': {'numvfs': 2}},
                            DEV1: {'sriov': {'numvfs': 5}}}
        self.assertEqual(new_cfg, expected_new_cfg)
예제 #2
0
    def test_upgrade_devices_sriov_config(self):
        old_cfg = {PCI1: 2, PCI2: 5}

        new_cfg = sriov.upgrade_devices_sriov_config(old_cfg)

        expected_new_cfg = {DEV0: {'sriov': {'numvfs': 2}},
                            DEV1: {'sriov': {'numvfs': 5}}}
        self.assertEqual(new_cfg, expected_new_cfg)
예제 #3
0
파일: netupgrade.py 프로젝트: minqf/vdsm
def _upgrade_sriov_config(devices, old_sriov_confpath):

    old_config = sriov.get_old_persisted_devices_numvfs(old_sriov_confpath)
    new_config = sriov.upgrade_devices_sriov_config(old_config)

    for devname in new_config:
        devices.setdefault(devname, {}).update(new_config[devname])

    shutil.rmtree(old_sriov_confpath)
예제 #4
0
파일: netupgrade.py 프로젝트: nirs/vdsm
def _upgrade_sriov_config(devices, old_sriov_confpath):

    old_config = sriov.get_old_persisted_devices_numvfs(old_sriov_confpath)
    new_config = sriov.upgrade_devices_sriov_config(old_config)

    for devname in new_config:
        devices.setdefault(devname, {}).update(new_config[devname])

    shutil.rmtree(old_sriov_confpath)