Skip to content

Commit 4058376

Browse files
ch test: Check if /dev/kvm exist (#3866)
With older baremetal server, lscpu wont expose virtualisation feature details (VT-x or AMD-V) This will cause CH test to be skipped when runs on Ubuntu-KVM with older generation windows machine. Fix it by checking if /dev/kvm exist Signed-off-by: Smit Gardhariya <sgardhariya@microsoft.com>
1 parent 689ed7b commit 4058376

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

microsoft/testsuites/cloud_hypervisor/ch_tests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ def verify_cloud_hypervisor_performance_metrics_tests(
168168
def _ensure_virtualization_enabled(self, node: Node) -> None:
169169
virtualization_enabled = node.tools[Lscpu].is_virtualization_enabled()
170170
mshv_exists = node.tools[Ls].path_exists(path="/dev/mshv", sudo=True)
171-
if not virtualization_enabled and not mshv_exists:
171+
kvm_exists = node.tools[Ls].path_exists(path="/dev/kvm", sudo=True)
172+
if not virtualization_enabled and not mshv_exists and not kvm_exists:
172173
raise SkippedException("Virtualization is not enabled in hardware")
173174
# add user to mshv group for access to /dev/mshv
174175
if mshv_exists:

0 commit comments

Comments
 (0)