--- /dev/null
+#!/bin/sh -
+cat <<'EOF'
+# dmidecode 3.3
+Getting SMBIOS data from sysfs.
+SMBIOS 3.1.0 present.
+Table at 0x3FD63000.
+
+Handle 0x0000, DMI type 0, 26 bytes
+BIOS Information
+ Vendor: Microsoft Corporation
+ Version: Hyper-V UEFI Release v4.1
+ Release Date: 11/28/2023
+ ROM Size: 64 kB
+ Characteristics:
+ BIOS characteristics not supported
+ ACPI is supported
+ Targeted content distribution is supported
+ UEFI is supported
+ System is a virtual machine
+ BIOS Revision: 4.1
+
+Handle 0x0001, DMI type 1, 27 bytes
+System Information
+ Manufacturer: Microsoft Corporation
+ Product Name: Virtual Machine
+ Version: Hyper-V UEFI Release v4.1
+ Serial Number: 0000-0011-3798-4833-3781-8467-28
+ UUID: 9ded57c4-3ce3-4ac8-aaaf-2c4ccf6e7a59
+ Wake-up Type: Power Switch
+ SKU Number: None
+ Family: Virtual Machine
+
+Handle 0x0002, DMI type 3, 24 bytes
+Chassis Information
+ Manufacturer: Microsoft Corporation
+ Type: Desktop
+ Lock: Not Present
+ Version: Hyper-V UEFI Release v4.1
+ Serial Number: 6708-6940-4856-4751-7507-5546-20
+ Asset Tag: 7783-7084-3265-9085-8269-3286-77
+ Boot-up State: Safe
+ Power Supply State: Safe
+ Thermal State: Safe
+ Security Status: Unknown
+ OEM Information: 0x00000000
+ Height: Unspecified
+ Number Of Power Cords: Unspecified
+ Contained Elements: 0
+ SKU Number: Virtual Machine
+
+Handle 0x0003, DMI type 2, 17 bytes
+Base Board Information
+ Manufacturer: Microsoft Corporation
+ Product Name: Virtual Machine
+ Version: Hyper-V UEFI Release v4.1
+ Serial Number: 0000-0012-2990-9781-5781-3745-53
+ Asset Tag: None
+ Features:
+ Board is a hosting board
+ Location In Chassis: Virtual Machine
+ Chassis Handle: 0x0002
+ Type: Motherboard
+ Contained Object Handles: 0
+
+Handle 0x0004, DMI type 4, 48 bytes
+Processor Information
+ Socket Designation: None
+ Type: Central Processor
+ Family: ARMv8
+ Manufacturer: Ampere(R)
+ ID: 00 00 00 00 00 00 00 00
+ Version: Ampere(R) Altra(R) Processor
+ Voltage: 1.0 V
+ External Clock: 1650 MHz
+ Max Speed: 3000 MHz
+ Current Speed: 3000 MHz
+ Status: Populated, Enabled
+ Upgrade: None
+ L1 Cache Handle: Not Provided
+ L2 Cache Handle: Not Provided
+ L3 Cache Handle: Not Provided
+ Serial Number: None
+ Asset Tag: None
+ Part Number: None
+ Core Count: 2
+ Core Enabled: 2
+ Thread Count: 1
+ Characteristics:
+ 64-bit capable
+ Multi-Core
+ Power/Performance Control
+ 128-bit Capable
+ Arm64 SoC ID
+
+Handle 0x0005, DMI type 11, 5 bytes
+OEM Strings
+ String 1: [MS_VM_CERT/SHA1/9b80ca0d5dd061ec9da4e494f4c3fd1196270c22]
+ String 2: 00000000000000000000000000000000
+ String 3: To be filled by OEM
+
+Handle 0x0006, DMI type 16, 23 bytes
+Physical Memory Array
+ Location: System Board Or Motherboard
+ Use: System Memory
+ Error Correction Type: None
+ Maximum Capacity: 0 bytes
+ Error Information Handle: Not Provided
+ Number Of Devices: 2
+
+Handle 0x0007, DMI type 17, 92 bytes
+Memory Device
+ Array Handle: 0x0006
+ Error Information Handle: Not Provided
+ Total Width: Unknown
+ Data Width: Unknown
+ Size: 1 GB
+ Form Factor: Unknown
+ Set: None
+ Locator: M0001
+ Bank Locator: None
+ Type: Unknown
+ Type Detail: Unknown
+ Speed: Unknown
+ Manufacturer: Microsoft Corporation
+ Serial Number: None
+ Asset Tag: None
+ Part Number: None
+ Rank: Unknown
+ Configured Memory Speed: Unknown
+ Minimum Voltage: Unknown
+ Maximum Voltage: Unknown
+ Configured Voltage: Unknown
+ Memory Technology: <OUT OF SPEC>
+ Memory Operating Mode Capability: None
+ Firmware Version: Not Specified
+ Module Manufacturer ID: Unknown
+ Module Product ID: Unknown
+ Memory Subsystem Controller Manufacturer ID: Unknown
+ Memory Subsystem Controller Product ID: Unknown
+ Non-Volatile Size: None
+ Volatile Size: None
+ Cache Size: None
+ Logical Size: None
+
+Handle 0x0008, DMI type 19, 31 bytes
+Memory Array Mapped Address
+ Starting Address: 0x00000000000
+ Ending Address: 0x000400003FF
+ Range Size: 1 GB
+ Physical Array Handle: 0x0006
+ Partition Width: 0
+
+Handle 0x0009, DMI type 20, 35 bytes
+Memory Device Mapped Address
+ Starting Address: 0x00000000000
+ Ending Address: 0x000400003FF
+ Range Size: 1 GB
+ Physical Device Handle: 0x0007
+ Memory Array Mapped Address Handle: 0x0008
+ Partition Row Position: Unknown
+
+Handle 0x000A, DMI type 17, 92 bytes
+Memory Device
+ Array Handle: 0x0006
+ Error Information Handle: Not Provided
+ Total Width: Unknown
+ Data Width: Unknown
+ Size: 7 GB
+ Form Factor: Unknown
+ Set: None
+ Locator: M0002
+ Bank Locator: None
+ Type: Unknown
+ Type Detail: Unknown
+ Speed: Unknown
+ Manufacturer: Microsoft Corporation
+ Serial Number: None
+ Asset Tag: None
+ Part Number: None
+ Rank: Unknown
+ Configured Memory Speed: Unknown
+ Minimum Voltage: Unknown
+ Maximum Voltage: Unknown
+ Configured Voltage: Unknown
+ Memory Technology: <OUT OF SPEC>
+ Memory Operating Mode Capability: None
+ Firmware Version: Not Specified
+ Module Manufacturer ID: Unknown
+ Module Product ID: Unknown
+ Memory Subsystem Controller Manufacturer ID: Unknown
+ Memory Subsystem Controller Product ID: Unknown
+ Non-Volatile Size: None
+ Volatile Size: None
+ Cache Size: None
+ Logical Size: None
+
+Handle 0x000B, DMI type 19, 31 bytes
+Memory Array Mapped Address
+ Starting Address: 0x00100000000
+ Ending Address: 0x002C00003FF
+ Range Size: 7 GB
+ Physical Array Handle: 0x0006
+ Partition Width: 0
+
+Handle 0x000C, DMI type 20, 35 bytes
+Memory Device Mapped Address
+ Starting Address: 0x00100000000
+ Ending Address: 0x002C00003FF
+ Range Size: 7 GB
+ Physical Device Handle: 0x000A
+ Memory Array Mapped Address Handle: 0x000B
+ Partition Row Position: Unknown
+
+Handle 0x000D, DMI type 32, 11 bytes
+System Boot Information
+ Status: No errors detected
+
+Handle 0xFEFF, DMI type 127, 4 bytes
+End Of Table
+
+EOF
--- /dev/null
+# Test for Microsoft HyperV.
+# Copyright (C) 2008-2024 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+output="$(PATH=../..:$PATH virt-what --test-root=. 2>&1)"
+expected="hyperv"
+
+if [ "$output" != "$expected" ]; then
+ echo "$0: test failed because output did not match expected"
+ echo "Expected output was:"
+ echo "----------------------------------------"
+ echo "$expected"
+ echo "----------------------------------------"
+ echo "But the actual output of the program was:"
+ echo "----------------------------------------"
+ echo "$output"
+ echo "----------------------------------------"
+ exit 1
+fi