]> err.no Git - util-linux/commitdiff
tests: fix script that creates lscpu dumps
authorKarel Zak <kzak@redhat.com>
Wed, 27 May 2009 14:27:50 +0000 (16:27 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 27 May 2009 14:31:51 +0000 (16:31 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/ts/lscpu/mk-input.sh

index 1b2dd0cb3ca1a3a346f947ccba155b6a08a7067d..ddf70ec1ff842331d345fa833c88650f811c903a 100644 (file)
@@ -1,16 +1,10 @@
 #!/bin/bash
 #
-# Copyright (C) 2008 Karel Zak <kzak@redhat.com>
+# Copyright (C) 2008-2009 Karel Zak <kzak@redhat.com>
 #
 # This script makes a copy of relevant files from /sys and /proc.
 # The files are usefull for lscpu(1) regression tests.
 #
-# For exmaple:
-#
-#   # mk-lscpu-input ts-lscpu-i386-coolhw
-#   # lscpu --sysroot dumps/ts-lscpu-i386-coolhw
-#
-
 progname=$(basename $0)
 
 if [ -z "$1" ]; then
@@ -19,30 +13,27 @@ if [ -z "$1" ]; then
 fi
 
 TS_NAME="$1"
-TS_INPUT="dumps/$TS_NAME"
+TS_DUMP="$TS_NAME"
 CP="cp -r --parents"
 
-mkdir -p $TS_INPUT/{proc,sys}
+mkdir -p $TS_DUMP/{proc,sys}
 
-$CP /proc/cpuinfo $TS_INPUT
+$CP /proc/cpuinfo $TS_DUMP
 
-mkdir -p $TS_INPUT/proc/bus/pci
-$CP /proc/bus/pci/devices $TS_INPUT
+mkdir -p $TS_DUMP/proc/bus/pci
+$CP /proc/bus/pci/devices $TS_DUMP
 
 if [ -d "/proc/xen" ]; then
-       mkdir -p $TS_INPUT/proc/xen
+       mkdir -p $TS_DUMP/proc/xen
        if [ -f "/proc/xen/capabilities" ]; then
-               $CP /proc/xen/capabilities $TS_INPUT
+               $CP /proc/xen/capabilities $TS_DUMP
        fi
 fi
 
-for c in $(ls -d /sys/devices/system/cpu/cpu[0-9]*); do
-       mkdir -p $TS_INPUT/$c
-done
-
-$CP /sys/devices/system/cpu/cpu0/topology/{thread_siblings,core_siblings} $TS_INPUT
-$CP /sys/devices/system/cpu/cpu0/cache/*/{type,level,size,shared_cpu_map} $TS_INPUT
+$CP /sys/devices/system/cpu/* $TS_DUMP
+$CP /sys/devices/system/node/*/cpumap $TS_DUMP
 
-$CP /sys/devices/system/node/*/cpumap $TS_INPUT
+tar zcvf $TS_NAME.tar.gz $TS_DUMP
+rm -rf $TS_DUMP