summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorBotao Sun <botao.sun@linaro.org>2014-10-22 22:07:00 +1100
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2014-10-22 11:59:44 +0000
commit25bdb6399ce2c9c5c0206efd737932d7903da43a (patch)
tree16b7267b45691e05b4c89491ac9f45b0bc218a63 /common
parent82f2329aaee7f7356c4f50e3dd83ab8fbc6b78d1 (diff)
lshw.sh: POSIX Compliant Update.
This change is to make the test script to be POSIX compliant. Original patch comes from: Lucas Dutra Nunes <ldnunes@ossystems.com.br> Signed-off by: Botao Sun <botao.sun@linaro.org> Change-Id: I2af9c0f56a4dffbd7ec0639b94877a45c6b6f5ea
Diffstat (limited to 'common')
-rwxr-xr-xcommon/scripts/lshw.sh27
1 files changed, 25 insertions, 2 deletions
diff --git a/common/scripts/lshw.sh b/common/scripts/lshw.sh
index 2baaaa2..7910b4e 100755
--- a/common/scripts/lshw.sh
+++ b/common/scripts/lshw.sh
@@ -1,34 +1,57 @@
-#!/bin/bash
- lshw > lshw.txt
+#!/bin/sh
+#
+# Copyright (C) 2010 - 2014, 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.
+
+lshw > lshw.txt
+
if grep -E 'core' lshw.txt
then
lava-test-case user-space-lshw-core-present --result pass
else
lava-test-case user-space-lshw-core-present --result fail
fi
+
if grep 'firmware' lshw.txt
then
lava-test-case user-space-lshw-firmware-has-info --result pass
else
lava-test-case user-space-lshw-firmware-has-info --result fail
fi
+
if grep 'cpu' lshw.txt
then
lava-test-case user-space-lshw-cpu-has-info --result pass
else
lava-test-case user-space-lshw-cpu-has-info --result fail
fi
+
if grep 'network' lshw.txt
then
lava-test-case user-space-lshw-network-has-info --result pass
else
lava-test-case user-space-lshw-network-has-info --result fail
fi
+
if grep 'storage' lshw.txt
then
lava-test-case user-space-lshw-storage-has-info --result pass
else
lava-test-case user-space-lshw-storage-has-info --result fail
fi
+
cat lshw.txt
rm lshw.txt