summaryrefslogtreecommitdiffstats
path: root/tests/ts/lsmem/mk-input.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xtests/ts/lsmem/mk-input.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ts/lsmem/mk-input.sh b/tests/ts/lsmem/mk-input.sh
new file mode 100755
index 0000000..bbdfff0
--- /dev/null
+++ b/tests/ts/lsmem/mk-input.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# This script makes a copy of relevant files from /sys.
+# The files are useful for lsmem(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 --parent"
+
+mkdir -p $TS_DUMP/sys/devices/system
+
+$CP /sys/devices/system/memory $TS_DUMP
+
+tar jcvf $TS_NAME.tar.bz2 $TS_DUMP
+rm -rf $TS_DUMP