tests: is_iommu_supported function

QubesOS/qubes-issues#4689
This commit is contained in:
Marek Marczykowski-Górecki 2019-11-12 22:45:30 +01:00
parent 77cf310c47
commit 7de9f3e078
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -153,6 +153,56 @@ class TC_20_QubesHost(qubes.tests.QubesTestCase):
('xc.domain_getinfo', (1, 1), {}), ('xc.domain_getinfo', (1, 1), {}),
]) ])
def test_010_iommu_supported(self):
self.app.vmm.configure_mock(**{
'xc.physinfo.return_value': {
'hw_caps': '...',
'scrub_memory': 0,
'virt_caps': 'hvm hvm_directio',
'nr_cpus': 4,
'threads_per_core': 1,
'cpu_khz': 3400001,
'nr_nodes': 1,
'free_memory': 234752,
'cores_per_socket': 4,
'total_memory': 16609720
}
})
self.assertEqual(self.qubes_host.is_iommu_supported(), True)
def test_011_iommu_supported(self):
self.app.vmm.configure_mock(**{
'xc.physinfo.return_value': {
'hw_caps': '...',
'scrub_memory': 0,
'virt_caps': 'hvm hvm_directio pv pv_directio',
'nr_cpus': 4,
'threads_per_core': 1,
'cpu_khz': 3400001,
'nr_nodes': 1,
'free_memory': 234752,
'cores_per_socket': 4,
'total_memory': 16609720
}
})
self.assertEqual(self.qubes_host.is_iommu_supported(), True)
def test_010_iommu_supported(self):
self.app.vmm.configure_mock(**{
'xc.physinfo.return_value': {
'hw_caps': '...',
'scrub_memory': 0,
'virt_caps': 'hvm pv',
'nr_cpus': 4,
'threads_per_core': 1,
'cpu_khz': 3400001,
'nr_nodes': 1,
'free_memory': 234752,
'cores_per_socket': 4,
'total_memory': 16609720
}
})
self.assertEqual(self.qubes_host.is_iommu_supported(), False)
class TC_30_VMCollection(qubes.tests.QubesTestCase): class TC_30_VMCollection(qubes.tests.QubesTestCase):