Blame SOURCES/0012-aws-Add-regression-test-for-AWS-on-Xen-on-x86_64-arc.patch

e10a2d
From 350291e1ca417eab9d2aa2408589f0259cac007c 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
e10a2d
Subject: [PATCH 12/21] aws: Add regression test for AWS on Xen on x86_64
e10a2d
 architecture.
e10a2d
e10a2d
---
e10a2d
 Makefile.am                                   |   6 +
e10a2d
 tests/aws-xen-x86/proc/cpuinfo                |  52 +++++++
e10a2d
 tests/aws-xen-x86/proc/self/status            |  46 ++++++
e10a2d
 tests/aws-xen-x86/sbin/dmidecode              | 135 ++++++++++++++++++
e10a2d
 tests/aws-xen-x86/sbin/uname                  |   2 +
e10a2d
 tests/aws-xen-x86/sbin/virt-what-cpuid-helper |   2 +
e10a2d
 tests/test-aws-xen-x86.sh                     |  36 +++++
e10a2d
 7 files changed, 279 insertions(+)
e10a2d
 create mode 100644 tests/aws-xen-x86/proc/cpuinfo
e10a2d
 create mode 100644 tests/aws-xen-x86/proc/self/status
e10a2d
 create mode 100755 tests/aws-xen-x86/sbin/dmidecode
e10a2d
 create mode 100755 tests/aws-xen-x86/sbin/uname
e10a2d
 create mode 100755 tests/aws-xen-x86/sbin/virt-what-cpuid-helper
e10a2d
 create mode 100755 tests/test-aws-xen-x86.sh
e10a2d
e10a2d
diff --git a/Makefile.am b/Makefile.am
e10a2d
index ad47097..22680a0 100644
e10a2d
--- a/Makefile.am
e10a2d
+++ b/Makefile.am
e10a2d
@@ -41,6 +41,7 @@ endif
e10a2d
 TESTS = \
e10a2d
 	tests/test-aws-baremetal-x86.sh \
e10a2d
 	tests/test-aws-kvm-x86.sh \
e10a2d
+	tests/test-aws-xen-x86.sh \
e10a2d
 	tests/test-baremetal.sh \
e10a2d
 	tests/test-bhyve.sh \
e10a2d
 	tests/test-docker.sh \
e10a2d
@@ -85,6 +86,11 @@ EXTRA_DIST = \
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/aws-xen-x86/proc/cpuinfo \
e10a2d
+	tests/aws-xen-x86/proc/self/status \
e10a2d
+	tests/aws-xen-x86/sbin/dmidecode \
e10a2d
+	tests/aws-xen-x86/sbin/uname \
e10a2d
+	tests/aws-xen-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-xen-x86/proc/cpuinfo b/tests/aws-xen-x86/proc/cpuinfo
e10a2d
new file mode 100644
e10a2d
index 0000000..ff0b16b
e10a2d
--- /dev/null
e10a2d
+++ b/tests/aws-xen-x86/proc/cpuinfo
e10a2d
@@ -0,0 +1,52 @@
e10a2d
+processor	: 0
e10a2d
+vendor_id	: GenuineIntel
e10a2d
+cpu family	: 6
e10a2d
+model		: 63
e10a2d
+model name	: Intel(R) Xeon(R) CPU E5-2666 v3 @ 2.90GHz
e10a2d
+stepping	: 2
e10a2d
+microcode	: 0x3c
e10a2d
+cpu MHz		: 2900.281
e10a2d
+cache size	: 25600 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 ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology 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 fsgsbase bmi1 avx2 smep bmi2 erms invpcid xsaveopt
e10a2d
+bogomips	: 5800.06
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		: 63
e10a2d
+model name	: Intel(R) Xeon(R) CPU E5-2666 v3 @ 2.90GHz
e10a2d
+stepping	: 2
e10a2d
+microcode	: 0x3c
e10a2d
+cpu MHz		: 2900.281
e10a2d
+cache size	: 25600 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 ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology 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 fsgsbase bmi1 avx2 smep bmi2 erms invpcid xsaveopt
e10a2d
+bogomips	: 5800.06
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-xen-x86/proc/self/status b/tests/aws-xen-x86/proc/self/status
e10a2d
new file mode 100644
e10a2d
index 0000000..4e93816
e10a2d
--- /dev/null
e10a2d
+++ b/tests/aws-xen-x86/proc/self/status
e10a2d
@@ -0,0 +1,46 @@
e10a2d
+Name:	cat
e10a2d
+Umask:	0022
e10a2d
+State:	R (running)
e10a2d
+Tgid:	22828
e10a2d
+Ngid:	0
e10a2d
+Pid:	22828
e10a2d
+PPid:	17431
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:	0/14231
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:	7fff
e10a2d
+Cpus_allowed_list:	0-14
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-xen-x86/sbin/dmidecode b/tests/aws-xen-x86/sbin/dmidecode
e10a2d
new file mode 100755
e10a2d
index 0000000..bc9cde5
e10a2d
--- /dev/null
e10a2d
+++ b/tests/aws-xen-x86/sbin/dmidecode
e10a2d
@@ -0,0 +1,135 @@
e10a2d
+#!/bin/sh -
e10a2d
+cat <<'EOF'
e10a2d
+# dmidecode 3.0
e10a2d
+Getting SMBIOS data from sysfs.
e10a2d
+SMBIOS 2.7 present.
e10a2d
+12 structures occupying 398 bytes.
e10a2d
+Table at 0x000EB01F.
e10a2d
+
e10a2d
+Handle 0x0000, DMI type 0, 24 bytes
e10a2d
+BIOS Information
e10a2d
+	Vendor: Xen
e10a2d
+	Version: 4.2.amazon
e10a2d
+	Release Date: 08/24/2006
e10a2d
+	Address: 0xE8000
e10a2d
+	Runtime Size: 96 kB
e10a2d
+	ROM Size: 64 kB
e10a2d
+	Characteristics:
e10a2d
+		PCI is supported
e10a2d
+		EDD is supported
e10a2d
+		Targeted content distribution is supported
e10a2d
+	BIOS Revision: 4.2
e10a2d
+
e10a2d
+Handle 0x0100, DMI type 1, 27 bytes
e10a2d
+System Information
e10a2d
+	Manufacturer: Xen
e10a2d
+	Product Name: HVM domU
e10a2d
+	Version: 4.2.amazon
e10a2d
+	Serial Number: ec2f5c70-6dfc-83a7-f5ec-ef7b97aea4c9
e10a2d
+	UUID: EC2F5C70-6DFC-83A7-F5EC-EF7B97AEA4C9
e10a2d
+	Wake-up Type: Power Switch
e10a2d
+	SKU Number: Not Specified
e10a2d
+	Family: Not Specified
e10a2d
+
e10a2d
+Handle 0x0300, DMI type 3, 13 bytes
e10a2d
+Chassis Information
e10a2d
+	Manufacturer: Xen
e10a2d
+	Type: Other
e10a2d
+	Lock: Not Present
e10a2d
+	Version: Not Specified
e10a2d
+	Serial Number: Not Specified
e10a2d
+	Asset Tag: Not Specified
e10a2d
+	Boot-up State: Safe
e10a2d
+	Power Supply State: Safe
e10a2d
+	Thermal State: Safe
e10a2d
+	Security Status: Unknown
e10a2d
+
e10a2d
+Handle 0x0401, DMI type 4, 26 bytes
e10a2d
+Processor Information
e10a2d
+	Socket Designation: CPU 1
e10a2d
+	Type: Central Processor
e10a2d
+	Family: Other
e10a2d
+	Manufacturer: Intel
e10a2d
+	ID: F2 06 03 00 FF FB 89 17
e10a2d
+	Version: Not Specified
e10a2d
+	Voltage: Unknown
e10a2d
+	External Clock: Unknown
e10a2d
+	Max Speed: 2900 MHz
e10a2d
+	Current Speed: 2900 MHz
e10a2d
+	Status: Populated, Enabled
e10a2d
+	Upgrade: Other
e10a2d
+
e10a2d
+Handle 0x0402, DMI type 4, 26 bytes
e10a2d
+Processor Information
e10a2d
+	Socket Designation: CPU 2
e10a2d
+	Type: Central Processor
e10a2d
+	Family: Other
e10a2d
+	Manufacturer: Intel
e10a2d
+	ID: F2 06 03 00 FF FB 89 17
e10a2d
+	Version: Not Specified
e10a2d
+	Voltage: Unknown
e10a2d
+	External Clock: Unknown
e10a2d
+	Max Speed: 2900 MHz
e10a2d
+	Current Speed: 2900 MHz
e10a2d
+	Status: Populated, Enabled
e10a2d
+	Upgrade: Other
e10a2d
+
e10a2d
+Handle 0x0B00, DMI type 11, 5 bytes
e10a2d
+OEM Strings
e10a2d
+	String 1: Xen
e10a2d
+
e10a2d
+Handle 0x1000, DMI type 16, 19 bytes
e10a2d
+Physical Memory Array
e10a2d
+	Location: Other
e10a2d
+	Use: System Memory
e10a2d
+	Error Correction Type: Multi-bit ECC
e10a2d
+	Maximum Capacity: 3840 MB
e10a2d
+	Error Information Handle: Not Provided
e10a2d
+	Number Of Devices: 1
e10a2d
+
e10a2d
+Handle 0x1100, DMI type 17, 34 bytes
e10a2d
+Memory Device
e10a2d
+	Array Handle: 0x1000
e10a2d
+	Error Information Handle: 0x0000
e10a2d
+	Total Width: 64 bits
e10a2d
+	Data Width: 64 bits
e10a2d
+	Size: 3840 MB
e10a2d
+	Form Factor: DIMM
e10a2d
+	Set: None
e10a2d
+	Locator: DIMM 0
e10a2d
+	Bank Locator: Not Specified
e10a2d
+	Type: RAM
e10a2d
+	Type Detail: None
e10a2d
+	Speed: Unknown
e10a2d
+	Manufacturer: Not Specified
e10a2d
+	Serial Number: Not Specified
e10a2d
+	Asset Tag: Not Specified
e10a2d
+	Part Number: Not Specified
e10a2d
+	Rank: Unknown
e10a2d
+	Configured Clock Speed: Unknown
e10a2d
+
e10a2d
+Handle 0x1300, DMI type 19, 31 bytes
e10a2d
+Memory Array Mapped Address
e10a2d
+	Starting Address: 0x00000000000
e10a2d
+	Ending Address: 0x000EFFFFFFF
e10a2d
+	Range Size: 3840 MB
e10a2d
+	Physical Array Handle: 0x1000
e10a2d
+	Partition Width: 1
e10a2d
+
e10a2d
+Handle 0x1400, DMI type 20, 35 bytes
e10a2d
+Memory Device Mapped Address
e10a2d
+	Starting Address: 0x00000000000
e10a2d
+	Ending Address: 0x000EFFFFFFF
e10a2d
+	Range Size: 3840 MB
e10a2d
+	Physical Device Handle: 0x1100
e10a2d
+	Memory Array Mapped Address Handle: 0x1300
e10a2d
+	Partition Row Position: 1
e10a2d
+
e10a2d
+Handle 0x2000, DMI type 32, 11 bytes
e10a2d
+System Boot Information
e10a2d
+	Status: No errors detected
e10a2d
+
e10a2d
+Handle 0x7F00, DMI type 127, 4 bytes
e10a2d
+End Of Table
e10a2d
+
e10a2d
+EOF
e10a2d
diff --git a/tests/aws-xen-x86/sbin/uname b/tests/aws-xen-x86/sbin/uname
e10a2d
new file mode 100755
e10a2d
index 0000000..ab0ec89
e10a2d
--- /dev/null
e10a2d
+++ b/tests/aws-xen-x86/sbin/uname
e10a2d
@@ -0,0 +1,2 @@
e10a2d
+#!/bin/sh -
e10a2d
+echo x86_64
e10a2d
diff --git a/tests/aws-xen-x86/sbin/virt-what-cpuid-helper b/tests/aws-xen-x86/sbin/virt-what-cpuid-helper
e10a2d
new file mode 100755
e10a2d
index 0000000..8d8df4a
e10a2d
--- /dev/null
e10a2d
+++ b/tests/aws-xen-x86/sbin/virt-what-cpuid-helper
e10a2d
@@ -0,0 +1,2 @@
e10a2d
+#!/bin/sh -
e10a2d
+echo XenVMMXenVMM
e10a2d
diff --git a/tests/test-aws-xen-x86.sh b/tests/test-aws-xen-x86.sh
e10a2d
new file mode 100755
e10a2d
index 0000000..22b7f83
e10a2d
--- /dev/null
e10a2d
+++ b/tests/test-aws-xen-x86.sh
e10a2d
@@ -0,0 +1,36 @@
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-xen-x86
e10a2d
+
e10a2d
+output="$(./virt-what --test-root=$root 2>&1)"
e10a2d
+expected="xen
e10a2d
+xen-hvm
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
-- 
e10a2d
2.23.0
e10a2d