def test_available_resource(self):
        driver = self._get_driver()
        driver._session.product_version = (6, 8, 2)

        self.stubs.Set(driver.host_state, 'get_host_stats', self.host_stats)

        resources = driver.get_available_resource(None)
        self.assertEqual(6008002, resources['hypervisor_version'])
        self.assertEqual(50, resources['vcpus'])
        self.assertEqual(3, resources['memory_mb'])
        self.assertEqual(5, resources['local_gb'])
        self.assertEqual(10, resources['vcpus_used'])
        self.assertEqual(3 - 2, resources['memory_mb_used'])
        self.assertEqual(2, resources['local_gb_used'])
        self.assertEqual('XenServer', resources['hypervisor_type'])
        self.assertEqual('somename', resources['hypervisor_hostname'])
        self.assertEqual(1, resources['disk_available_least'])
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/virt/xenapi/test_driver.py/XenAPIDriverTestCase.test_available_resource/original