summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaresh Kamboju <naresh.kamboju@linaro.org>2017-01-18 11:16:22 +0530
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2017-01-19 15:54:15 +0000
commitc3a32af92982385744186595b51ca366ab1cda2d (patch)
treece72d450fe01de3f2916f7142ff99668a1956ed5
parent3d25d4319afbbc485c0f194f394dbe25ce079d2e (diff)
automated: added Linux mmc test
MMC is the "multi-media card" bus protocol. The MultiMediaCard (MMC) is a memory card standard used for solid-state storage. MMC test will check kernel configuration and list connected mmc and emmc devices. CONFIG_MMC=y CONFIG_MMC_SDHCI=y Change-Id: I40150d11233f23b4cf615a43bb25186e982dd680 Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
-rwxr-xr-xautomated/linux/mmc/mmc-test.sh62
-rw-r--r--automated/linux/mmc/mmc-test.yaml28
2 files changed, 90 insertions, 0 deletions
diff --git a/automated/linux/mmc/mmc-test.sh b/automated/linux/mmc/mmc-test.sh
new file mode 100755
index 0000000..2461e20
--- /dev/null
+++ b/automated/linux/mmc/mmc-test.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+#
+# MMC test cases
+#
+# Copyright (C) 2017, Linaro Limited.
+#
+# This program 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 2
+# of the License, or (at your option) any later version.
+#
+# This program 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, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Author: Naresh Kamboju <naresh.kamboju@linaro.org>
+#
+
+# shellcheck disable=SC1091
+. ../../lib/sh-test-lib
+OUTPUT="$(pwd)/output"
+RESULT_FILE="${OUTPUT}/result.txt"
+export RESULT_FILE
+
+# List the mmc devices
+list_all_mmc_devices() {
+ info_msg "Running list-all-mmc-devices test..."
+ lsblk | grep "mmc"
+ exit_on_fail "mmc"
+}
+
+# Test run.
+! check_root && error_msg "This script must be run as root"
+[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
+mkdir -p "${OUTPUT}"
+
+info_msg "About to run MMC test..."
+info_msg "Output directory: ${OUTPUT}"
+
+# Check kernel config
+if [ -f /proc/config.gz ]
+then
+ CONFIG_MMC=$(zcat /proc/config.gz | grep "CONFIG_MMC=")
+ CONFIG_MMC_SDHCI=$(zcat /proc/config.gz | grep "CONFIG_MMC_SDHCI=")
+elif [ -f /boot/config-"$(uname -r)" ]
+then
+ KERNEL_CONFIG_FILE="/boot/config-$(uname -r)"
+ CONFIG_MMC=$(grep "CONFIG_MMC=" "${KERNEL_CONFIG_FILE}")
+ CONFIG_MMC_SDHCI=$(grep "CONFIG_MMC_SDHCI=" "${KERNEL_CONFIG_FILE}")
+else
+ exit_on_skip "mmc-pre-requirements" "Kernel config file not available"
+fi
+
+( [ "${CONFIG_MMC}" = "CONFIG_MMC=y" ] || [ "${CONFIG_MMC}" = "CONFIG_MMC=m" ] ) && ( [ "${CONFIG_MMC_SDHCI}" = "CONFIG_MMC_SDHCI=y" ] || [ "${CONFIG_MMC_SDHCI}" = "CONFIG_MMC_SDHCI=m" ] )
+exit_on_skip "mmc-pre-requirements" "Kernel config CONFIG_MMC=y or CONFIG_MMC=m and CONFIG_MMC_SDHCI=y or CONFIG_MMC_SDHCI=m not enabled"
+
+list_all_mmc_devices
diff --git a/automated/linux/mmc/mmc-test.yaml b/automated/linux/mmc/mmc-test.yaml
new file mode 100644
index 0000000..810c4d7
--- /dev/null
+++ b/automated/linux/mmc/mmc-test.yaml
@@ -0,0 +1,28 @@
+metadata:
+ format: Lava-Test Test Definition 1.0
+ name: mmc-test
+ description: "The Multi Media Card (MMC) is a memory card standard used for solid-state storage
+ This will perform Basic MMC tests"
+ maintainer:
+ - naresh.kamboju@linaro.org
+ os:
+ - debian
+ - ubuntu
+ - centos
+ - fedora
+ - openembedded
+ scope:
+ - functional
+ devices:
+ - panda
+ - panda-es
+ - arndale
+ - beaglebone-black
+ - hi6220-hikey
+ - apq8016-sbc
+
+run:
+ steps:
+ - cd ./automated/linux/mmc
+ - ./mmc-test.sh
+ - ../../utils/send-to-lava.sh ./output/result.txt