Blame SOURCES/0013-aws-Add-regression-test-for-AWS-on-KVM-on-ARM-archit.patch

c18f13
From f25e07d43db40355b321493f78758ea058fa3849 Mon Sep 17 00:00:00 2001
c18f13
From: "Richard W.M. Jones" <rjones@redhat.com>
c18f13
Date: Wed, 31 Oct 2018 15:23:45 +0000
a41150
Subject: [PATCH 13/25] aws: Add regression test for AWS on KVM on ARM
c18f13
 architecture.
c18f13
c18f13
---
c18f13
 Makefile.am                                   |  1 +
c18f13
 tests/aws-kvm-arm/proc/cpuinfo                |  9 +++
c18f13
 tests/aws-kvm-arm/proc/self/status            | 54 +++++++++++++++
c18f13
 tests/aws-kvm-arm/sbin/dmidecode              | 68 +++++++++++++++++++
c18f13
 tests/aws-kvm-arm/sbin/uname                  |  2 +
c18f13
 tests/aws-kvm-arm/sbin/virt-what-cpuid-helper |  2 +
c18f13
 tests/test-aws-kvm-arm.sh                     | 36 ++++++++++
c18f13
 7 files changed, 172 insertions(+)
c18f13
 create mode 100644 tests/aws-kvm-arm/proc/cpuinfo
c18f13
 create mode 100644 tests/aws-kvm-arm/proc/self/status
c18f13
 create mode 100755 tests/aws-kvm-arm/sbin/dmidecode
c18f13
 create mode 100755 tests/aws-kvm-arm/sbin/uname
c18f13
 create mode 100755 tests/aws-kvm-arm/sbin/virt-what-cpuid-helper
c18f13
 create mode 100755 tests/test-aws-kvm-arm.sh
c18f13
c18f13
diff --git a/Makefile.am b/Makefile.am
c18f13
index 22680a0..67502fc 100644
c18f13
--- a/Makefile.am
c18f13
+++ b/Makefile.am
c18f13
@@ -40,6 +40,7 @@ endif
c18f13
 
c18f13
 TESTS = \
c18f13
 	tests/test-aws-baremetal-x86.sh \
c18f13
+	tests/test-aws-kvm-arm.sh \
c18f13
 	tests/test-aws-kvm-x86.sh \
c18f13
 	tests/test-aws-xen-x86.sh \
c18f13
 	tests/test-baremetal.sh \
c18f13
diff --git a/tests/aws-kvm-arm/proc/cpuinfo b/tests/aws-kvm-arm/proc/cpuinfo
c18f13
new file mode 100644
c18f13
index 0000000..bc5a5bb
c18f13
--- /dev/null
c18f13
+++ b/tests/aws-kvm-arm/proc/cpuinfo
c18f13
@@ -0,0 +1,9 @@
c18f13
+processor	: 0
c18f13
+BogoMIPS	: 166.66
c18f13
+Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
c18f13
+CPU implementer	: 0x41
c18f13
+CPU architecture: 8
c18f13
+CPU variant	: 0x0
c18f13
+CPU part	: 0xd08
c18f13
+CPU revision	: 3
c18f13
+
c18f13
diff --git a/tests/aws-kvm-arm/proc/self/status b/tests/aws-kvm-arm/proc/self/status
c18f13
new file mode 100644
c18f13
index 0000000..121a8cc
c18f13
--- /dev/null
c18f13
+++ b/tests/aws-kvm-arm/proc/self/status
c18f13
@@ -0,0 +1,54 @@
c18f13
+Name:	cat
c18f13
+Umask:	0022
c18f13
+State:	R (running)
c18f13
+Tgid:	17874
c18f13
+Ngid:	0
c18f13
+Pid:	17874
c18f13
+PPid:	9992
c18f13
+TracerPid:	0
c18f13
+Uid:	0	0	0	0
c18f13
+Gid:	0	0	0	0
c18f13
+FDSize:	256
c18f13
+Groups:	0 
c18f13
+NStgid:	17874
c18f13
+NSpid:	17874
c18f13
+NSpgid:	17874
c18f13
+NSsid:	9992
c18f13
+VmPeak:	  109760 kB
c18f13
+VmSize:	  109760 kB
c18f13
+VmLck:	       0 kB
c18f13
+VmPin:	       0 kB
c18f13
+VmHWM:	     832 kB
c18f13
+VmRSS:	     832 kB
c18f13
+RssAnon:	     448 kB
c18f13
+RssFile:	     384 kB
c18f13
+RssShmem:	       0 kB
c18f13
+VmData:	     384 kB
c18f13
+VmStk:	     192 kB
c18f13
+VmExe:	      64 kB
c18f13
+VmLib:	    1664 kB
c18f13
+VmPTE:	     192 kB
c18f13
+VmPMD:	     128 kB
c18f13
+VmSwap:	       0 kB
c18f13
+HugetlbPages:	       0 kB
c18f13
+Threads:	1
c18f13
+SigQ:	0/1470
c18f13
+SigPnd:	0000000000000000
c18f13
+ShdPnd:	0000000000000000
c18f13
+SigBlk:	0000000000000000
c18f13
+SigIgn:	0000000000000000
c18f13
+SigCgt:	0000000000000000
c18f13
+CapInh:	0000000000000000
c18f13
+CapPrm:	0000003fffffffff
c18f13
+CapEff:	0000003fffffffff
c18f13
+CapBnd:	0000003fffffffff
c18f13
+CapAmb:	0000000000000000
c18f13
+NoNewPrivs:	0
c18f13
+Seccomp:	0
c18f13
+Speculation Store Bypass:	unknown
c18f13
+Cpus_allowed:	1
c18f13
+Cpus_allowed_list:	0
c18f13
+Mems_allowed:	1
c18f13
+Mems_allowed_list:	0
c18f13
+voluntary_ctxt_switches:	0
c18f13
+nonvoluntary_ctxt_switches:	0
c18f13
diff --git a/tests/aws-kvm-arm/sbin/dmidecode b/tests/aws-kvm-arm/sbin/dmidecode
c18f13
new file mode 100755
c18f13
index 0000000..d126758
c18f13
--- /dev/null
c18f13
+++ b/tests/aws-kvm-arm/sbin/dmidecode
c18f13
@@ -0,0 +1,68 @@
c18f13
+#!/bin/sh -
c18f13
+cat <<'EOF'
c18f13
+# dmidecode 3.1
c18f13
+Getting SMBIOS data from sysfs.
c18f13
+SMBIOS 2.7 present.
c18f13
+5 structures occupying 233 bytes.
c18f13
+Table at 0x7F780000.
c18f13
+
c18f13
+Handle 0x0000, DMI type 0, 24 bytes
c18f13
+BIOS Information
c18f13
+	Vendor: Amazon EC2
c18f13
+	Version: 1.0
c18f13
+	Release Date: 12/1/2018
c18f13
+	Address: 0xF0000
c18f13
+	Runtime Size: 64 kB
c18f13
+	ROM Size: 64 kB
c18f13
+	Characteristics:
c18f13
+		PCI is supported
c18f13
+		EDD is supported
c18f13
+		ACPI is supported
c18f13
+		System is a virtual machine
c18f13
+	BIOS Revision: 1.0
c18f13
+
c18f13
+Handle 0x0001, DMI type 1, 27 bytes
c18f13
+System Information
c18f13
+	Manufacturer: Amazon EC2
c18f13
+	Product Name: a1.medium
c18f13
+	Version: Not Specified
c18f13
+	Serial Number: ec2ce86a-12c2-9388-d9b0-8dc833cba752
c18f13
+	UUID: ec2ce86a-12c2-9388-d9b0-8dc833cba752
c18f13
+	Wake-up Type: Power Switch
c18f13
+	SKU Number: Not Specified
c18f13
+	Family: Not Specified
c18f13
+
c18f13
+Handle 0x0002, DMI type 2, 15 bytes
c18f13
+Base Board Information
c18f13
+	Manufacturer: Amazon EC2
c18f13
+	Product Name: Not Specified
c18f13
+	Version: Not Specified
c18f13
+	Serial Number: Not Specified
c18f13
+	Asset Tag: i-01c1b85d3dcc02ed7
c18f13
+	Features: None
c18f13
+	Location In Chassis: Not Specified
c18f13
+	Chassis Handle: 0x0003
c18f13
+	Type: Other
c18f13
+	Contained Object Handles: 0
c18f13
+
c18f13
+Handle 0x0003, DMI type 3, 21 bytes
c18f13
+Chassis Information
c18f13
+	Manufacturer: Amazon EC2
c18f13
+	Type: Other
c18f13
+	Lock: Not Present
c18f13
+	Version: Not Specified
c18f13
+	Serial Number: Not Specified
c18f13
+	Asset Tag: Amazon EC2
c18f13
+	Boot-up State: Safe
c18f13
+	Power Supply State: Safe
c18f13
+	Thermal State: Safe
c18f13
+	Security Status: None
c18f13
+	OEM Information: 0x00000000
c18f13
+	Height: Unspecified
c18f13
+	Number Of Power Cords: 1
c18f13
+	Contained Elements: 0
c18f13
+
c18f13
+Handle 0xFEFF, DMI type 127, 4 bytes
c18f13
+End Of Table
c18f13
+
c18f13
+EOF
c18f13
diff --git a/tests/aws-kvm-arm/sbin/uname b/tests/aws-kvm-arm/sbin/uname
c18f13
new file mode 100755
c18f13
index 0000000..bd33a2d
c18f13
--- /dev/null
c18f13
+++ b/tests/aws-kvm-arm/sbin/uname
c18f13
@@ -0,0 +1,2 @@
c18f13
+#!/bin/sh -
c18f13
+echo aarch64
c18f13
diff --git a/tests/aws-kvm-arm/sbin/virt-what-cpuid-helper b/tests/aws-kvm-arm/sbin/virt-what-cpuid-helper
c18f13
new file mode 100755
c18f13
index 0000000..4475399
c18f13
--- /dev/null
c18f13
+++ b/tests/aws-kvm-arm/sbin/virt-what-cpuid-helper
c18f13
@@ -0,0 +1,2 @@
c18f13
+#!/bin/sh -
c18f13
+# prints nothing but exits successfully
c18f13
diff --git a/tests/test-aws-kvm-arm.sh b/tests/test-aws-kvm-arm.sh
c18f13
new file mode 100755
c18f13
index 0000000..8875421
c18f13
--- /dev/null
c18f13
+++ b/tests/test-aws-kvm-arm.sh
c18f13
@@ -0,0 +1,36 @@
c18f13
+# Test for AWS.
c18f13
+# Copyright (C) 2018 Red Hat Inc.
c18f13
+#
c18f13
+# This program is free software; you can redistribute it and/or modify
c18f13
+# it under the terms of the GNU General Public License as published by
c18f13
+# the Free Software Foundation; either version 2 of the License, or
c18f13
+# (at your option) any later version.
c18f13
+#
c18f13
+# This program is distributed in the hope that it will be useful,
c18f13
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
c18f13
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
c18f13
+# GNU General Public License for more details.
c18f13
+#
c18f13
+# You should have received a copy of the GNU General Public License
c18f13
+# along with this program; if not, write to the Free Software
c18f13
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
c18f13
+
c18f13
+root=tests/aws-kvm-arm
c18f13
+
c18f13
+output="$(./virt-what --test-root=$root 2>&1)"
c18f13
+# XXX At the moment KVM cannot be detected on this platform.
c18f13
+# We hope to fix that, but for now the only fact printed is "aws".
c18f13
+expected="aws"
c18f13
+
c18f13
+if [ "$output" != "$expected" ]; then
c18f13
+    echo "$0: test failed because output did not match expected"
c18f13
+    echo "Expected output was:"
c18f13
+    echo "----------------------------------------"
c18f13
+    echo "$expected"
c18f13
+    echo "----------------------------------------"
c18f13
+    echo "But the actual output of the program was:"
c18f13
+    echo "----------------------------------------"
c18f13
+    echo "$output"
c18f13
+    echo "----------------------------------------"
c18f13
+    exit 1
c18f13
+fi
c18f13
-- 
a41150
2.18.4
c18f13