summaryrefslogtreecommitdiff
path: root/tests/ts/lscpu
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ts/lscpu')
-rw-r--r--tests/ts/lscpu/dumps/i386-amdshanghai.tar.gzbin0 -> 3395 bytes
-rw-r--r--tests/ts/lscpu/dumps/i386-dellpe700.tar.gzbin0 -> 799 bytes
-rw-r--r--tests/ts/lscpu/dumps/i386-intels5000phb.tar.gzbin0 -> 2865 bytes
-rw-r--r--tests/ts/lscpu/dumps/ia64-512cpus.tar.gzbin0 -> 67254 bytes
-rw-r--r--tests/ts/lscpu/dumps/ia64-hpmatterhorn.tar.gzbin0 -> 3514 bytes
-rw-r--r--tests/ts/lscpu/dumps/ia64-hprx1620.tar.gzbin0 -> 1384 bytes
-rw-r--r--tests/ts/lscpu/dumps/ia64-pg0.tar.gzbin0 -> 7784 bytes
-rw-r--r--tests/ts/lscpu/dumps/ppc64-POWER7.tar.gzbin0 -> 14350 bytes
-rw-r--r--tests/ts/lscpu/dumps/s390-kvm.tar.gzbin0 -> 2275 bytes
-rw-r--r--tests/ts/lscpu/dumps/s390-lpar.tar.gzbin0 -> 6611 bytes
-rw-r--r--tests/ts/lscpu/dumps/s390-zvm.tar.gzbin0 -> 2582 bytes
-rw-r--r--tests/ts/lscpu/dumps/sparc64-UltraSparc-T1.tar.gzbin0 -> 23071 bytes
-rw-r--r--tests/ts/lscpu/dumps/x86_64-64cpu.tar.gzbin0 -> 153140 bytes
-rw-r--r--tests/ts/lscpu/dumps/x86_64-dell_e4310.tar.gzbin0 -> 12933 bytes
-rw-r--r--tests/ts/lscpu/dumps/x86_64-dell_poweredge1950.tar.gzbin0 -> 1492 bytes
-rw-r--r--tests/ts/lscpu/dumps/x86_64-dell_poweredgeR610.tar.gzbin0 -> 14095 bytes
-rw-r--r--tests/ts/lscpu/dumps/x86_64-dellr710.tar.gzbin0 -> 14300 bytes
-rw-r--r--tests/ts/lscpu/dumps/x86_64-el5xen.tar.gzbin0 -> 7296 bytes
-rw-r--r--tests/ts/lscpu/dumps/x86_64-hpdl585.tar.gzbin0 -> 6910 bytes
-rw-r--r--tests/ts/lscpu/dumps/x86_64-ibme326m.tar.gzbin0 -> 1461 bytes
-rw-r--r--tests/ts/lscpu/dumps/x86_64-necem14.tar.gzbin0 -> 1307 bytes
-rwxr-xr-xtests/ts/lscpu/lscpu50
-rw-r--r--tests/ts/lscpu/mk-input.sh43
23 files changed, 93 insertions, 0 deletions
diff --git a/tests/ts/lscpu/dumps/i386-amdshanghai.tar.gz b/tests/ts/lscpu/dumps/i386-amdshanghai.tar.gz
new file mode 100644
index 0000000..199c22b
--- /dev/null
+++ b/tests/ts/lscpu/dumps/i386-amdshanghai.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/i386-dellpe700.tar.gz b/tests/ts/lscpu/dumps/i386-dellpe700.tar.gz
new file mode 100644
index 0000000..a18a779
--- /dev/null
+++ b/tests/ts/lscpu/dumps/i386-dellpe700.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/i386-intels5000phb.tar.gz b/tests/ts/lscpu/dumps/i386-intels5000phb.tar.gz
new file mode 100644
index 0000000..36c9811
--- /dev/null
+++ b/tests/ts/lscpu/dumps/i386-intels5000phb.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/ia64-512cpus.tar.gz b/tests/ts/lscpu/dumps/ia64-512cpus.tar.gz
new file mode 100644
index 0000000..caae22d
--- /dev/null
+++ b/tests/ts/lscpu/dumps/ia64-512cpus.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/ia64-hpmatterhorn.tar.gz b/tests/ts/lscpu/dumps/ia64-hpmatterhorn.tar.gz
new file mode 100644
index 0000000..b5f1516
--- /dev/null
+++ b/tests/ts/lscpu/dumps/ia64-hpmatterhorn.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/ia64-hprx1620.tar.gz b/tests/ts/lscpu/dumps/ia64-hprx1620.tar.gz
new file mode 100644
index 0000000..37bcb17
--- /dev/null
+++ b/tests/ts/lscpu/dumps/ia64-hprx1620.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/ia64-pg0.tar.gz b/tests/ts/lscpu/dumps/ia64-pg0.tar.gz
new file mode 100644
index 0000000..f30d792
--- /dev/null
+++ b/tests/ts/lscpu/dumps/ia64-pg0.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/ppc64-POWER7.tar.gz b/tests/ts/lscpu/dumps/ppc64-POWER7.tar.gz
new file mode 100644
index 0000000..c8fcc23
--- /dev/null
+++ b/tests/ts/lscpu/dumps/ppc64-POWER7.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/s390-kvm.tar.gz b/tests/ts/lscpu/dumps/s390-kvm.tar.gz
new file mode 100644
index 0000000..340f7ea
--- /dev/null
+++ b/tests/ts/lscpu/dumps/s390-kvm.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/s390-lpar.tar.gz b/tests/ts/lscpu/dumps/s390-lpar.tar.gz
new file mode 100644
index 0000000..59aea6a
--- /dev/null
+++ b/tests/ts/lscpu/dumps/s390-lpar.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/s390-zvm.tar.gz b/tests/ts/lscpu/dumps/s390-zvm.tar.gz
new file mode 100644
index 0000000..b13594d
--- /dev/null
+++ b/tests/ts/lscpu/dumps/s390-zvm.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/sparc64-UltraSparc-T1.tar.gz b/tests/ts/lscpu/dumps/sparc64-UltraSparc-T1.tar.gz
new file mode 100644
index 0000000..15bfeef
--- /dev/null
+++ b/tests/ts/lscpu/dumps/sparc64-UltraSparc-T1.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/x86_64-64cpu.tar.gz b/tests/ts/lscpu/dumps/x86_64-64cpu.tar.gz
new file mode 100644
index 0000000..4d7516e
--- /dev/null
+++ b/tests/ts/lscpu/dumps/x86_64-64cpu.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/x86_64-dell_e4310.tar.gz b/tests/ts/lscpu/dumps/x86_64-dell_e4310.tar.gz
new file mode 100644
index 0000000..2988cbc
--- /dev/null
+++ b/tests/ts/lscpu/dumps/x86_64-dell_e4310.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/x86_64-dell_poweredge1950.tar.gz b/tests/ts/lscpu/dumps/x86_64-dell_poweredge1950.tar.gz
new file mode 100644
index 0000000..ef3f73e
--- /dev/null
+++ b/tests/ts/lscpu/dumps/x86_64-dell_poweredge1950.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/x86_64-dell_poweredgeR610.tar.gz b/tests/ts/lscpu/dumps/x86_64-dell_poweredgeR610.tar.gz
new file mode 100644
index 0000000..2f9fccd
--- /dev/null
+++ b/tests/ts/lscpu/dumps/x86_64-dell_poweredgeR610.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/x86_64-dellr710.tar.gz b/tests/ts/lscpu/dumps/x86_64-dellr710.tar.gz
new file mode 100644
index 0000000..2c16381
--- /dev/null
+++ b/tests/ts/lscpu/dumps/x86_64-dellr710.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/x86_64-el5xen.tar.gz b/tests/ts/lscpu/dumps/x86_64-el5xen.tar.gz
new file mode 100644
index 0000000..2ad47dd
--- /dev/null
+++ b/tests/ts/lscpu/dumps/x86_64-el5xen.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/x86_64-hpdl585.tar.gz b/tests/ts/lscpu/dumps/x86_64-hpdl585.tar.gz
new file mode 100644
index 0000000..89790b7
--- /dev/null
+++ b/tests/ts/lscpu/dumps/x86_64-hpdl585.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/x86_64-ibme326m.tar.gz b/tests/ts/lscpu/dumps/x86_64-ibme326m.tar.gz
new file mode 100644
index 0000000..5aff52f
--- /dev/null
+++ b/tests/ts/lscpu/dumps/x86_64-ibme326m.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/dumps/x86_64-necem14.tar.gz b/tests/ts/lscpu/dumps/x86_64-necem14.tar.gz
new file mode 100644
index 0000000..00ed35f
--- /dev/null
+++ b/tests/ts/lscpu/dumps/x86_64-necem14.tar.gz
Binary files differ
diff --git a/tests/ts/lscpu/lscpu b/tests/ts/lscpu/lscpu
new file mode 100755
index 0000000..a7d7a95
--- /dev/null
+++ b/tests/ts/lscpu/lscpu
@@ -0,0 +1,50 @@
+#!/bin/bash
+#
+# Copyright (C) 2008 Cai Qian <qcai@redhat.com>
+#
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+TS_TOPDIR="$(dirname $0)/../.."
+. $TS_TOPDIR/functions.sh
+
+ts_init "$*"
+
+for dump in $(ls $TS_SELF/dumps/*.tar.gz | sort); do
+ name=$(basename $dump .tar.gz)
+ dumpdir="$TS_OUTDIR/dumps"
+
+ ts_init_subtest $name
+ mkdir -p $dumpdir
+
+ tar -C $dumpdir -zxf $dump
+
+ # Architecture information is not applicable with -s.
+ "${TS_CMD_LSCPU}" -s "${dumpdir}/${name}" | \
+ grep -v "Architecture" >"${TS_OUTPUT}" 2>&1
+
+ echo >>"${TS_OUTPUT}"
+
+ "${TS_CMD_LSCPU}" -p -s "${dumpdir}/${name}" \
+ >>"${TS_OUTPUT}" 2>&1
+
+ # LE/BE depends on binary
+ sed -i -e '/Byte Order:.*/d' $TS_OUTPUT
+
+ ts_finalize_subtest
+done
+
+ts_finalize
+
diff --git a/tests/ts/lscpu/mk-input.sh b/tests/ts/lscpu/mk-input.sh
new file mode 100644
index 0000000..65e3d20
--- /dev/null
+++ b/tests/ts/lscpu/mk-input.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+#
+# Copyright (C) 2008-2009 Karel Zak <kzak@redhat.com>
+#
+# This script makes a copy of relevant files from /sys and /proc.
+# The files are useful for lscpu(1) regression tests.
+#
+progname=$(basename $0)
+
+if [ -z "$1" ]; then
+ echo -e "\nusage: $progname <testname>\n"
+ exit 1
+fi
+
+TS_NAME="$1"
+TS_DUMP="$TS_NAME"
+CP="cp -r --parents"
+
+mkdir -p $TS_DUMP/{proc,sys}
+
+$CP /proc/cpuinfo $TS_DUMP
+
+mkdir -p $TS_DUMP/proc/bus/pci
+$CP /proc/bus/pci/devices $TS_DUMP
+
+if [ -d "/proc/xen" ]; then
+ mkdir -p $TS_DUMP/proc/xen
+ if [ -f "/proc/xen/capabilities" ]; then
+ $CP /proc/xen/capabilities $TS_DUMP
+ fi
+fi
+
+if [ -e "/proc/sysinfo" ]; then
+ $CP /proc/sysinfo $TS_DUMP
+fi
+
+$CP /sys/devices/system/cpu/* $TS_DUMP
+$CP /sys/devices/system/node/*/cpumap $TS_DUMP
+
+tar zcvf $TS_NAME.tar.gz $TS_DUMP
+rm -rf $TS_DUMP
+
+