|
|
ba34c6 |
From 129a25f9854930928351c8cc3913a5b9a1c558b4 Mon Sep 17 00:00:00 2001
|
|
|
ba34c6 |
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
|
ba34c6 |
Date: Wed, 31 Oct 2018 15:23:45 +0000
|
|
|
c0ee7c |
Subject: [PATCH 10/25] aws: Add regression test for AWS on KVM on x86_64
|
|
|
ba34c6 |
architecture.
|
|
|
ba34c6 |
|
|
|
ba34c6 |
---
|
|
|
ba34c6 |
Makefile.am | 6 ++
|
|
|
ba34c6 |
tests/aws-kvm-x86/proc/cpuinfo | 52 ++++++++++++++
|
|
|
ba34c6 |
tests/aws-kvm-x86/proc/self/status | 46 +++++++++++++
|
|
|
ba34c6 |
tests/aws-kvm-x86/sbin/dmidecode | 68 +++++++++++++++++++
|
|
|
ba34c6 |
tests/aws-kvm-x86/sbin/uname | 2 +
|
|
|
ba34c6 |
tests/aws-kvm-x86/sbin/virt-what-cpuid-helper | 2 +
|
|
|
ba34c6 |
tests/test-aws-kvm-x86.sh | 35 ++++++++++
|
|
|
ba34c6 |
7 files changed, 211 insertions(+)
|
|
|
ba34c6 |
create mode 100644 tests/aws-kvm-x86/proc/cpuinfo
|
|
|
ba34c6 |
create mode 100644 tests/aws-kvm-x86/proc/self/status
|
|
|
ba34c6 |
create mode 100755 tests/aws-kvm-x86/sbin/dmidecode
|
|
|
ba34c6 |
create mode 100755 tests/aws-kvm-x86/sbin/uname
|
|
|
ba34c6 |
create mode 100755 tests/aws-kvm-x86/sbin/virt-what-cpuid-helper
|
|
|
ba34c6 |
create mode 100755 tests/test-aws-kvm-x86.sh
|
|
|
ba34c6 |
|
|
|
ba34c6 |
diff --git a/Makefile.am b/Makefile.am
|
|
|
ba34c6 |
index 3c0d5ba..1029902 100644
|
|
|
ba34c6 |
--- a/Makefile.am
|
|
|
ba34c6 |
+++ b/Makefile.am
|
|
|
ba34c6 |
@@ -39,6 +39,7 @@ virt-what.txt: virt-what.pod
|
|
|
ba34c6 |
endif
|
|
|
ba34c6 |
|
|
|
ba34c6 |
TESTS = \
|
|
|
ba34c6 |
+ tests/test-aws-kvm-x86.sh \
|
|
|
ba34c6 |
tests/test-baremetal.sh \
|
|
|
ba34c6 |
tests/test-bhyve.sh \
|
|
|
ba34c6 |
tests/test-docker.sh \
|
|
|
ba34c6 |
@@ -73,6 +74,11 @@ TESTS = \
|
|
|
ba34c6 |
EXTRA_DIST = \
|
|
|
ba34c6 |
virt-what.in \
|
|
|
ba34c6 |
virt-what.pod \
|
|
|
ba34c6 |
+ tests/aws-kvm-x86/proc/cpuinfo \
|
|
|
ba34c6 |
+ tests/aws-kvm-x86/proc/self/status \
|
|
|
ba34c6 |
+ tests/aws-kvm-x86/sbin/dmidecode \
|
|
|
ba34c6 |
+ tests/aws-kvm-x86/sbin/uname \
|
|
|
ba34c6 |
+ tests/aws-kvm-x86/sbin/virt-what-cpuid-helper \
|
|
|
ba34c6 |
tests/baremetal/proc/cpuinfo \
|
|
|
ba34c6 |
tests/baremetal/proc/self/status \
|
|
|
ba34c6 |
tests/baremetal/sbin/dmidecode \
|
|
|
ba34c6 |
diff --git a/tests/aws-kvm-x86/proc/cpuinfo b/tests/aws-kvm-x86/proc/cpuinfo
|
|
|
ba34c6 |
new file mode 100644
|
|
|
ba34c6 |
index 0000000..449f885
|
|
|
ba34c6 |
--- /dev/null
|
|
|
ba34c6 |
+++ b/tests/aws-kvm-x86/proc/cpuinfo
|
|
|
ba34c6 |
@@ -0,0 +1,52 @@
|
|
|
ba34c6 |
+processor : 0
|
|
|
ba34c6 |
+vendor_id : GenuineIntel
|
|
|
ba34c6 |
+cpu family : 6
|
|
|
ba34c6 |
+model : 85
|
|
|
ba34c6 |
+model name : Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz
|
|
|
ba34c6 |
+stepping : 3
|
|
|
ba34c6 |
+microcode : 0x1000141
|
|
|
ba34c6 |
+cpu MHz : 2999.996
|
|
|
ba34c6 |
+cache size : 25344 KB
|
|
|
ba34c6 |
+physical id : 0
|
|
|
ba34c6 |
+siblings : 2
|
|
|
ba34c6 |
+core id : 0
|
|
|
ba34c6 |
+cpu cores : 1
|
|
|
ba34c6 |
+apicid : 0
|
|
|
ba34c6 |
+initial apicid : 0
|
|
|
ba34c6 |
+fpu : yes
|
|
|
ba34c6 |
+fpu_exception : yes
|
|
|
ba34c6 |
+cpuid level : 13
|
|
|
ba34c6 |
+wp : yes
|
|
|
ba34c6 |
+flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 ida arat pku ospke
|
|
|
ba34c6 |
+bogomips : 5999.99
|
|
|
ba34c6 |
+clflush size : 64
|
|
|
ba34c6 |
+cache_alignment : 64
|
|
|
ba34c6 |
+address sizes : 46 bits physical, 48 bits virtual
|
|
|
ba34c6 |
+power management:
|
|
|
ba34c6 |
+
|
|
|
ba34c6 |
+processor : 1
|
|
|
ba34c6 |
+vendor_id : GenuineIntel
|
|
|
ba34c6 |
+cpu family : 6
|
|
|
ba34c6 |
+model : 85
|
|
|
ba34c6 |
+model name : Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz
|
|
|
ba34c6 |
+stepping : 3
|
|
|
ba34c6 |
+microcode : 0x1000141
|
|
|
ba34c6 |
+cpu MHz : 2999.996
|
|
|
ba34c6 |
+cache size : 25344 KB
|
|
|
ba34c6 |
+physical id : 0
|
|
|
ba34c6 |
+siblings : 2
|
|
|
ba34c6 |
+core id : 0
|
|
|
ba34c6 |
+cpu cores : 1
|
|
|
ba34c6 |
+apicid : 1
|
|
|
ba34c6 |
+initial apicid : 1
|
|
|
ba34c6 |
+fpu : yes
|
|
|
ba34c6 |
+fpu_exception : yes
|
|
|
ba34c6 |
+cpuid level : 13
|
|
|
ba34c6 |
+wp : yes
|
|
|
ba34c6 |
+flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 ida arat pku ospke
|
|
|
ba34c6 |
+bogomips : 5999.99
|
|
|
ba34c6 |
+clflush size : 64
|
|
|
ba34c6 |
+cache_alignment : 64
|
|
|
ba34c6 |
+address sizes : 46 bits physical, 48 bits virtual
|
|
|
ba34c6 |
+power management:
|
|
|
ba34c6 |
+
|
|
|
ba34c6 |
diff --git a/tests/aws-kvm-x86/proc/self/status b/tests/aws-kvm-x86/proc/self/status
|
|
|
ba34c6 |
new file mode 100644
|
|
|
ba34c6 |
index 0000000..5baf8de
|
|
|
ba34c6 |
--- /dev/null
|
|
|
ba34c6 |
+++ b/tests/aws-kvm-x86/proc/self/status
|
|
|
ba34c6 |
@@ -0,0 +1,46 @@
|
|
|
ba34c6 |
+Name: cat
|
|
|
ba34c6 |
+Umask: 0022
|
|
|
ba34c6 |
+State: R (running)
|
|
|
ba34c6 |
+Tgid: 20776
|
|
|
ba34c6 |
+Ngid: 0
|
|
|
ba34c6 |
+Pid: 20776
|
|
|
ba34c6 |
+PPid: 17444
|
|
|
ba34c6 |
+TracerPid: 0
|
|
|
ba34c6 |
+Uid: 0 0 0 0
|
|
|
ba34c6 |
+Gid: 0 0 0 0
|
|
|
ba34c6 |
+FDSize: 256
|
|
|
ba34c6 |
+Groups: 0
|
|
|
ba34c6 |
+VmPeak: 107972 kB
|
|
|
ba34c6 |
+VmSize: 107972 kB
|
|
|
ba34c6 |
+VmLck: 0 kB
|
|
|
ba34c6 |
+VmPin: 0 kB
|
|
|
ba34c6 |
+VmHWM: 360 kB
|
|
|
ba34c6 |
+VmRSS: 360 kB
|
|
|
ba34c6 |
+RssAnon: 76 kB
|
|
|
ba34c6 |
+RssFile: 284 kB
|
|
|
ba34c6 |
+RssShmem: 0 kB
|
|
|
ba34c6 |
+VmData: 180 kB
|
|
|
ba34c6 |
+VmStk: 132 kB
|
|
|
ba34c6 |
+VmExe: 44 kB
|
|
|
ba34c6 |
+VmLib: 1936 kB
|
|
|
ba34c6 |
+VmPTE: 36 kB
|
|
|
ba34c6 |
+VmSwap: 0 kB
|
|
|
ba34c6 |
+Threads: 1
|
|
|
ba34c6 |
+SigQ: 1/14026
|
|
|
ba34c6 |
+SigPnd: 0000000000000000
|
|
|
ba34c6 |
+ShdPnd: 0000000000000000
|
|
|
ba34c6 |
+SigBlk: 0000000000000000
|
|
|
ba34c6 |
+SigIgn: 0000000000000000
|
|
|
ba34c6 |
+SigCgt: 0000000000000000
|
|
|
ba34c6 |
+CapInh: 0000000000000000
|
|
|
ba34c6 |
+CapPrm: 0000001fffffffff
|
|
|
ba34c6 |
+CapEff: 0000001fffffffff
|
|
|
ba34c6 |
+CapBnd: 0000001fffffffff
|
|
|
ba34c6 |
+CapAmb: 0000000000000000
|
|
|
ba34c6 |
+Seccomp: 0
|
|
|
ba34c6 |
+Cpus_allowed: 3
|
|
|
ba34c6 |
+Cpus_allowed_list: 0-1
|
|
|
ba34c6 |
+Mems_allowed: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001
|
|
|
ba34c6 |
+Mems_allowed_list: 0
|
|
|
ba34c6 |
+voluntary_ctxt_switches: 1
|
|
|
ba34c6 |
+nonvoluntary_ctxt_switches: 1
|
|
|
ba34c6 |
diff --git a/tests/aws-kvm-x86/sbin/dmidecode b/tests/aws-kvm-x86/sbin/dmidecode
|
|
|
ba34c6 |
new file mode 100755
|
|
|
ba34c6 |
index 0000000..3b5aa03
|
|
|
ba34c6 |
--- /dev/null
|
|
|
ba34c6 |
+++ b/tests/aws-kvm-x86/sbin/dmidecode
|
|
|
ba34c6 |
@@ -0,0 +1,68 @@
|
|
|
ba34c6 |
+#!/bin/sh -
|
|
|
ba34c6 |
+cat <<'EOF'
|
|
|
ba34c6 |
+# dmidecode 3.0
|
|
|
ba34c6 |
+Getting SMBIOS data from sysfs.
|
|
|
ba34c6 |
+SMBIOS 2.7 present.
|
|
|
ba34c6 |
+5 structures occupying 233 bytes.
|
|
|
ba34c6 |
+Table at 0x000F8FD0.
|
|
|
ba34c6 |
+
|
|
|
ba34c6 |
+Handle 0x0000, DMI type 0, 24 bytes
|
|
|
ba34c6 |
+BIOS Information
|
|
|
ba34c6 |
+ Vendor: Amazon EC2
|
|
|
ba34c6 |
+ Version: 1.0
|
|
|
ba34c6 |
+ Release Date: 10/16/2017
|
|
|
ba34c6 |
+ Address: 0xF0000
|
|
|
ba34c6 |
+ Runtime Size: 64 kB
|
|
|
ba34c6 |
+ ROM Size: 64 kB
|
|
|
ba34c6 |
+ Characteristics:
|
|
|
ba34c6 |
+ PCI is supported
|
|
|
ba34c6 |
+ EDD is supported
|
|
|
ba34c6 |
+ ACPI is supported
|
|
|
ba34c6 |
+ System is a virtual machine
|
|
|
ba34c6 |
+ BIOS Revision: 1.0
|
|
|
ba34c6 |
+
|
|
|
ba34c6 |
+Handle 0x0001, DMI type 1, 27 bytes
|
|
|
ba34c6 |
+System Information
|
|
|
ba34c6 |
+ Manufacturer: Amazon EC2
|
|
|
ba34c6 |
+ Product Name: c5.large
|
|
|
ba34c6 |
+ Version: Not Specified
|
|
|
ba34c6 |
+ Serial Number: ec2cecdd-c1c8-7a71-0ea8-aef580c9f845
|
|
|
ba34c6 |
+ UUID: EC2CECDD-C1C8-7A71-0EA8-AEF580C9F845
|
|
|
ba34c6 |
+ Wake-up Type: Power Switch
|
|
|
ba34c6 |
+ SKU Number: Not Specified
|
|
|
ba34c6 |
+ Family: Not Specified
|
|
|
ba34c6 |
+
|
|
|
ba34c6 |
+Handle 0x0002, DMI type 2, 15 bytes
|
|
|
ba34c6 |
+Base Board Information
|
|
|
ba34c6 |
+ Manufacturer: Amazon EC2
|
|
|
ba34c6 |
+ Product Name: Not Specified
|
|
|
ba34c6 |
+ Version: Not Specified
|
|
|
ba34c6 |
+ Serial Number: Not Specified
|
|
|
ba34c6 |
+ Asset Tag: i-04f9b1c56b3c301b5
|
|
|
ba34c6 |
+ Features: None
|
|
|
ba34c6 |
+ Location In Chassis: Not Specified
|
|
|
ba34c6 |
+ Chassis Handle: 0x0003
|
|
|
ba34c6 |
+ Type: Other
|
|
|
ba34c6 |
+ Contained Object Handles: 0
|
|
|
ba34c6 |
+
|
|
|
ba34c6 |
+Handle 0x0003, DMI type 3, 21 bytes
|
|
|
ba34c6 |
+Chassis Information
|
|
|
ba34c6 |
+ Manufacturer: Amazon EC2
|
|
|
ba34c6 |
+ Type: Other
|
|
|
ba34c6 |
+ Lock: Not Present
|
|
|
ba34c6 |
+ Version: Not Specified
|
|
|
ba34c6 |
+ Serial Number: Not Specified
|
|
|
ba34c6 |
+ Asset Tag: Amazon EC2
|
|
|
ba34c6 |
+ Boot-up State: Safe
|
|
|
ba34c6 |
+ Power Supply State: Safe
|
|
|
ba34c6 |
+ Thermal State: Safe
|
|
|
ba34c6 |
+ Security Status: None
|
|
|
ba34c6 |
+ OEM Information: 0x00000000
|
|
|
ba34c6 |
+ Height: Unspecified
|
|
|
ba34c6 |
+ Number Of Power Cords: 1
|
|
|
ba34c6 |
+ Contained Elements: 0
|
|
|
ba34c6 |
+
|
|
|
ba34c6 |
+Handle 0x0004, DMI type 127, 4 bytes
|
|
|
ba34c6 |
+End Of Table
|
|
|
ba34c6 |
+
|
|
|
ba34c6 |
+EOF
|
|
|
ba34c6 |
diff --git a/tests/aws-kvm-x86/sbin/uname b/tests/aws-kvm-x86/sbin/uname
|
|
|
ba34c6 |
new file mode 100755
|
|
|
ba34c6 |
index 0000000..ab0ec89
|
|
|
ba34c6 |
--- /dev/null
|
|
|
ba34c6 |
+++ b/tests/aws-kvm-x86/sbin/uname
|
|
|
ba34c6 |
@@ -0,0 +1,2 @@
|
|
|
ba34c6 |
+#!/bin/sh -
|
|
|
ba34c6 |
+echo x86_64
|
|
|
ba34c6 |
diff --git a/tests/aws-kvm-x86/sbin/virt-what-cpuid-helper b/tests/aws-kvm-x86/sbin/virt-what-cpuid-helper
|
|
|
ba34c6 |
new file mode 100755
|
|
|
ba34c6 |
index 0000000..f52a9d7
|
|
|
ba34c6 |
--- /dev/null
|
|
|
ba34c6 |
+++ b/tests/aws-kvm-x86/sbin/virt-what-cpuid-helper
|
|
|
ba34c6 |
@@ -0,0 +1,2 @@
|
|
|
ba34c6 |
+#!/bin/sh -
|
|
|
ba34c6 |
+echo KVMKVMKVM
|
|
|
ba34c6 |
diff --git a/tests/test-aws-kvm-x86.sh b/tests/test-aws-kvm-x86.sh
|
|
|
ba34c6 |
new file mode 100755
|
|
|
ba34c6 |
index 0000000..db4c19f
|
|
|
ba34c6 |
--- /dev/null
|
|
|
ba34c6 |
+++ b/tests/test-aws-kvm-x86.sh
|
|
|
ba34c6 |
@@ -0,0 +1,35 @@
|
|
|
ba34c6 |
+# Test for AWS.
|
|
|
ba34c6 |
+# Copyright (C) 2018 Red Hat Inc.
|
|
|
ba34c6 |
+#
|
|
|
ba34c6 |
+# This program is free software; you can redistribute it and/or modify
|
|
|
ba34c6 |
+# it under the terms of the GNU General Public License as published by
|
|
|
ba34c6 |
+# the Free Software Foundation; either version 2 of the License, or
|
|
|
ba34c6 |
+# (at your option) any later version.
|
|
|
ba34c6 |
+#
|
|
|
ba34c6 |
+# This program is distributed in the hope that it will be useful,
|
|
|
ba34c6 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
ba34c6 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
ba34c6 |
+# GNU General Public License for more details.
|
|
|
ba34c6 |
+#
|
|
|
ba34c6 |
+# You should have received a copy of the GNU General Public License
|
|
|
ba34c6 |
+# along with this program; if not, write to the Free Software
|
|
|
ba34c6 |
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
ba34c6 |
+
|
|
|
ba34c6 |
+root=tests/aws-kvm-x86
|
|
|
ba34c6 |
+
|
|
|
ba34c6 |
+output="$(./virt-what --test-root=$root 2>&1)"
|
|
|
ba34c6 |
+expected="kvm
|
|
|
ba34c6 |
+aws"
|
|
|
ba34c6 |
+
|
|
|
ba34c6 |
+if [ "$output" != "$expected" ]; then
|
|
|
ba34c6 |
+ echo "$0: test failed because output did not match expected"
|
|
|
ba34c6 |
+ echo "Expected output was:"
|
|
|
ba34c6 |
+ echo "----------------------------------------"
|
|
|
ba34c6 |
+ echo "$expected"
|
|
|
ba34c6 |
+ echo "----------------------------------------"
|
|
|
ba34c6 |
+ echo "But the actual output of the program was:"
|
|
|
ba34c6 |
+ echo "----------------------------------------"
|
|
|
ba34c6 |
+ echo "$output"
|
|
|
ba34c6 |
+ echo "----------------------------------------"
|
|
|
ba34c6 |
+ exit 1
|
|
|
ba34c6 |
+fi
|
|
|
ba34c6 |
--
|
|
|
c0ee7c |
2.18.4
|
|
|
ba34c6 |
|