Blame SOURCES/0010-aws-Add-regression-test-for-AWS-on-KVM-on-x86_64-arc.patch

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