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

e10a2d
From f25e07d43db40355b321493f78758ea058fa3849 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 13/36] aws: Add regression test for AWS on KVM on ARM
e10a2d
 architecture.
e10a2d
e10a2d
---
e10a2d
 Makefile.am                                   |  1 +
e10a2d
 tests/aws-kvm-arm/proc/cpuinfo                |  9 +++
e10a2d
 tests/aws-kvm-arm/proc/self/status            | 54 +++++++++++++++
e10a2d
 tests/aws-kvm-arm/sbin/dmidecode              | 68 +++++++++++++++++++
e10a2d
 tests/aws-kvm-arm/sbin/uname                  |  2 +
e10a2d
 tests/aws-kvm-arm/sbin/virt-what-cpuid-helper |  2 +
e10a2d
 tests/test-aws-kvm-arm.sh                     | 36 ++++++++++
e10a2d
 7 files changed, 172 insertions(+)
e10a2d
 create mode 100644 tests/aws-kvm-arm/proc/cpuinfo
e10a2d
 create mode 100644 tests/aws-kvm-arm/proc/self/status
e10a2d
 create mode 100755 tests/aws-kvm-arm/sbin/dmidecode
e10a2d
 create mode 100755 tests/aws-kvm-arm/sbin/uname
e10a2d
 create mode 100755 tests/aws-kvm-arm/sbin/virt-what-cpuid-helper
e10a2d
 create mode 100755 tests/test-aws-kvm-arm.sh
e10a2d
e10a2d
diff --git a/Makefile.am b/Makefile.am
e10a2d
index 22680a0..67502fc 100644
e10a2d
--- a/Makefile.am
e10a2d
+++ b/Makefile.am
e10a2d
@@ -40,6 +40,7 @@ endif
e10a2d
 
e10a2d
 TESTS = \
e10a2d
 	tests/test-aws-baremetal-x86.sh \
e10a2d
+	tests/test-aws-kvm-arm.sh \
e10a2d
 	tests/test-aws-kvm-x86.sh \
e10a2d
 	tests/test-aws-xen-x86.sh \
e10a2d
 	tests/test-baremetal.sh \
e10a2d
diff --git a/tests/aws-kvm-arm/proc/cpuinfo b/tests/aws-kvm-arm/proc/cpuinfo
e10a2d
new file mode 100644
e10a2d
index 0000000..bc5a5bb
e10a2d
--- /dev/null
e10a2d
+++ b/tests/aws-kvm-arm/proc/cpuinfo
e10a2d
@@ -0,0 +1,9 @@
e10a2d
+processor	: 0
e10a2d
+BogoMIPS	: 166.66
e10a2d
+Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
e10a2d
+CPU implementer	: 0x41
e10a2d
+CPU architecture: 8
e10a2d
+CPU variant	: 0x0
e10a2d
+CPU part	: 0xd08
e10a2d
+CPU revision	: 3
e10a2d
+
e10a2d
diff --git a/tests/aws-kvm-arm/proc/self/status b/tests/aws-kvm-arm/proc/self/status
e10a2d
new file mode 100644
e10a2d
index 0000000..121a8cc
e10a2d
--- /dev/null
e10a2d
+++ b/tests/aws-kvm-arm/proc/self/status
e10a2d
@@ -0,0 +1,54 @@
e10a2d
+Name:	cat
e10a2d
+Umask:	0022
e10a2d
+State:	R (running)
e10a2d
+Tgid:	17874
e10a2d
+Ngid:	0
e10a2d
+Pid:	17874
e10a2d
+PPid:	9992
e10a2d
+TracerPid:	0
e10a2d
+Uid:	0	0	0	0
e10a2d
+Gid:	0	0	0	0
e10a2d
+FDSize:	256
e10a2d
+Groups:	0 
e10a2d
+NStgid:	17874
e10a2d
+NSpid:	17874
e10a2d
+NSpgid:	17874
e10a2d
+NSsid:	9992
e10a2d
+VmPeak:	  109760 kB
e10a2d
+VmSize:	  109760 kB
e10a2d
+VmLck:	       0 kB
e10a2d
+VmPin:	       0 kB
e10a2d
+VmHWM:	     832 kB
e10a2d
+VmRSS:	     832 kB
e10a2d
+RssAnon:	     448 kB
e10a2d
+RssFile:	     384 kB
e10a2d
+RssShmem:	       0 kB
e10a2d
+VmData:	     384 kB
e10a2d
+VmStk:	     192 kB
e10a2d
+VmExe:	      64 kB
e10a2d
+VmLib:	    1664 kB
e10a2d
+VmPTE:	     192 kB
e10a2d
+VmPMD:	     128 kB
e10a2d
+VmSwap:	       0 kB
e10a2d
+HugetlbPages:	       0 kB
e10a2d
+Threads:	1
e10a2d
+SigQ:	0/1470
e10a2d
+SigPnd:	0000000000000000
e10a2d
+ShdPnd:	0000000000000000
e10a2d
+SigBlk:	0000000000000000
e10a2d
+SigIgn:	0000000000000000
e10a2d
+SigCgt:	0000000000000000
e10a2d
+CapInh:	0000000000000000
e10a2d
+CapPrm:	0000003fffffffff
e10a2d
+CapEff:	0000003fffffffff
e10a2d
+CapBnd:	0000003fffffffff
e10a2d
+CapAmb:	0000000000000000
e10a2d
+NoNewPrivs:	0
e10a2d
+Seccomp:	0
e10a2d
+Speculation Store Bypass:	unknown
e10a2d
+Cpus_allowed:	1
e10a2d
+Cpus_allowed_list:	0
e10a2d
+Mems_allowed:	1
e10a2d
+Mems_allowed_list:	0
e10a2d
+voluntary_ctxt_switches:	0
e10a2d
+nonvoluntary_ctxt_switches:	0
e10a2d
diff --git a/tests/aws-kvm-arm/sbin/dmidecode b/tests/aws-kvm-arm/sbin/dmidecode
e10a2d
new file mode 100755
e10a2d
index 0000000..d126758
e10a2d
--- /dev/null
e10a2d
+++ b/tests/aws-kvm-arm/sbin/dmidecode
e10a2d
@@ -0,0 +1,68 @@
e10a2d
+#!/bin/sh -
e10a2d
+cat <<'EOF'
e10a2d
+# dmidecode 3.1
e10a2d
+Getting SMBIOS data from sysfs.
e10a2d
+SMBIOS 2.7 present.
e10a2d
+5 structures occupying 233 bytes.
e10a2d
+Table at 0x7F780000.
e10a2d
+
e10a2d
+Handle 0x0000, DMI type 0, 24 bytes
e10a2d
+BIOS Information
e10a2d
+	Vendor: Amazon EC2
e10a2d
+	Version: 1.0
e10a2d
+	Release Date: 12/1/2018
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: a1.medium
e10a2d
+	Version: Not Specified
e10a2d
+	Serial Number: ec2ce86a-12c2-9388-d9b0-8dc833cba752
e10a2d
+	UUID: ec2ce86a-12c2-9388-d9b0-8dc833cba752
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-01c1b85d3dcc02ed7
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 0xFEFF, DMI type 127, 4 bytes
e10a2d
+End Of Table
e10a2d
+
e10a2d
+EOF
e10a2d
diff --git a/tests/aws-kvm-arm/sbin/uname b/tests/aws-kvm-arm/sbin/uname
e10a2d
new file mode 100755
e10a2d
index 0000000..bd33a2d
e10a2d
--- /dev/null
e10a2d
+++ b/tests/aws-kvm-arm/sbin/uname
e10a2d
@@ -0,0 +1,2 @@
e10a2d
+#!/bin/sh -
e10a2d
+echo aarch64
e10a2d
diff --git a/tests/aws-kvm-arm/sbin/virt-what-cpuid-helper b/tests/aws-kvm-arm/sbin/virt-what-cpuid-helper
e10a2d
new file mode 100755
e10a2d
index 0000000..4475399
e10a2d
--- /dev/null
e10a2d
+++ b/tests/aws-kvm-arm/sbin/virt-what-cpuid-helper
e10a2d
@@ -0,0 +1,2 @@
e10a2d
+#!/bin/sh -
e10a2d
+# prints nothing but exits successfully
e10a2d
diff --git a/tests/test-aws-kvm-arm.sh b/tests/test-aws-kvm-arm.sh
e10a2d
new file mode 100755
e10a2d
index 0000000..8875421
e10a2d
--- /dev/null
e10a2d
+++ b/tests/test-aws-kvm-arm.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-kvm-arm
e10a2d
+
e10a2d
+output="$(./virt-what --test-root=$root 2>&1)"
e10a2d
+# XXX At the moment KVM cannot be detected on this platform.
e10a2d
+# We hope to fix that, but for now the only fact printed is "aws".
e10a2d
+expected="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