summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Harkin <ryan.harkin@linaro.org>2019-09-10 19:05:41 +0100
committermwasilew <milosz.wasilewski@linaro.org>2019-09-11 09:37:14 +0100
commitc4aa07aef7a8619505ba7c9eaee85e447db8e652 (patch)
treece40a9ba4d72a69dbf1c122fdc7bdc308b5bfcd7
parentaa210b9763e7226cd94928ca3c7b9e6b869da464 (diff)
meminfo: add new testse
Add a new test based on automated/android/meminfo, but remove the Android specific parts. Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
-rwxr-xr-xautomated/linux/meminfo/meminfo.sh30
-rw-r--r--automated/linux/meminfo/meminfo.yaml22
2 files changed, 52 insertions, 0 deletions
diff --git a/automated/linux/meminfo/meminfo.sh b/automated/linux/meminfo/meminfo.sh
new file mode 100755
index 0000000..cb91609
--- /dev/null
+++ b/automated/linux/meminfo/meminfo.sh
@@ -0,0 +1,30 @@
+#!/bin/sh -e
+# shellcheck disable=SC1091
+
+OUTPUT="$(pwd)/output"
+RESULT_FILE="${OUTPUT}/result.txt"
+PROC_FILE="/proc/meminfo"
+
+. ../../lib/sh-test-lib
+
+create_out_dir "${OUTPUT}"
+
+info_msg "About to check ${PROC_FILE}..."
+
+# shellcheck disable=SC2002
+cat /proc/meminfo 2>&1 | tee "${OUTPUT}/proc-meminfo"
+
+## Parse proc-meminfo
+info_msg "Parsing results from ${PROC_FILE}"
+logfile="${OUTPUT}/proc-meminfo"
+# Capacity info.
+grep -E ".+: +[0-9]+ kB" "${logfile}" \
+ | sed 's/://g' \
+ | awk '{printf("%s pass %s kb\n", $1, $2)}' \
+ | tee -a "${RESULT_FILE}"
+
+# HugePages info.
+grep "HugePages_" "${logfile}" \
+ | sed 's/://g' \
+ | awk '{printf("%s pass %s\n", $1, $2)}' \
+ | tee -a "${RESULT_FILE}"
diff --git a/automated/linux/meminfo/meminfo.yaml b/automated/linux/meminfo/meminfo.yaml
new file mode 100644
index 0000000..1b86678
--- /dev/null
+++ b/automated/linux/meminfo/meminfo.yaml
@@ -0,0 +1,22 @@
+metadata:
+ name: meminfo
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "Collect the information in /proc/meminfo after boot."
+ maintainer:
+ - ryan.harkin@linaro.org
+ os:
+ - debian
+ - ubuntu
+ - fedora
+ - centos
+ - oe
+ scope:
+ - functional
+ devices:
+ - rzn1d
+
+run:
+ steps:
+ - cd ./automated/linux/meminfo
+ - ./meminfo.sh
+ - ../../utils/send-to-lava.sh ./output/result.txt