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

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