summaryrefslogtreecommitdiffstats
path: root/scripts/qemuimage-tests/tools/dmesg.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/qemuimage-tests/tools/dmesg.sh')
-rw-r--r--scripts/qemuimage-tests/tools/dmesg.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/qemuimage-tests/tools/dmesg.sh b/scripts/qemuimage-tests/tools/dmesg.sh
new file mode 100644
index 0000000000..66c022343b
--- /dev/null
+++ b/scripts/qemuimage-tests/tools/dmesg.sh
@@ -0,0 +1,26 @@
1#!/bin/bash
2# Dmesg test script running in QEMU
3#
4# Author: Jiajun Xu <jiajun.xu@intel.com>
5#
6# This file is licensed under the GNU General Public License,
7# Version 2.
8#
9
10which dmesg
11if [ $? -ne 0 ]; then
12 echo "QEMU: No dmesg command found"
13 exit 1
14fi
15
16dmesg | grep -iq "error"
17if [ $? -eq 0 ]; then
18 echo "QEMU: There is some error log in dmesg:"
19 echo "QEMU: ##### Error Log ######"
20 dmesg | grep -i "error"
21 echo "QEMU: ##### End ######"
22 exit 1
23else
24 echo "QEMU: No error log in dmesg"
25 exit 0
26fi