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

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